Skip to Content
AgentShield
API Reference

Error Responses

The shared error envelope, every error code, what causes it, and how a client should react.

Both APIs return errors in one envelope:

{
  "error": {
    "code": "validation_failed",
    "message": "request validation failed",
    "request_id": "1b6e2a90-3c4d-4e5f-8a7b-9c0d1e2f3a4b"
  }
}
FieldMeaning
codeStable, machine-readable identifier. Branch on this
messageHuman-readable and safe to show. Never contains stack traces, SQL, or secret values. May change between versions
request_idUUID for correlating with logs
detailsControl plane only, on some validation errors: [{ "field", "issue" }]

A deny is not an error

A deny from authorize is a recorded decision, returned with HTTP 403 and the decision body, not the error envelope. The SDKs raise Denied for it.

Codes

CodeTypical statusMeaningClient action
unauthenticated401Missing or invalid signature or session, replayed nonce, wrong credential type for the serviceFix credentials; never retry the same nonce
forbidden403Role not allowed (control plane), or decision is deny / agent inactive (execute)Do not retry
password_change_required403Session from a temporary passwordChange the password first
self_approval403Approver's user id equals the agent idAnother person must decide
validation_failed400, 413Body, parameter, or adapter validation failed; body too largeFix the request
not_found404Resource does not exist in your organization, or the route is not registeredDo not retry
conflict409Idempotency mismatch, arguments mismatch, approval mismatch or not pending, execution already failed or dispatched, name or key already existsRe-authorize or change the request
approval_required409Execute of a held decision without an approved approvalWait for approval
approval_expired409Approval passed its 15-minute expiryAuthorize again
rate_limited429Request, tool-call, or token budget exceededBack off; the window is 60 s
circuit_open503Tool circuit open after repeated adapter failuresRetry after 30 s
not_implemented501No adapter for this tool or operationDo not retry
internal_error500Dependency or server failure, including adapter timeoutAuthorize again later; never assume success

Gateway messages

MessageCode
human sessions are not accepted by the gatewayunauthenticated
agent signature headers are requiredunauthenticated
authentication failedunauthenticated
nonce already usedunauthenticated
request body is required / request body is invalidvalidation_failed
arguments must be an object / arguments are invalidvalidation_failed
request rate limit exceeded / tool call limit exceeded / token budget exceededrate_limited
idempotency key does not match this requestconflict (authorize)
idempotency key does not match the decisionconflict (execute)
arguments do not match the decisionconflict
decision is denyforbidden
decision requires approvalapproval_required
approval does not apply to this decision / approval does not match this decisionconflict
execution cannot be completedconflict
no adapter is registered for this toolnot_implemented
tool circuit is opencircuit_open
tool adapter timed outinternal_error

Failing closed

No error means "allowed". When a client cannot tell whether a call ran, for example after a network failure during execute, it should not assume success or retry blindly. A repeat execute of the same decision either returns the stored result (it completed) or 409 (it failed or was interrupted), and never runs the adapter twice.

SDK mapping

ResponsePythonTypeScript
Decision deny (from call_tool)DeniedDenied
Decision require_approval (from call_tool)ApprovalRequiredApprovalRequired
Error envelopeGatewayError(status, code, message)GatewayError with status, code, message
Non-JSON or unexpected responseGatewayError(…, "invalid_response", …)GatewayError(…, "invalid_response", …)

Was this page helpful?

On this page