Comparison · AI permissions · Updated 2026

ai.txt vs llms.txt: Which AI File Should You Ship in 2026?

Both files sit at your site root, both are plain text, and both get described as "the file that tells AI what to do with my site." They are not interchangeable. ai.txt is a permission file that restricts use; llms.txt is an index that invites reading. Mixing them up is the most common mistake in the AI-files conversation.

The Short Answer

ai.txtllms.txt
Declares Permissions: may this content be mined or used for commercial AI training? Content: here is what the site contains and which pages matter
Direction Restrictive — an opt-out at the media level Invitational — an opt-in to a better answer
Origin Spawning AI, distributed through its API to partners including Hugging Face and Stability AI The Answer.AI proposal published at llmstxt.org
Read when At the moment media is downloaded, including downloads triggered by old dataset links When an AI reader chooses to fetch your index before browsing
Legal weight Pitched as a machine-readable opt-out aligned with the EU DSM Article 4 TDM exception None. It is a convention, not a standard, and never a rights reservation

What ai.txt Actually Does

ai.txt lives in your root directory and sets machine-readable permissions for commercial text and data mining. Spawning's generator exposes five media types — text, images, audio, video and code — each set to block or allow, and the default posture is opt-out.

The interesting design decision is the timing. A robots.txt file is read when a crawler walks your site; ai.txt is read when your media is downloaded. That difference matters if your images already sit inside a public dataset: adding a robots.txt today cannot retroactively remove the links, but a permission file checked at download time can affect what happens the next time someone trains from those links.

What ai.txt cannot do is reach copies of your work hosted on domains you do not control, and it only binds tools that actually check it. Treat it as a consent layer, not a lock.

What llms.txt Actually Does

llms.txt is a Markdown file at your site root that opens with an H1 site name, an optional blockquote summary, and a list of curated links with one-line descriptions. The 2026 revision of the spec added two Markdown link forms, defined subpath files, and two link relations — rel="alternate" and rel="describedby".

There is nothing in that spec about permission. llms.txt does not block a crawler, does not reserve rights, and does not change rankings. Its entire job is to shorten the path between an AI reader and the pages that answer questions. If you want the restriction side of the story, that lives in the robots.txt token reference for AI crawlers.

The Legal Layer: TDMRep and Machine-Readable Opt-Outs

The reason "just write it in your terms of service" stopped being advice: a German appeals court decision handed down in December 2025 (OLG Hamburg, 5 U 104/24) held that natural-language opt-outs buried in terms of use are insufficient, because a machine cannot read them. What counts is a machine-readable reservation.

The W3C Community Group specification for that is the TDM Reservation Protocol. It publishes a JSON file at /.well-known/tdmrep.json where a reservation flag of 1 reserves rights under CDSM Article 4(3), and it also defines a TDM-Reservation HTTP response header as a header-only fallback:

{
  "tdm-reservation": 1,
  "tdm-policy": "https://example.com/ai-policy.html"
}

One property in that file has no robots.txt equivalent: tdm-policy points at a URL where the actual policy lives, so the machine-readable signal and the human-readable explanation stay in sync. The community group's own documentation is explicit that robots.txt remains the right place to signal an opt-in for search, and TDMRep is the opt-out that sits beside it — which is exactly what you would expect from a site that wants AI citations but not AI training.

Where noai and X-Robots-Tag Fit

The noai and noimageai directives, usually delivered as an X-Robots-Tag response header, are the third signal and the least formalised. They are not part of an IETF or W3C standard; the TDMRep group notes that noai was proposed but does not cover the full range of mining practices publishers want to address. Use them as an extra header on responses, not as your primary reservation.

What to Ship: A Decision List

Verifying All Four Signals in Five Minutes

Every file in this stack is a plain HTTP GET, so verification is one command per file. Replace the host and check the status line and the body — a 200 with an HTML error page is the classic failure mode:

curl -sI https://example.com/llms.txt | head -1
curl -sI https://example.com/ai.txt | head -1
curl -s  https://example.com/.well-known/tdmrep.json
curl -sI https://example.com/ | grep -i 'x-robots-tag\|tdm-reservation'

If the first line comes back as text/html, your rewrite rules are serving your catch-all page instead of the file — a delivery problem, not a content problem, and the same one that breaks most llms.txt launches. The robots.txt vs llms.txt breakdown covers which file belongs in which job if you are still deciding what to publish at all.