Part of the AI visibility glossary
What is robots.txt for AI crawlers?
Robots.txt for AI means using a site’s robots.txt file to give separate rules to the crawlers AI companies run, by naming each bot’s user-agent token in its own group. OpenAI, for example, publishes separate tokens for training and for search, so one file can allow one use and refuse the other.
Also called: robots.txt for AI, AI robots.txt rules, blocking AI bots in robots.txt
How the rules are read
A robots.txt file is a list of groups. Each group starts with one or more user-agent lines naming a crawler’s product token, followed by allow and disallow rules. A crawler matches its token without regard to case and obeys the group that matches; if no group names it, it falls back to the group for *. Inside a group, the most specific rule wins, meaning the one with the longest matching path, and when an allow and a disallow rule are equivalent, the allow should win.
One consequence is easy to miss. A bot that has a group of its own ignores the * group entirely, so a rule written for every bot does not reach GPTBot once GPTBot has its own group.
An example file
Take a short file with three groups: User-agent: GPTBot with Disallow: /, then User-agent: OAI-SearchBot with Allow: /, then User-agent: * with Disallow: /admin/. This file asks OpenAI’s training crawler to stay out and lets its search crawler in, so the site can still appear in ChatGPT search. Every other bot is kept out of /admin/. Because GPTBot and OAI-SearchBot have groups of their own, the /admin/ rule does not apply to them; repeat it in their groups if it should.
What robots.txt cannot do
The rules are requests. RFC 9309, the standard that defines robots.txt, says they are not a form of access authorization. Google makes the same point for its own crawler: robots.txt is not a way to keep a page out of Google, and it suggests noindex or a password instead.
The file is also cached, and its HTTP status matters. A crawler should not rely on a cached copy for more than 24 hours, so a change can take up to a day to reach it. If the file returns a 4xx status, a crawler may fetch anything on the site; if it returns a 5xx server error, the crawler must assume everything is disallowed.
A shared AI training signal
Naming every AI bot one by one may become less necessary. In October 2026 Google announced plans to support a shared AI training control in robots.txt, based on IETF AIPREF work, so a single policy token can state a training preference across participating AI providers. Anthropic says it began recognising a machine-readable no-AI-training signal on October 30, 2026, and that a rule naming its own crawler still takes priority over it.
How to check it yourself
- Fetch /robots.txt on every host you run, since each host is read separately, and confirm it loads as a plain text file rather than an error page.
- List every user-agent group and note which AI tokens are named and which fall through to the
*group. - For each named AI bot, read its company’s description and decide whether you are allowing training, search or both.
- Copy any rules from the
*group that should also bind the bots that have groups of their own. - After an edit, wait at least a day before expecting crawlers to follow it.
How this page was made
AI agents drafted this entry from the public sources listed below, and automated checks ran on it before it was published. Read our editorial policy.
Questions
Does a Disallow rule for all bots block AI crawlers?
It covers every crawler that follows the standard and has no group of its own in the file. A bot named in a separate group follows that group instead and ignores the rule for all bots.
Can robots.txt keep a page private?
No. It asks crawlers not to fetch pages but is not access control. Put a login in front of pages that must stay private, and use noindex for pages that must stay out of search results.
What happens if my robots.txt returns an error?
The section on what robots.txt cannot do explains it: a client error lets crawlers fetch anything, while a server error makes them treat the whole site as disallowed while the error lasts, though the standard lets crawlers relax this after a long outage.
Sources
- RFC 9309: Robots Exclusion Protocol · RFC Editor
- RFC 9309: Robots Exclusion Protocol · RFC Editor
- Overview of OpenAI crawlers · OpenAI
- Robots.txt Introduction and Guide · Google Search Central
- Supporting a shared AI training control for websites · Google Search Central Blog
- Does Anthropic crawl data from the web, and how can site owners block the crawler? · Claude Help Center