Markdown Content Negotiation for AI Agents
How Cloudflare Markdown for Agents handles Accept, Vary, origin policy headers, conversion limits, and rollback.
A Markdown response saves a client work only if the useful content survives conversion. Check the table, code sample and qualification below a command before celebrating a smaller token count.
Cloudflare Markdown for Agents converts eligible HTML at the edge for enabled zones when a client requests text/markdown. The browser page can remain the normal reading experience while an automated reader asks for a different representation.
HTTP defines negotiation and caching semantics. Cloudflare defines this converter, its account setting, output, and limits. The conversion limits and response-header behavior below were checked against Cloudflare's documentation on October 18, 2026. Verify enablement separately for each zone.
The request and response contract
A client expresses its preference through the Accept request field:
curl -sS -D - https://www.tkoresearch.com/ \
-H 'Accept: text/markdown' \
-o /tmp/tkoresearch-home.md
For a successful converted response, Cloudflare documents fields like these:
HTTP/2 200
Content-Type: text/markdown; charset=utf-8
Vary: Accept
Content-Signal: ai-train=yes, search=yes, ai-input=yes
Content-Type identifies the selected representation. Vary: Accept tells caches that requests with different Accept values can receive different response variants. Without correct variation, a shared cache could serve Markdown to a browser that requested HTML, or HTML to a machine client that requested Markdown.
Clients should still inspect the actual response. An Accept field states preference; it doesn't guarantee that conversion will occur. The origin may return a non-HTML resource, the response may exceed a limit, or the feature may be disabled.
Count the representation the client will use
Cloudflare's current documentation does not promise x-markdown-tokens or x-original-tokens response fields. Do not make their presence a condition for accepting an otherwise valid Markdown response.
A client with a hard context budget should count the returned body with its chosen tokenizer and leave room for the rest of the request. Compare HTML and Markdown locally if size reduction matters to the application.
Inspect content as well as size. A smaller response that loses a table heading or a command's warning can mislead the reader.
Conversion behavior and limits
Cloudflare documents a predictable output structure. Supported page metadata can become YAML frontmatter. The main document body is converted to Markdown after non-content elements are removed. JSON-LD may be preserved in a fenced JSON block at the end.
The current feature converts HTML. It doesn't promise conversion for every document type. Cloudflare limits conversion to 6 MiB (6,291,456 bytes) of decompressed HTML; compressed transfer size is not the measure. Pages that require a browser to execute client-side code before meaningful content appears may also need separate validation, because edge conversion works from the fetched HTML response.
These constraints should shape tests. Include short pages, long articles, tables, code blocks, structured data, redirect responses, errors, and a page near the size limit. Check relative links from directory-style URLs. Cloudflare's July 13, 2026 release corrected relative-link resolution for those URLs, so a current deployment should preserve the proper target.
Origin headers remain authoritative
The origin owns security, caching, and content-use policy. Edge conversion shouldn't replace that policy with a generic default.
On July 13, 2026, Cloudflare announced origin header preservation for Markdown for Agents. Security fields such as HSTS, CSP, X-Frame-Options, cookies, and CORS fields are preserved on converted responses. Cache policy fields continue to pass through. Body-specific fields need different treatment: Cloudflare removes ETag, Last-Modified, Content-Encoding, and Content-Range, among others, because they describe the original body. It removes Content-Length because the converted response is streamed. A client cannot validate converted Markdown with the HTML entity tag.
The change also makes the origin's Content Signals policy authoritative. When the origin sends a Content-Signal field, Cloudflare preserves it. If the field is absent, Cloudflare adds its default all-yes value.
TKOResearch sets its approved public-content policy at the origin:
Content-Signal: ai-train=yes, search=yes, ai-input=yes
That policy happens to match the current Cloudflare default, but origin ownership still matters. A future policy change should be deployed and reviewed with the site, not inferred from an edge default. Verify the field on both HTML and Markdown variants.
Configure the origin and the Cloudflare zone separately
Enable Markdown for Agents through the Cloudflare dashboard or zone setting API. Deploying application code does not turn on that account-level setting.
Before enabling conversion, check the parts maintained with the application:
- the origin content-use response field;
- accurate public content and canonical links;
- a maintained
/llms.txtindex; - an operations runbook with enablement, verification, and rollback.
The API path requires a scoped token with Zone Settings edit permission. Record the zone change separately from the application release, then verify the public response. A completed deployment does not confirm that conversion is active.
Verification before enablement
Capture an HTML baseline first:
curl -sS -D /tmp/html-headers.txt \
https://www.tkoresearch.com/ \
-o /tmp/home.html
After enablement, request Markdown and compare status, canonical links, security fields, cache fields, and content-use policy. Confirm the Markdown content type and Vary: Accept; do not require undocumented token-count headers. Open the saved body and inspect headings, lists, code, links, and JSON-LD.
Repeat the request through any production hostname that clients use. Check caching by alternating HTML and Markdown requests. A passing origin test doesn't establish that the CDN's public behavior is correct.
Monitor conversion after site template changes. Moving important copy into a client-only widget or a navigation landmark that preprocessing removes can alter machine-visible content even though the browser view still appears correct.
Rollback is part of the feature
Rollback means disabling the content_converter zone setting or turning off Markdown for Agents in the Cloudflare dashboard. After propagation, a request with Accept: text/markdown should no longer receive a Cloudflare-converted Markdown response.
The site's other machine-readable controls remain independent. /robots.txt, /llms.txt, the origin Content-Signal field, RSS discovery, and the RFC 9116 security contact still work. That independence reduces rollback risk.
Record who can make the account change, how long propagation took, and what response confirms success. Don't wait for a conversion defect to discover that the API token lacks permission or that the dashboard owner is unavailable.
Judge the converted document, then the savings
For an article containing a command with a warning underneath, both need to survive conversion in the right order. For a comparison table, the row labels must still match the values. Those are more useful acceptance checks than requiring a particular token count.
Enable conversion after representative output passes that review and alternating HTML and Markdown requests confirm cache separation. Recheck the output when the page template changes. If an important qualification disappears, disable conversion while repairing it; saving context is useful only when the reader still receives the intended material.