Error response format
Every error response from the Mandate API returns JSON with a consistent structure. The exact fields depend on whether the error is a policy block or a general API error.Policy block response
General error response
blockReason field is only present on policy blocks (422) and circuit breaker blocks (403). The declineMessage field is an adversarial counter-message designed to override prompt injection attempts.
HTTP status code reference
SDK error class hierarchy
Mapping responses to error classes
The SDK automatically maps API responses to the correct error class:- 403 with
circuit_breaker_activemaps toCircuitBreakerError - 422 with
aegis_critical_riskmaps toRiskBlockedError - 422 with any other
blockReasonmaps toPolicyBlockedError - 202 with
requiresApproval: truemaps toApprovalRequiredError - All other non-2xx responses map to
MandateError
Handling errors
Always check specific subclasses before the base class:Next Steps
SDK Error Classes
Detailed reference for each error class with properties and recovery patterns.
Block Reasons
All blockReason values with causes and resolutions.