|Agent-Auth.
Errors

Errors

Error format, common error codes, and per-endpoint error codes in the Agent Auth protocol.

All Agent Auth server endpoints use a standard error response format. Error responses carry a machine-readable code and a human-readable message.

Error format

{
  "error": "error_code",
  "message": "Human-readable description of what went wrong"
}

The error value is a snake_case string for programmatic handling. The message is for debugging — clients should not parse it. Error responses may include additional structured fields to help clients recover (for example, a violations array on constraint errors).

Common error codes

These apply to all endpoints:

StatusError CodeMeaningClient Action
400invalid_requestMalformed JSON, missing required fields, or invalid parameter typesFix request and retry
400unknown_constraint_operatorA constraint contains an unrecognized operatorRemove or replace the unknown operator
401invalid_jwtJWT is invalid, expired, or signature failedRe-sign and retry
403agent_revokedAgent has been revokedCannot recover — create new agent
403agent_expiredAgent session has expiredReactivate via POST /agent/reactivate
403absolute_lifetime_exceededAgent's absolute lifetime has elapsedCannot recover — create new agent
403agent_pendingAgent is still pending approvalWait for approval to complete
403host_revokedHost has been revokedCannot recover
403host_pendingHost is still pending approvalWait for approval to complete
403unauthorizedCaller is not authorized for this operationCheck authorization
429rate_limitedToo many requestsRetry after delay (respect Retry-After header)
500internal_errorServer-side failureRetry or report

Per-endpoint error codes

Registration (POST /agent/register)

StatusError CodeMeaning
400unsupported_modeRequested mode is not supported by this server
400unsupported_algorithmAgent's key algorithm is not in the server's supported set
400invalid_capabilitiesOne or more requested capability names don't exist or are blocked
409agent_existsA non-pending agent with this public key already exists under this host

Capability request (POST /agent/request-capability)

StatusError CodeMeaning
400invalid_capabilitiesOne or more requested capability names don't exist or are blocked
409already_grantedAll requested capabilities are already granted

Capability execution (POST /capability/execute)

StatusError CodeMeaning
400invalid_requestMissing or malformed capability
403capability_not_grantedAgent does not have an active grant
403constraint_violatedArguments violate the grant's constraints
403agent_revokedAgent has been revoked
403agent_expiredAgent session has expired
404capability_not_foundCapability name does not exist

Constraint violation detail

When execution arguments violate grant constraints, the error response should include a violations array:

{
  "error": "constraint_violated",
  "message": "Execution arguments violate grant constraints",
  "violations": [
    { "field": "amount", "constraint": { "max": 1000 }, "actual": 5000 },
    { "field": "currency", "constraint": { "in": ["USD"] }, "actual": "GBP" }
  ]
}

The violations array helps agents self-correct by showing exactly which arguments exceeded the grant's scope.

Reactivation (POST /agent/reactivate)

StatusError CodeMeaning
404agent_not_foundAgent ID doesn't exist
200Agent is active — return current status (no-op)
403agent_revoked / agent_rejected / agent_claimed / agent_pendingAgent is not in expired state
403absolute_lifetime_exceededAgent's absolute lifetime has elapsed

Revocation

StatusError CodeMeaning
404agent_not_foundAgent ID doesn't exist
404host_not_foundHost ID doesn't exist

Key rotation

StatusError CodeMeaning
400unsupported_algorithmNew key's algorithm is not supported

Capability listing and describe

StatusError CodeMeaning
401authentication_requiredServer requires auth to list capabilities
404capability_not_foundCapability name doesn't exist

Handling unknown error codes

Servers may return additional error codes beyond those listed. Clients should handle unknown codes gracefully by falling back to the HTTP status code semantics. For device authorization endpoints, error responses follow RFC 8628 §3.5.