Compliance Levels
Sellers can adopt error handling incrementally. Each level builds on the previous:| Level | What to implement | What agents can do |
|---|---|---|
| Level 1 | Return code + message on every error | Agents match on error code to classify failures |
| Level 2 | Add recovery, retry_after, field, and suggestion | Agents auto-retry transient errors and self-correct correctable ones |
| Level 3 | Use transport bindings to put errors in structuredContent (MCP) or artifact DataPart (A2A) | Programmatic clients get typed errors without parsing text |
recovery, agents must guess from the error code. Level 3 is where client libraries like @adcp/client can provide fully typed error objects.
Error Categories
1. Protocol Errors
Transport/connection issues not related to AdCP business logic:- Network timeouts
- Connection refused
- TLS/SSL errors
- JSON parsing errors
2. Task Errors
Business logic failures returned asstatus: "failed":
- Insufficient inventory
- Invalid targeting
- Budget validation failures
- Resource not found
recovery field to determine whether to retry, fix the request, or escalate.
3. Validation Errors
Malformed requests that fail schema validation:- Missing required fields
- Invalid field types
- Out-of-range values
Error Response Format
Failed operations return statusfailed with error details. The error object follows the error.json schema:
Error Object Fields
These fields are defined by theerror.json schema:
| Field | Type | Required | Description |
|---|---|---|---|
code | string | Yes | Machine-readable error code from the standard vocabulary or a seller-specific code |
message | string | Yes | Human-readable error description |
recovery | string | No | Agent recovery classification: transient, correctable, or terminal |
retry_after | number | No | Seconds to wait before retrying (transient errors) |
field | string | No | Field path that caused the error (e.g., packages[0].targeting) |
suggestion | string | No | Suggested fix for the error |
details | object | No | Additional context-specific information |
Standard Error Codes
AdCP defines 20 standard error codes inerror-code.json. Sellers MAY use codes not in this vocabulary for platform-specific errors. Agents MUST handle unknown codes by falling back to the recovery classification.
Authentication and Access
| Code | Recovery | Description | Resolution |
|---|---|---|---|
AUTH_REQUIRED | correctable | Authentication is required or credentials are invalid | Provide credentials via auth header |
ACCOUNT_NOT_FOUND | terminal | Account reference could not be resolved | Verify via list_accounts or contact seller |
ACCOUNT_SETUP_REQUIRED | correctable | Account needs setup before use | Check details.setup for URL or instructions |
ACCOUNT_AMBIGUOUS | correctable | Natural key resolves to multiple accounts | Pass explicit account_id or a more specific natural key |
ACCOUNT_PAYMENT_REQUIRED | terminal | Outstanding balance requires payment | Buyer must resolve billing |
ACCOUNT_SUSPENDED | terminal | Account has been suspended | Contact seller to resolve |
Request Validation
| Code | Recovery | Description | Resolution |
|---|---|---|---|
INVALID_REQUEST | correctable | Request is malformed or violates schema constraints | Check request parameters and fix |
UNSUPPORTED_FEATURE | correctable | Requested feature not supported by this seller | Check get_adcp_capabilities and remove unsupported fields |
POLICY_VIOLATION | correctable | Request violates content or advertising policies | Review policy requirements in the error details |
COMPLIANCE_UNSATISFIED | correctable | Required disclosure cannot be satisfied by the target format | Choose a format that supports the required disclosure capabilities |
Inventory and Products
| Code | Recovery | Description | Resolution |
|---|---|---|---|
PRODUCT_NOT_FOUND | correctable | Referenced product IDs are unknown or expired | Remove invalid IDs, or re-discover with get_products |
PRODUCT_UNAVAILABLE | correctable | Product is sold out or no longer available | Choose a different product |
PROPOSAL_EXPIRED | correctable | Referenced proposal has passed its expires_at | Run get_products to get a fresh proposal |
AUDIENCE_TOO_SMALL | correctable | Audience segment below minimum size | Broaden targeting or upload more audience members |
Budget and Creative
| Code | Recovery | Description | Resolution |
|---|---|---|---|
BUDGET_TOO_LOW | correctable | Budget below seller’s minimum | Increase budget or check capabilities.media_buy.limits |
BUDGET_EXHAUSTED | terminal | Account or campaign budget fully spent | Buyer must add funds or increase budget cap |
CREATIVE_REJECTED | correctable | Creative failed content policy review | Revise per seller’s advertising_policies |
System
| Code | Recovery | Description | Resolution |
|---|---|---|---|
RATE_LIMITED | transient | Request rate exceeded | Wait for retry_after seconds, then retry |
SERVICE_UNAVAILABLE | transient | Seller service temporarily unavailable | Retry with exponential backoff |
CONFLICT | transient | Concurrent modification detected | Re-read the resource and retry with current state |
Recovery Classification
Use therecovery field to determine how to handle errors:
| Recovery | Meaning | Action |
|---|---|---|
transient | Temporary failure (rate limit, service unavailable, conflict) | Retry after retry_after or with exponential backoff |
correctable | Request can be fixed and resent (invalid field, budget too low, creative rejected) | Modify the request and retry |
terminal | Requires human action (account suspended, payment required) | Escalate to a human operator |
recovery values (forward compatibility), treat as terminal.
Retry Logic
Exponential Backoff
Implement exponential backoff for retryable errors:Rate Limit Handling
Error Handling Patterns
Basic Error Handler
User-Friendly Messages
Convert technical errors to user-friendly messages:Structured Error Logging
Log errors with context for debugging:Webhook Error Handling
Failed Webhook Delivery
When webhook delivery fails, fall back to polling:Webhook Handler Errors
Handle errors in your webhook endpoint gracefully:Recovery Strategies
Context Recovery
If context expires, start a new conversation:Partial Success Handling
Some operations may partially succeed:Governance Error Patterns
check_governance returns a status field rather than an error object. Governance results are not errors in the protocol sense — they are decisions. Handle them separately from AdCP task errors.
| Governance status | Meaning | Action |
|---|---|---|
approved | Plan passes governance | Proceed |
conditions | Approved with constraints | Apply conditions, re-check |
denied | Plan violates governance | Block the operation |
check_governance behaves like any async task — it returns submitted/working status and eventually resolves to approved or denied. Handle this with the standard async task lifecycle, not special-case logic.
Governance errors from the protocol layer (as opposed to governance decisions) use the standard error format. The most common:
| Code | Recovery | When it occurs |
|---|---|---|
PLAN_NOT_FOUND | correctable | sync_plans was not called before check_governance |
INVALID_REQUEST | correctable | Missing required fields (e.g., plan_id, caller) |
AUTH_REQUIRED | correctable | Governance agent requires authentication |
Best Practices
- Check
recoveryfirst — it’s the most reliable signal for how to handle an error - Implement retries — use exponential backoff for transient errors
- Respect rate limits — honor
retry_aftervalues - Handle unknown codes gracefully — fall back to the
recoveryclassification - Log with context — include
code,recovery, andfieldfor debugging - Fallback strategies — always have a backup (e.g., polling for webhooks)
- Don’t retry terminal errors — escalate to a human operator
- Handle partial success — process warnings in successful responses
Next Steps
- Transport Bindings: See Transport Errors for how errors travel over MCP and A2A
- Task Lifecycle: See Task Lifecycle for status handling
- Webhooks: See Webhooks for webhook error handling
- Security: See Security for authentication errors