# robots.txt for AI Search Crawlers: Allow ChatGPT, Claude and Perplexity, Block Training

Canonical: https://devtune.ai/blog/robots-txt-for-ai-search-crawlers

Published: 2026-12-04T00:00:00.000Z

Author: Ben Williams


Each AI company runs separate crawlers for search, for user-triggered fetches and for model training, and each one reads its own line in `robots.txt`. That lets you stay in ChatGPT, Claude and Perplexity answers while opting out of training. This guide covers which token does what, two templates to copy, the grouping rule that breaks most hand-written files, and the CDN and firewall settings that block AI crawlers even when `robots.txt` allows them.

## Search, user-triggered and training crawlers

| Kind                   | What it does                                                                              | Tokens                                                                       |
| ---------------------- | ----------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| Search crawler         | Indexes pages so an AI platform can find and cite them in answers                         | `OAI-SearchBot`, `Claude-SearchBot`, `PerplexityBot`, `Googlebot`, `Bingbot` |
| User-triggered fetcher | Fetches one page while it answers a person's question, often a page it will cite          | `ChatGPT-User`, `Claude-User`, `Perplexity-User`                             |
| Training crawler       | Collects pages that may be used to train models                                           | `GPTBot`, `ClaudeBot`, `CCBot`, `Bytespider`, `Meta-ExternalAgent`           |
| Training control token | Not a crawler: tells an operator whether it may train on pages its search crawler fetched | `Google-Extended`, `Applebot-Extended`                                       |

By operator:

- **OpenAI.** `OAI-SearchBot` indexes pages for ChatGPT search. `ChatGPT-User` fetches a page when a ChatGPT user or a GPT asks for it. `GPTBot` collects training data. Blocking `GPTBot` does not remove you from ChatGPT answers.
- **Anthropic.** `Claude-SearchBot` indexes pages for Claude's search results. `Claude-User` fetches a page when a Claude user asks a question that needs it. `ClaudeBot` collects training data.
- **Perplexity.** `PerplexityBot` indexes the pages Perplexity links in its answers. `Perplexity-User` fetches a page when a Perplexity user asks for it.
- **Google.** `Googlebot` crawls for Google Search, including AI Overviews and AI Mode. `Google-Extended` controls whether Google uses those pages to train Gemini and ground Gemini app answers. Google Search and AI Overviews ignore it.
- **Microsoft.** `Bingbot` crawls for Bing search and Microsoft Copilot.
- **Others.** `CCBot` builds the Common Crawl dataset, which many models train on. `Bytespider` collects pages for ByteDance. `Meta-ExternalAgent` collects pages Meta uses to train AI models. `Applebot-Extended` controls whether Apple trains on pages `Applebot` crawled.

The [AI agent directory](https://devtune.ai/ai-agents) describes each crawler and fetcher DevTune tracks: who runs it, what it does on your site and whether a request can be checked as really coming from it.

User-triggered fetchers follow `robots.txt` less reliably than the rest. OpenAI says `robots.txt` may not apply to `ChatGPT-User`, and Perplexity says `Perplexity-User` generally ignores it. Treat a `Disallow` for those two as a request, not a block.

## Template 1: allow AI search, block training

This whole file keeps your pages open to every search crawler and user-triggered fetcher above and opts out of the training crawlers.

```txt
User-agent: OAI-SearchBot
User-agent: ChatGPT-User
User-agent: Claude-SearchBot
User-agent: Claude-User
User-agent: PerplexityBot
User-agent: Perplexity-User
User-agent: Googlebot
User-agent: Bingbot
Disallow: /admin/
Disallow: /api/

User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
User-agent: Applebot-Extended
User-agent: Meta-ExternalAgent
User-agent: CCBot
User-agent: Bytespider
Disallow: /

User-agent: *
Disallow: /admin/
Disallow: /api/

Sitemap: https://www.example.com/sitemap.xml
```

Replace the two `Disallow` paths in the first and last groups with your own, and the `Sitemap` line with your sitemap's full URL. The first group repeats the `*` rules because of the grouping rule below. If the first group should read everything, give it `Allow: /` in place of the `Disallow` lines.

Decide on `Google-Extended` separately. Blocking it opts you out of Gemini training, and it also stops Gemini apps grounding answers in your pages. If Gemini answers matter to you, move `Google-Extended` into the first group.

## Template 2: allow every AI crawler

If you want maximum reach and don't mind your pages in training data, the simplest file allows everything:

```txt
User-agent: *
Disallow: /admin/
Disallow: /api/

Sitemap: https://www.example.com/sitemap.xml
```

Every crawler without its own group follows `User-agent: *`. A missing `robots.txt` that returns 404 or 410 also counts as permission to crawl everything under RFC 9309, the robots.txt standard, but an explicit file lets you add a `Sitemap` line and change your mind later.

## The grouping rule that breaks hand-written files

Under RFC 9309, a crawler combines every group that names its token, and reads `User-agent: *` only when no named group matches it. That means a crawler with any group of its own ignores every `*` rule.

So this file looks like it keeps `GPTBot` out of `/admin/` and lets it read the rest. It doesn't:

```txt
User-agent: *
Disallow: /admin/

User-agent: GPTBot
Allow: /blog/
```

`GPTBot` reads only the groups that name it—here just `Allow: /blog/`—and ignores the `*` group, so `/admin/` is open to it. If you give a crawler its own group, copy every `*` rule it should still follow into a group that names it. That is why Template 1 repeats the `*` rules in its first group.

Two more mistakes come up often:

- **Company name instead of a token.** `User-agent: OpenAI` or `User-agent: Anthropic` matches no crawler. Each crawler looks only for its own token.
- **Path case.** Paths are case-sensitive: `Disallow: /Docs/` doesn't block `/docs/`.

## Check the file, then check the response

Paste your domain into the [AI crawler robots.txt checker](https://devtune.ai/tools/ai-robots-txt-checker). It reads your live file with the same RFC 9309 matching crawlers use, shows each crawler's result for your site root with the rule that decides it, flags crawlers that are allowed at the root but blocked on some paths, and writes an allow-search, block-training fix and an allow-everything fix that keep your current rules.

The checker also reads how `robots.txt` itself responds, because the status changes what crawlers do:

| `robots.txt` returns     | What crawlers do                                                                                                   |
| ------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| 200 with rules           | Follow the rules                                                                                                   |
| 404 or 410               | Crawl everything                                                                                                   |
| Another 4xx, such as 403 | Treat it as no rules, though a firewall that refuses this request probably refuses the crawler's page requests too |
| 429, 5xx or a timeout    | Treat the whole site as blocked until the file loads                                                               |
| An HTML page             | Find no rules in it                                                                                                |

Google reads only the first 500 KiB of `robots.txt`. Rules past that point are ignored.

## Your CDN can block what robots.txt allows

`robots.txt` is a request that crawlers choose to honour. Your CDN, WAF and bot protection make the decision that sticks. Bot-fight modes, managed challenge rules, rate limits and "block AI bots" toggles answer AI crawlers with a 403, a 429 or a JavaScript challenge, and none of that shows up in `robots.txt`.

Fetch a real page as the crawlers do with the [AI crawler preview](https://devtune.ai/tools/ai-crawler-preview). It requests the page as `OAI-SearchBot`, `PerplexityBot`, `Claude-SearchBot` and `Googlebot`, and shows the status each one got, the title, description, canonical and robots tags, and the text a crawler that runs no JavaScript reads. A 403 or 429 for one bot and a 200 for another usually points at a WAF rule matched on user agent.

To fix one:

1. Find the rule that matched in your CDN or WAF's security event log, filtered by the crawler's user agent.
2. Add an allow or skip rule for the search crawlers and user-triggered fetchers you want, above the rule that blocked them.
3. Match on the operator's published IP ranges as well as the user agent, so a scraper that copies the `OAI-SearchBot` string doesn't get through with it. OpenAI, Anthropic, Perplexity, Google and Bing each publish theirs as a JSON list, such as `https://openai.com/searchbot.json`.
4. Confirm in your CDN or WAF logs that real requests from the operator's published IPs now return 200. The [AI crawler preview](https://devtune.ai/tools/ai-crawler-preview) sends requests from DevTune's servers with the crawler's user agent rather than the operator's IP range, so a working IP-restricted rule will still answer the preview with a 403—don't drop the IP check to make the preview return 200. Use the preview to check user-agent-only blocks and server-rendered HTML, and your CDN logs to confirm IP-verified crawler access.

To enforce a training block, do the reverse: deny `GPTBot`, `ClaudeBot`, `CCBot` and `Bytespider` at the CDN as well as in `robots.txt`.

## Confirm crawlers arrive

`robots.txt` and the crawler preview show what a crawler would get. They don't show whether one visited, how often or which pages it fetched. For that you need your server or CDN logs, read by user agent. [How to track AI crawler and answer-fetch traffic](https://devtune.ai/blog/track-ai-crawler-and-answer-fetch-traffic) covers the filters for Cloudflare, Vercel and Nginx, and how DevTune's AI Traffic counts answer fetches, crawls and referrals separately.
