Block AI training crawlers, let AI assistants in
Many sites refuse the crawlers that collect training data for AI models. Some of these sites also refuse the AI assistants by accident, with the group * or with a long list of agents. An assistant agent fetches one page when a person asks for it. It does not collect the site for a model.
This page gives a robots.txt that refuses the training crawlers and lets the assistants in. In the study of the top 1,000 domains, 42 sites do this for OpenAI: they refuse GPTBot and let ChatGPT-User in.
The robots.txt
Section titled “The robots.txt”Put this file at /robots.txt on your site. Change /account/ to the paths that no bot must fetch, and change the address of the sitemap.
# Crawlers and tokens for the training of AI models: no pagesUser-agent: GPTBotUser-agent: ClaudeBotUser-agent: CCBotUser-agent: Google-ExtendedUser-agent: Applebot-ExtendedUser-agent: BytespiderUser-agent: meta-externalagentDisallow: /
# Assistants that fetch a page because a person asked for itUser-agent: ChatGPT-UserUser-agent: Claude-UserUser-agent: Perplexity-UserDisallow: /account/Allow: /
# Crawlers for AI search: they show the site in answers, with a linkUser-agent: OAI-SearchBotUser-agent: Claude-SearchBotUser-agent: PerplexityBotDisallow: /account/Allow: /
# All other crawlers, for example GooglebotUser-agent: *Disallow: /account/Content-Signal: search=yes, ai-input=yes, ai-train=no
Sitemap: https://www.example.com/sitemap.xmlOpen this file in the robots.txt tester to see the verdict for each agent and each path.
The agents
Section titled “The agents”| Agent | What it does | In this file |
|---|---|---|
GPTBot |
OpenAI: collects pages to train models | Refused |
ClaudeBot |
Anthropic: collects pages to train models | Refused |
CCBot |
Common Crawl: collects pages for an open dataset that many models use | Refused |
Google-Extended |
Google: a token that controls the use of the pages of Googlebot for training | Refused |
Applebot-Extended |
Apple: a token that controls the use of the pages of Applebot for training | Refused |
Bytespider |
ByteDance: collects pages to train models | Refused |
meta-externalagent |
Meta: collects pages to train models | Refused |
ChatGPT-User |
OpenAI: fetches a page when a person asks ChatGPT | Permitted |
Claude-User |
Anthropic: fetches a page when a person asks Claude | Permitted |
Perplexity-User |
Perplexity: fetches a page when a person asks Perplexity | Permitted |
OAI-SearchBot |
OpenAI: collects pages for ChatGPT search | Permitted |
Claude-SearchBot |
Anthropic: collects pages for search in Claude | Permitted |
PerplexityBot |
Perplexity: collects pages for Perplexity search | Permitted |
How the file works
Section titled “How the file works”- One group refuses the training crawlers. The group names each crawler, and
Disallow: /refuses each path. The two tokensGoogle-ExtendedandApplebot-Extendeddo not refuse Googlebot or Applebot. The site stays in Google Search and in Apple search, and the pages do not go into training. - One group permits the assistants. A group that names an agent replaces the group
*for that agent. Thus copy each rule of the group*that must apply to the assistants too, for exampleDisallow: /account/. - One group permits the search crawlers. These crawlers show your pages in AI search answers, with a link to the page. To keep the site out of AI search, change
Allow: /toDisallow: /in this group. - The group
*applies to all other crawlers. Googlebot and Bingbot get these rules. - The content signal tells the use of the content.
ai-train=norefuses training, andai-input=yespermits an assistant to use a page in an answer. Cloudflare publishes this format. A crawler that does not know the line ignores it.
Before you publish it
Section titled “Before you publish it”- Test the file. Paste it into the robots.txt tester with the paths of your site. The tester uses the parser of polite-crawler, which follows RFC 9309.
- Read the documentation of each company. The companies tell how each agent reads robots.txt. Some state that an agent that acts for a person does not always obey it.
- Know the limits. A robots.txt is a request. It does not stop a crawler that ignores it. To stop such a crawler, block it on the server or at the edge.
- Add new agents. Companies start new crawlers. Read your server logs, and add a new training crawler to the first group.
How polite-crawler reads this file
Section titled “How polite-crawler reads this file”The MCP server of polite-crawler fetches a page for an assistant. It obeys the group for its own token, PoliteCrawler, and the group for Claude-User. With this file, both groups permit each page except /account/, so the server reads each of these pages. About PoliteCrawler.