The AI crawler guide: bots, jobs and robots.txt · chapter 3
How to write robots.txt rules for AI bots
Write one robots.txt group per AI agent you have a decision about, named by its token, such as GPTBot or OAI-SearchBot, with the Allow and Disallow rules for that agent. A crawler obeys the most specific group naming it and ignores the wildcard group, the longest matching rule wins, and a robots.txt that errors can block every compliant crawler.
7 days free · card required
GPTBot
- Group it obeys
- its own
- /api/
- blocked
- Rest of site
- allowed
Claude-SearchBot
- Group it obeys
- its own
- /api/
- blocked
- Rest of site
- allowed
MistralAI-Index
- Group it obeys
- * (it has none)
- /api/
- blocked
- Rest of site
- allowed
CCBot
- Group it obeys
- its own
- /api/
- blocked
- Rest of site
- blocked
SemrushBot
- Group it obeys
- its own
- /api/
- blocked
- Rest of site
- blocked
Last updated
Key facts
What does a real AI-aware robots.txt look like?
Here is ours, abridged. This is what attensira.com served on 4 October 2026.
User-agent: GPTBot
Allow: /
Disallow: /api/
User-agent: OAI-SearchBot
Allow: /
Disallow: /api/
User-agent: ChatGPT-User
Allow: /
Disallow: /api/
# ...one group each for ClaudeBot, Claude-User, Claude-SearchBot,
# PerplexityBot, Perplexity-User, Meta-ExternalAgent, Googlebot,
# Google-Extended, Applebot, Applebot-Extended, Bingbot and others...
User-agent: CCBot
Disallow: /
User-agent: AhrefsBot
Disallow: /
User-agent: SemrushBot
Disallow: /
User-agent: *
Allow: /
Disallow: /api/
Sitemap: https://attensira.com/sitemap-index.xml
License: https://attensira.com/license.xmlFour decisions are visible in it.
Every agent we care about has its own group. Even where the rules are identical to the wildcard group, naming the agent makes the decision explicit, and it means the decision survives if someone later tightens the wildcard.
The API is closed to everyone. /api/ serves nothing a crawler should read, so every group disallows it.
Three crawlers are shut out completely: Common Crawl's CCBot, and two SEO tools' crawlers, AhrefsBot and SemrushBot.
Training agents are allowed. GPTBot, ClaudeBot and Meta-ExternalAgent can read the site. For a company that wants models to know its name, we see no reason to opt out. Your decision may differ; the training versus search chapter covers what each choice costs.
It also has weaknesses, which we found while writing this guide. It is long, because each group repeats the same two lines; a group can list several user-agent lines, and ours could be a third of the length. And it has no group for some agents operators now document, such as Mistral's indexing and training agents, so those fall to the wildcard. The rest of this chapter is the rules that make a file like this do what you mean.
How is a robots.txt file structured?
A file is a list of groups. Each group starts with one or more User-agent: lines naming the crawlers it applies to, followed by Allow: and Disallow: rules giving path prefixes.
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
Disallow: /
User-agent: *
Allow: /
Disallow: /admin/Here three training agents share one group and are kept out of the whole site, and every other crawler may read everything except /admin/. Lines such as Sitemap: stand outside groups and apply to the whole file.
Which group does a crawler obey?
The one that names it. RFC 9309, the robots.txt standard, says a crawler matches its product token against the user-agent lines case-insensitively and uses the group that matches. Only if no group names it does it use the * group.
This is the rule most often misunderstood. If you add a group for GPTBot, the rules under * stop applying to GPTBot entirely. A site that disallowed /private/ under * and then added User-agent: GPTBot with Allow: / has just let GPTBot into /private/.
If several groups name the same crawler, their rules are combined into one, the RFC says. Two groups for GPTBot in different places in the file act as one group. That is a common result of files edited by several people over time, and a good reason to keep one group per agent.
Which rule wins inside a group?
The most specific one: the rule whose path matches the URL with the most characters. RFC 9309 calls it the match with the most octets. So in:
User-agent: OAI-SearchBot
Disallow: /docs/
Allow: /docs/public//docs/public/guide is allowed, because /docs/public/ is the longer match, and /docs/internal/notes is disallowed. Order in the file does not matter.
What do status codes do to your robots.txt?
More than most teams realise. RFC 9309 sets two very different outcomes:
| Your robots.txt returns | What a compliant crawler does |
|---|---|
| 200 with rules | Follows the rules |
| A 400-range status, such as 404 | May crawl everything |
| A server error, or no response | Must assume the whole site is disallowed |
So a robots.txt that times out under load, or errors behind a misconfigured CDN, can block every compliant AI crawler, search agents included, until it recovers. Serve it as a static file, cache it at the edge, and monitor it like any page that matters. RFC 9309 also says crawlers must parse at least 500 KiB of it, so an enormous file risks being cut off.
A related trap sits outside robots.txt entirely. Bot-protection and firewall rules at your CDN can challenge or block crawlers on every page while robots.txt says they are welcome. The crawler then sees an error or a challenge page instead of your content, and robots.txt never comes into it. If an allowed agent never appears in your logs, check the firewall before the file. Perplexity notes that firewall configuration changes can take time to propagate, as robots.txt changes do.
Is every agent we allow still coming back?
The last request from each operator's agents to attensira.com, read from our crawler board on 5 October. Each had come back within the previous day. An agent your file allows that stops appearing here is the first sign of a block somewhere, in robots.txt or in front of it.
- OpenAI's agents, last request on 5 Oct (UTC)
- 01:10
- 7,796 requests in 30 days
- Googlebot, last request on 5 Oct (UTC)
- 00:38
- 199 requests in 30 days
- Anthropic's agents, last request on 4 Oct (UTC)
- 21:09
- 105 requests in 30 days
- PerplexityBot, last request on 4 Oct (UTC)
- 18:11
- 621 requests in 30 days
Analystattensira.com AI traffic, crawler board by claimed user agent, read over the Attensira MCP on 2026-10-05 · to How long do changes take to apply?
About a day for most operators, and longer for some.
- OpenAI says it can take about 24 hours for its systems to adjust.
- Perplexity and Meta say changes can take up to 24 hours.
- RFC 9309 says crawlers should not use a cached copy for more than 24 hours unless the file is unreachable.
- Amazon says Amazonbot may use a cached robots.txt from the previous 30 days.
After fixing an accidental block, wait at least a day, then check your server logs for the agent's return. Pages dropped from an AI product's index while the block was live come back only when the agent recrawls them, which you cannot force.
Which directives beyond Allow and Disallow work?
Sitemap is widely supported and worth including; it helps crawlers find pages your internal links do not reach.
Crawl-delay is not in RFC 9309. Anthropic says its bots support it; Amazon says Amazonbot does not. Treat it as a request some crawlers honour. If load is the real problem, rate-limit by agent on the server.
Tokens without crawlers, Google-Extended and Applebot-Extended, work like any other group but are read by the main Google and Apple crawlers as a training opt-out. They never fetch anything themselves.
New lines such as License: carry licensing terms for content, as ours does. Crawlers that do not recognise a line ignore it, so it does no harm.
What can robots.txt not do?
Three things, and each one trips people up.
It is not access control. RFC 9309 says its rules are not a form of access authorization. Compliant crawlers honour them; others need not. Anything private belongs behind authentication.
It does not bind every user-triggered fetcher. OpenAI says robots.txt rules may not apply to ChatGPT-User, and Perplexity says Perplexity-User generally ignores them, because a person asked for the page.
It does not remove what was already collected. A new rule applies to future crawls, not to pages already in an index or a training set.
Which robots.txt mistakes cost AI visibility?
Five, roughly in order of how often they appear in files we read.
A wildcard block written to stop training. User-agent: * with Disallow: / keeps out GPTBot and ClaudeBot, and also OAI-SearchBot, Claude-SearchBot, PerplexityBot, Googlebot and bingbot. The site disappears from every AI search product that honours robots.txt. If the goal is a training opt-out, name the training agents and leave the wildcard open.
The right intent under the wrong token. A rule meant for training addressed to OAI-SearchBot instead of GPTBot opts the site out of ChatGPT search and leaves training untouched. Check each token against the operator's description of it, not against its name.
A named group that forgets the wildcard's rules. Adding a group for one agent drops every rule under * for that agent. Private paths disallowed under * must be repeated in each named group.
A file that errors. A robots.txt behind a misconfigured redirect, a login wall or a slow origin can return an error to crawlers while looking fine in a browser. Under the standard, an error means "disallow everything".
Stale tokens and missing new ones. Operators add and retire agents. A file written a year ago may name agents that no longer exist and miss ones that do, as ours did.
What does an engine tell people to paste?
Perplexity's own answer to a question we track, verbatim. Its sample file blocks PerplexityBot, the agent that indexes pages for Perplexity's answers. Paste it and you leave the engine that gave the advice. None of the ten sources it listed was an operator's documentation.
Question: how to block AI crawlers in robots.txt
Perplexity answered: Blocking AI crawlers in robots.txt by specifying a user-agent group for each crawler and Disallowing the paths you want withheld. Example: User-agent: GPTBot Disallow: / User-agent: ClaudeBot Disallow: / User-agent: PerplexityBot Disallow: / … If you want to allow retrieval/citation but block training, use careful rules and consider separate allowances for retrieval vs. training.
Sources cited
- 1qwairy.co
- 2elmohq.com
- 3aicrawlercheck.com
- 4geotoolbox.ai
- 5frostbitemarketing.com
- 6lumengeo.co
- +4 more
Not namedAttensira is missing from this Perplexity answer.
How do you write rules for a large site?
By section, with the patterns the standard supports. RFC 9309 defines two special characters in paths: * matches any sequence of characters, and $ anchors the end of a URL. So Disallow: /*?sort= keeps crawlers out of sorted duplicates of every listing page, and Disallow: /*.pdf$ keeps them out of PDF files without touching pages whose names contain "pdf".
Decide per section first, then write the rules. Typical choices: product, pricing, documentation and articles open to search and user agents; account, cart, checkout and internal search results closed to everyone; anything licensed or paid decided separately for training agents. Then keep the file in version control, with a comment above each group saying who decided it and why. A robots.txt nobody can explain is one nobody dares to fix.
How do you check your rules before you ship them?
- Read the file as each agent. For each token you named, list the groups that apply and the rule that wins for your key paths.
- Test a few URLs per agent. The crawler URL inspector shows how each agent's rules apply to a given URL, and the robots.txt generator writes a file with each agent named.
- Check the status code of
/robots.txtfrom outside your network, and its response time. - Watch the logs for a few days after shipping. An agent you meant to allow that disappears is the fastest sign of a mistake.
The next chapter, on verifying a crawler, covers making sure the agents in your logs are who they say they are.
Check what your robots.txt lets each engine read
7 days free · card required
What else do people ask?
How do I block GPTBot but still appear in ChatGPT search?
Does a User-agent '*' rule apply to GPTBot if GPTBot has its own group?
What happens if my robots.txt returns an error?
How long does a robots.txt change take to reach AI crawlers?
Do AI crawlers support Crawl-delay?
Where do these facts come from?
9 sources, 17 statements: each statement with the page it came from and the day it was checked.
RFC 9309 section 2.2.2 states that the most specific match found must be used, and defines the most specific match as the one that has the most octets.
rfc-editor.org · retrieved
“The most specific match found MUST be used. The most specific match is the match that has the most octets.”
RFC 9309 section 2.2.1 states that if more than one group matches the user agent, the matching groups' rules must be combined into one group.
rfc-editor.org · retrieved
RFC 9309 says crawlers must match their product token case-insensitively, obey the group whose user-agent line matches, and obey the wildcard group only when no other group matches.
rfc-editor.org · retrieved
RFC 9309 states that a crawler must assume complete disallow when robots.txt is unreachable because of server or network errors, and may access any resource when robots.txt returns a status in the 400 range.
rfc-editor.org · retrieved
RFC 9309 states that crawlers should not use a cached version of robots.txt for more than 24 hours unless the file is unreachable.
rfc-editor.org · retrieved
RFC 9309 states that the rules in robots.txt are not a form of access authorization.
rfc-editor.org · retrieved
OpenAI documents that it can take about 24 hours from a robots.txt update for its systems to adjust, and that robots.txt rules may not apply to ChatGPT-User.
developers.openai.com · retrieved
Anthropic documents that its bots honour robots.txt directives and support the Crawl-delay extension.
support.claude.com · retrieved
Perplexity documents that robots.txt changes may take up to 24 hours to be reflected and that Perplexity-User generally ignores robots.txt.
docs.perplexity.ai · retrieved
Amazon documents that Amazonbot does not support the crawl-delay directive.
developer.amazon.com · retrieved
Amazon documents that Amazonbot may use a cached robots.txt from the previous 30 days.
developer.amazon.com · retrieved
Meta documents that changes to robots.txt can take up to 24 hours to take effect for its crawlers because of caching.
developers.facebook.com · retrieved
attensira.com/robots.txt, fetched 4 October 2026, holds one group per named agent, most with 'Allow: /' and 'Disallow: /api/', disallows CCBot, AhrefsBot and SemrushBot from the whole site, ends with a wildcard group allowing everything except /api/, and declares a Sitemap and an RSL License line.
attensira.com · retrieved
RFC 9309 defines the special characters asterisk, matching any sequence of characters, and dollar sign, designating the end of the match pattern, for use in Allow and Disallow paths.
rfc-editor.org · retrieved
Fetched 5 October 2026: attensira.com/robots.txt has a named group for GPTBot, Claude-SearchBot, CCBot and SemrushBot among 33 named groups plus a wildcard group, and no group for MistralAI-Index; every group disallows /api/, and CCBot, AhrefsBot and SemrushBot are disallowed from the whole site.
attensira.com · retrieved
Read over the Attensira MCP on 5 October 2026 (attensira.com workspace): one of Perplexity's answers on 4 October 2026 to the tracked question 'how to block AI crawlers in robots.txt' gave a sample file that disallows PerplexityBot, citing ten blogs and tool sites and no crawler operator's documentation.
Read over the Attensira MCP on 5 October 2026 (attensira.com workspace crawler board, 30 days by claimed user agent): the last requests to attensira.com came from OpenAI's agents at 01:10 UTC and Googlebot at 00:38 UTC on 5 October, and from Anthropic's agents at 21:09 UTC and PerplexityBot at 18:11 UTC on 4 October; the 30-day request counts were 7,796, 199, 105 and 621.
Want software that does your AI-search visibility work, with you in control of every change?
7 days free · card required
