Error Response Format
All AIP errors follow the JSON-RPC 2.0 error format:Numeric error code from the table below.
Short error description.
Error Codes
-32001 Forbidden
Description: Tool not inallowed_tools list or explicitly blocked.
When it occurs:
- Tool is not in the
allowed_toolslist - Tool has a rule with
action: block - Argument validation failed
- Protected path access attempted
- Add the tool to
spec.allowed_tools - Remove
action: blockfrom the tool rule - Adjust
allow_argsregex patterns if argument validation failed
-32002 Rate Limited
Description: Rate limit exceeded for this tool. When it occurs:- Tool has a
rate_limitrule and the limit was exceeded - Rate limits are always enforced, even in
monitormode
- Wait for the rate limit window to reset
- Increase the rate limit in the policy
- Optimize agent behavior to make fewer calls
-32004 User Denied
Description: User rejected the approval prompt. When it occurs:- Tool has
action: askrule - User clicked “Deny” in the approval dialog
-32005 User Timeout
Description: Approval prompt timed out (no user response). When it occurs:- Tool has
action: askrule - User did not respond within 60 seconds
-32006 Method Not Allowed
Description: JSON-RPC method not permitted by policy. When it occurs:- Method is not in
spec.allowed_methods - Method is in
spec.denied_methods
-32007 Protected Path
Description: Access to protected path blocked. When it occurs:- Tool argument contains a path in
spec.protected_paths - Tool argument references the policy file itself (automatically protected)
- Remove the path from
spec.protected_pathsif access should be allowed - Use a different path that is not protected
v1alpha2 Error Codes
The following error codes were introduced in v1alpha2 for identity and schema validation.-32008 Token Required
Description: Identity token required but not provided. When it occurs:- Policy has
identity.require_token: true - Request does not include a valid identity token
- Ensure the agent includes the identity token in requests
- Set
identity.require_token: falseif tokens are optional
-32009 Token Invalid
Description: Identity token validation failed. When it occurs:- Token is expired
- Policy hash mismatch
- Session binding mismatch
- Replay detected (nonce reuse)
- Malformed token structure
token_error values:
Specific reason for token validation failure:
token_expired- Token past expiration timepolicy_changed- Policy hash mismatchsession_mismatch- Session binding mismatchbinding_mismatch- Strict binding validation failedreplay_detected- Nonce reuse detectedaudience_mismatch- Token audience does not matchmalformed- Token structure invalid
-32010 Policy Signature Invalid
Description: Policy signature verification failed. When it occurs:- Policy has
metadata.signaturefield - Signature verification failed (policy was tampered with)
-32011 Token Revoked
Description: Token or session was explicitly revoked. When it occurs:- Token was revoked via the
/v1/revokeendpoint - Entire session was revoked
Type of revocation:
session- Entire session was revoked (all tokens invalid)token- Specific token was revoked (by nonce)
-32012 Audience Mismatch
Description: Token audience does not match expected value. When it occurs:- Token’s
audclaim does not matchidentity.audienceormetadata.name - Token was issued for a different MCP server
token_audience value may be omitted from client responses to prevent information disclosure.
-32013 Schema Mismatch
Description: Tool schema hash does not match policy expectation. When it occurs:- Tool has
schema_hashin its rule - Tool’s current schema does not match the expected hash
- Tool definition was changed after policy was created
- Alert security teams immediately
- Log full schema details for forensic analysis
- Consider blocking the MCP server until verified
-32014 DLP Redaction Failed
Description: Request redaction produced invalid content. When it occurs:- DLP is configured with
on_request_match: "redact" - Redacted request fails argument validation or breaks JSON structure
- Configured with
on_redaction_failure: "block"or"reject"
Error Handling Best Practices
For Agent Developers
-
Parse error codes programmatically:
-
Handle rate limiting gracefully:
-
Refresh tokens on expiration:
For Policy Authors
-
Test policies in monitor mode first:
-
Check audit logs for unexpected errors:
-
Use descriptive error reasons:
Error Code Summary Table
| Code | Name | Severity | Always Enforced? |
|---|---|---|---|
| -32001 | Forbidden | High | No (monitor mode) |
| -32002 | Rate Limited | Medium | Yes |
| -32004 | User Denied | Low | Yes |
| -32005 | User Timeout | Low | Yes |
| -32006 | Method Not Allowed | High | No (monitor mode) |
| -32007 | Protected Path | Critical | Yes |
| -32008 | Token Required | High | Yes |
| -32009 | Token Invalid | High | Yes |
| -32010 | Policy Signature Invalid | Critical | Yes |
| -32011 | Token Revoked | High | Yes |
| -32012 | Audience Mismatch | High | Yes |
| -32013 | Schema Mismatch | Critical | Yes |
| -32014 | DLP Redaction Failed | High | Yes |
monitor mode for security reasons.
Next Steps
Policy YAML
Complete policy YAML reference
Audit Format
Audit log format specification
Token Format
AAT token structure reference
Troubleshooting
Common issues and solutions