Cloudflare now returns RFC 9457-compliant structured error responses (JSON and Markdown) to AI agents instead of HTML error pages. By sending an appropriate Accept header (text/markdown, application/json, or application/problem+json), agents receive compact, machine-readable payloads with actionable fields like retryable, retry_after, and owner_action_required. This reduces payload size and token usage by over 98% compared to HTML. The feature is live network-wide with no configuration required from site owners, covering all 1xxx-class Cloudflare error codes, with 4xx/5xx coverage planned next. A Python example demonstrates how agents can parse YAML frontmatter to implement deterministic retry and escalation logic.

12m read timeFrom blog.cloudflare.com
Post cover image
Table of contents
What agents see todayWhat we didWhat the response looks likeOne contract, two formatsSize reduction and token efficiencyTen categories, clear actionsHow to use itReal-world use casesTry it now

Sort: