Machine-Readable Errors for AI Agents
As AI agents become production infrastructure handling billions of HTTP requests daily, they frequently encounter Cloudflare errors while navigating the web and calling APIs. Traditionally, these errors were returned as HTML pages designed for human browsers—hundreds of lines of markup, CSS, and copy that waste tokens and provide unclear instructions to automated systems.
Starting today, Cloudflare returns RFC 9457-compliant structured error responses to agents that request them via the Accept header. Agents can now request text/markdown, application/json, or application/problem+json and receive machine-readable responses instead of HTML.
What Changed
Cloudflare's error responses now include:
- YAML frontmatter with semantic fields for automation:
error_code,error_name,error_category,retryable,retry_after, andowner_action_required - Actionable guidance sections (
What happenedandWhat you should do) with explicit retry instructions, wait times, and escalation guidance - RFC 9457 standard format ensuring compatibility with any HTTP client that understands Problem Details
- Network-wide deployment with no configuration required—all 1xxx-class Cloudflare errors now support this
For example, a rate-limit error (1015) now tells agents: "Wait 30 seconds and retry with exponential backoff" instead of just showing "You have been blocked."
Impact and Efficiency Gains
These structured responses reduce payload size and token usage by more than 98% compared to HTML error pages, measured against live error responses. For agents that encounter multiple errors in complex workflows, the token savings compound significantly.
The implementation is transparent to browsers, which continue receiving standard HTML error pages. This is live across the Cloudflare network immediately—site owners need not configure anything. Cloudflare plans to extend this RFC 9457-compliant contract to 4xx and 5xx error classes next.