# How to allow or block AI bots in robots.txt

> robots.txt rules to allow all crawlers, block AI training or block all AI bots, from RFC 9309 and the tokens that AI bot operators document.

Canonical: https://promptlyfound.com/crawlers/robots-txt-for-ai
Updated: 2026-11-23

## Short answer

Write a robots.txt group for each bot: a User-agent line with the token its operator documents, then Allow and Disallow rules. A bot follows only the group that names it, and **within that group the longest matching path wins**. OpenAI, Google, Perplexity, Meta and Amazon say some of their user-initiated fetchers may not follow robots.txt. Google-Extended and Applebot-Extended are control tokens that send no requests.

## Key findings

- Crawlers match the User-agent line case-insensitively. If several groups match a crawler, it combines them. If none match, it obeys the group for *, and with no such group no rules apply. [1]
- Within a group, the most specific rule wins, measured in octets. When an Allow rule and a Disallow rule are equivalent, the crawler should use the Allow rule. [1]
- OpenAI says robots.txt rules may not apply to ChatGPT-User, because a user starts these requests. [6]
- Perplexity says Perplexity-User generally ignores robots.txt rules, because a user requested the fetch. [9]
- Google-Extended has no user agent of its own. Google crawls with its existing user agents and reads the token as a control. [7]

robots.txt decides which AI bots may train on your content and which may show it in AI search answers, and each bot follows only the rules that name it. Among websites cited by AI answers in October and November 2026, 4.92% fully blocked GPTBot, against 0.87% for OAI-SearchBot. robots.txt is a plain-text file at the root of a host that tells crawlers which paths they may fetch. The rules are defined in [RFC 9309, the Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309.html), which the IETF published in September 2022.[1] Each AI bot operator documents the token its bot looks for and what a rule changes.

To allow all crawlers to fetch every page, publish this file at `/robots.txt`, which has the same effect as an empty file:[1]

```
User-agent: *
Allow: /
```

## How robots.txt rules work

Each host needs its own file, and a bot that finds its own group ignores the `*` group. The file must be at `/robots.txt` in the top-level path of the host, encoded in UTF-8 and served as text/plain.[1] A file on `www.example.com` does not cover `blog.example.com`. [Anthropic](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler) and [Amazon](https://developer.amazon.com/amazonbot) both say to put rules in the file of each subdomain.[2] [3]

A group is one or more User-agent lines followed by one or more rules. The group ends at the next User-agent line or at the end of the file.[1] Several User-agent lines in a row share the rules below them.

RFC 9309 sets three matching rules for groups:[1]

1. A crawler matches its token against User-agent lines without regard to case.
2. If more than one group matches, the crawler combines their rules into one group.
3. If no group matches, the crawler obeys the `User-agent: *` group. If there is no such group, no rules apply.

A crawler that finds its own group ignores the `*` group completely. [Bing's robots.txt guidance](https://www.bing.com/webmasters/help/how-to-create-a-robotstxt-file-cb7c31ec) says the same for Bingbot and tells site owners to repeat general rules in the Bingbot group.[4]

### Allow, Disallow and longest match

The longest matching path wins, so a specific Allow rule can open one folder inside a blocked site. Within a group, the crawler compares each Allow and Disallow path with the start of the URL path. The most specific match wins, measured as the match with the most octets. When an Allow rule and a Disallow rule are equivalent, the crawler should use Allow. A URL that matches no rule is allowed, and `/robots.txt` itself is always allowed.[1] Path matching should be case sensitive.

`*` matches any run of characters and `$` marks the end of the path. In the RFC's example below, `/example/page/disallowed.gif` is blocked because the Disallow rule is longer:[1]

```
User-Agent: foobot
Allow: /example/page/
Disallow: /example/page/disallowed.gif
```

### Errors and caching

A server error on robots.txt closes the whole site to compliant crawlers. If the server answers the robots.txt request with a 4xx status, the crawler may access any resource. If it answers with a 5xx status or the network fails, the crawler must assume that the whole site is disallowed. Crawlers should not use a cached copy for more than 24 hours unless the file is unreachable.[1]

Crawl-delay is not part of RFC 9309, and support for it varies by operator. Anthropic calls it a non-standard extension and supports it.[2] [Common Crawl](https://commoncrawl.org/faq) says CCBot obeys it,[5] and Bing shows it in a Bingbot group.[4] Amazon says its crawlers do not support it.[3]

## AI bot tokens

Operators run separate bots for separate jobs, so a policy has to name each token it means to cover.

  <thead><tr><th scope="col">Token</th><th scope="col">Operator</th><th scope="col">Job</th><th scope="col">Follows robots.txt</th></tr></thead>
  <tbody>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/gptbot">GPTBot</a></th><td>OpenAI</td><td>Training</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/oai-searchbot">OAI-SearchBot</a></th><td>OpenAI</td><td>ChatGPT search</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/chatgpt-user">ChatGPT-User</a></th><td>OpenAI</td><td>Fetches for a user</td><td>Rules "may not apply"</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/oai-adsbot">OAI-AdsBot</a></th><td>OpenAI</td><td>Reviews ChatGPT ad landing pages</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/claudebot">ClaudeBot</a></th><td>Anthropic</td><td>Training</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/claude-searchbot">Claude-SearchBot</a></th><td>Anthropic</td><td>Claude search</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/claude-user">Claude-User</a></th><td>Anthropic</td><td>Fetches for a user</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/google-extended">Google-Extended</a></th><td>Google</td><td>Control token: Gemini training and grounding</td><td>Sends no requests</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/google-agent">Google-Agent</a></th><td>Google</td><td>Agents acting for a user</td><td>"Generally ignore" rules</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/bingbot">Bingbot</a></th><td>Microsoft</td><td>Bing search, AI uses</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/perplexitybot">PerplexityBot</a></th><td>Perplexity</td><td>Perplexity search</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/perplexity-user">Perplexity-User</a></th><td>Perplexity</td><td>Fetches for a user</td><td>"Generally ignores" rules</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/meta-externalagent">meta-externalagent</a></th><td>Meta</td><td>Training and indexing</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/meta-webindexer">meta-webindexer</a></th><td>Meta</td><td>Meta AI search</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/meta-externalfetcher">meta-externalfetcher</a></th><td>Meta</td><td>Fetches for a user</td><td>"May bypass" rules</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/meta-externalads">meta-externalads</a></th><td>Meta</td><td>Advertising and business products</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/applebot-extended">Applebot-Extended</a></th><td>Apple</td><td>Control token: Apple model training</td><td>Sends no requests</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/amazonbot">Amazonbot</a></th><td>Amazon</td><td>Products, may train models</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/amzn-searchbot">Amzn-SearchBot</a></th><td>Amazon</td><td>Search in products such as Alexa</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/amzn-user">Amzn-User</a></th><td>Amazon</td><td>Fetches for a user</td><td>"May not follow all" rules</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/ccbot">CCBot</a></th><td>Common Crawl</td><td>Open web dataset</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/duckassistbot">DuckAssistBot</a></th><td>DuckDuckGo</td><td>AI-assisted answers</td><td>Yes</td></tr>
    <tr><th scope="row"><a href="https://promptlyfound.com/crawlers/bytespider">Bytespider</a></th><td>ByteDance</td><td>Toutiao Search</td><td>Not stated</td></tr>
  </tbody>

[OpenAI's crawler overview](https://developers.openai.com/api/docs/bots) says each of its settings is independent of the others.[6] Anthropic says the same of its three bots.[2] A rule for one token never covers another token from the same operator.

## Rules for common choices

### Allow AI search, block training

To allow AI search and block training, put the training crawlers and control tokens in one group and the search and answer bots in another. Keep any rules your site already has for other crawlers. The [robots.txt generator](https://promptlyfound.com/tools/robots-txt-generator) writes these groups for you.

```
# Training crawlers and control tokens
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
Disallow: /

# AI search and answer bots
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: DuckAssistBot
User-agent: Amzn-SearchBot
User-agent: meta-webindexer
Allow: /
```

A GPTBot or ClaudeBot rule tells OpenAI or Anthropic not to use the content for training.[6] [Google's list of common crawlers](https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers) says Google-Extended covers training of future Gemini models and grounding in Gemini Apps and Vertex AI.[7] [Apple](https://support.apple.com/en-us/119829) says Applebot-Extended covers training of its foundation models, and pages that disallow it can still appear in its search results.[8] [Perplexity](https://docs.perplexity.ai/docs/resources/perplexity-crawlers) says PerplexityBot is not used to crawl content for AI foundation models.[9] [DuckDuckGo](https://duckduckgo.com/duckduckgo-help-pages/results/duckassistbot) says DuckAssistBot data is not used to train AI models.[10]

Four bots do more than one job, so a block affects more than training:

- Bingbot crawls for Bing search. Bing says a page that is not crawled will not be indexed.[4]
- [Meta](https://developers.facebook.com/docs/sharing/webmasters/web-crawlers) says meta-externalagent crawls for training foundation models and for indexing content directly.[11]
- Amazon says Amazonbot improves its products and services and may be used to train its AI models.[3]
- CCBot builds Common Crawl's open dataset, which researchers, companies and individuals reuse.[5] [How to check whether your site is in Common Crawl](https://promptlyfound.com/crawlers/common-crawl) explains that dataset.

To state a training preference to Microsoft without blocking Bingbot, add the shared training token described below.

### Block all listed AI bots

To block every listed bot, name all the tokens except Bingbot in one group. A Bingbot block removes pages from Bing's index.

```
User-agent: GPTBot
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: OAI-AdsBot
User-agent: ClaudeBot
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: Google-Extended
User-agent: Google-Agent
User-agent: Applebot-Extended
User-agent: meta-externalagent
User-agent: meta-webindexer
User-agent: meta-externalfetcher
User-agent: Amazonbot
User-agent: Amzn-SearchBot
User-agent: Amzn-User
User-agent: CCBot
User-agent: DuckAssistBot
User-agent: Bytespider
Disallow: /
```

OpenAI says a site that disallows OAI-SearchBot is not shown in ChatGPT search answers, though it can still appear as a navigational link.[6] Anthropic says blocking Claude-SearchBot or Claude-User may reduce a site's visibility in Claude's search results.[2] DuckDuckGo says the site stops being a source for its AI-assisted answers after 72 hours, with no effect on its organic rankings.[10]

### Allow all

An empty file, or a missing file that returns a 4xx status, allows every crawler.[1] [Google's interpretation of the robots.txt specification](https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec) treats every 4xx status except 429 as if no file existed.[16] To state the same rule in the file, use this group:

```
User-agent: *
Allow: /
```

[Google's guide to writing a robots.txt file](https://developers.google.com/crawling/docs/robots-txt/create-robots-txt) says this group could be left out with the same result, because crawlers may fetch the whole site by default.[17] An empty `Disallow:` line also allows everything. Google says crawlers ignore a rule that has no path.[16]

This group covers only bots without a group of their own. Remove any older group that names an AI token, or that bot keeps following it. `Allow: /` also does not override a longer Disallow rule in the same group, because the longest match wins.[1]

## Bots with partial robots.txt support

robots.txt may not stop three user-request fetchers, so blocking them takes a CDN or server rule. These fetchers act when a person asks an assistant about a page, and their operators say robots.txt may not bind them. OpenAI says robots.txt rules may not apply to ChatGPT-User, because a user starts these actions.[6] Perplexity says Perplexity-User generally ignores robots.txt rules for the same reason.[9] Meta says its Meta-ExternalFetcher, which fetches links at a user's request, may bypass robots.txt.[11] [How to block AI crawlers](https://promptlyfound.com/crawlers/block-ai-crawlers) covers those CDN and server rules.

[ByteDance's page about Bytespider](https://zhanzhang.toutiao.com/docs/intro/26899) does not say whether the crawler follows robots.txt.[12]

Google-Extended and Applebot-Extended are control tokens. Google crawls with its existing user agents and reads Google-Extended only as a control.[7] Apple says Applebot-Extended does not crawl webpages.[8] A rule for either token stops no requests. To stop the crawling itself, a site has to block Googlebot or Applebot, which also removes its pages from Google Search or Apple's search features.

## The shared training token

Microsoft plans to honor a shared training token from February 1, 2027, so add it if Bing matters to your site. The [Machine-Readable Training Preference Signal draft](https://datatracker.ietf.org/doc/draft-kelley-aipref-training-preference-signal/) defines a policy token for AI training. A Disallow rule states a preference against training for that path.[13]

```
User-agent: __usage_ai-training
Disallow: /
```

The draft says a `User-agent: *` group must never be read as matching this token. It also says the token is not a crawling directive, so crawler groups still control access.[13] The draft is an individual Internet-Draft with no formal standing in the IETF process. [Microsoft's announcement of October 30, 2026](https://blogs.bing.com/search/2026/10/your-content-your-choice-clearer-preferences-for-training-and-grounding/) uses this syntax and says Microsoft starts to honor it on February 1, 2027.[14] [Training vs search bots](https://promptlyfound.com/crawlers/training-vs-search-bots) compares each operator's plans.

## Blocks before robots.txt

A CDN or firewall can refuse a bot's requests before the bot reads robots.txt, so check the edge before you trust the file. Cloudflare's Block setting for Training also stops Googlebot, Bingbot and Applebot, according to [Cloudflare's September 15, 2026 announcement](https://blog.cloudflare.com/accountable-mixed-use-ai-crawlers/).[15] [How Cloudflare's AI bot settings work](https://promptlyfound.com/crawlers/cloudflare-ai-bot-settings) covers each setting.

Anthropic warns that blocking its IP addresses can stop its bots from reading robots.txt, so the opt-out may not work.[2] OpenAI and Perplexity recommend that sites allow requests from their published IP ranges.[6] [9] Perplexity notes that Cloudflare's Bot Fight Mode can still challenge its bots after a firewall rule allows them.[9]

## Rules on cited websites

In our crawl of the websites that AI answers cited in October and November 2026, 8.52% of domains with a valid robots.txt fully blocked at least one AI crawler. Training crawlers were blocked more often than search crawlers: 4.92% fully blocked GPTBot, against 0.87% for OAI-SearchBot.

Of the same domains, 4.15% blocked GPTBot and let OAI-SearchBot fetch the site. [Do websites cited by AI answers block AI crawlers?](https://promptlyfound.com/research/ai-crawler-blocking) gives the figures for each crawler and engine.

## Check the live file

1. Fetch the file as a crawler sees it: `curl -s https://example.com/robots.txt`. Repeat for each subdomain, because each host needs its own file.
2. Check the status code with `curl -sI`. A 5xx answer tells every crawler that the whole site is disallowed.
3. Search the file for each token you meant to name, and for older groups that name the same tokens. The [AI crawler checker](https://promptlyfound.com/tools/ai-crawler-checker) shows which rule applies to each bot.
4. Allow time for cached copies to expire. OpenAI says its search systems need about 24 hours to adjust.[6] Perplexity and Meta give up to 24 hours.[9] [11] Amazon says its crawlers may use a copy from the last 30 days.[3]
5. If you use a CDN, compare its bot settings with the file, so you can catch an edge rule that blocks a bot the file allows.

The file is the first step of [an AI crawlability audit](https://promptlyfound.com/crawlers/ai-crawlability-audit), which also checks CDN rules, the raw HTML, sitemaps and server logs.

## Sources

1. RFC 9309: Robots Exclusion Protocol. IETF, 2022-09-01. https://www.rfc-editor.org/rfc/rfc9309.html
2. Does Anthropic crawl data from the web, and how can site owners block the crawler?. Anthropic Help Center. https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web-and-how-can-site-owners-block-the-crawler
3. Amazon Web Search crawlers. Amazon Developer. https://developer.amazon.com/amazonbot
4. How to Create a robots.txt File. Bing Webmaster Tools. https://www.bing.com/webmasters/help/how-to-create-a-robotstxt-file-cb7c31ec
5. Frequently Asked Questions. Common Crawl. https://commoncrawl.org/faq
6. Overview of OpenAI Crawlers. OpenAI. https://developers.openai.com/api/docs/bots
7. List of Google's common crawlers. Google for Developers. https://developers.google.com/crawling/docs/crawlers-fetchers/google-common-crawlers
8. About Applebot. Apple Support. https://support.apple.com/en-us/119829
9. Perplexity Crawlers. Perplexity. https://docs.perplexity.ai/docs/resources/perplexity-crawlers
10. Is DuckAssistBot related to DuckDuckGo?. DuckDuckGo Help Pages. https://duckduckgo.com/duckduckgo-help-pages/results/duckassistbot
11. Meta Web Crawlers. Meta for Developers. https://developers.facebook.com/docs/sharing/webmasters/web-crawlers
12. 关于Bytespider (About Bytespider). Toutiao Search Webmaster Platform (ByteDance). https://zhanzhang.toutiao.com/docs/intro/26899
13. Machine-Readable Training Preference Signal (draft-kelley-aipref-training-preference-signal-01). IETF Datatracker, 2026-11-16. https://datatracker.ietf.org/doc/draft-kelley-aipref-training-preference-signal/
14. Your content, your choice: clearer preferences for training and grounding. Microsoft Bing Blogs, 2026-10-30. https://blogs.bing.com/search/2026/10/your-content-your-choice-clearer-preferences-for-training-and-grounding/
15. Have it both ways: stay discoverable in search while disallowing AI training. Cloudflare, 2026-09-15. https://blog.cloudflare.com/accountable-mixed-use-ai-crawlers/
16. How Google interprets the robots.txt specification. Google for Developers, 2026-10-23. https://developers.google.com/crawling/docs/robots-txt/robots-txt-spec
17. How to write and submit a robots.txt file. Google for Developers, 2025-11-21. https://developers.google.com/crawling/docs/robots-txt/create-robots-txt

---

This is a plain-text copy of https://promptlyfound.com/crawlers/robots-txt-for-ai from Promptly Found. The web page is the canonical version and includes the charts.
