SaferComputing.com

Reference · Websites

AI crawler user agents in robots.txt: which token blocks training, search or user fetches

Block AI crawlers in robots.txt with the user-agent tokens each company documents, from GPTBot and ClaudeBot to Google-Extended and Applebot-Extended, and see which control training, search or user fetches.

Published
Last checked
Applies to
Any website where you can publish a robots.txt file at the top of each host name
Technical specification
Target artifactThe robots.txt file at the top of each host name, such as https://DOMAIN/robots.txt, and its User-agent groups for the tokens AI companies document.
Default behaviourWith no file, or no group that names a crawler and no * group, crawlers that follow the Robots Exclusion Protocol may fetch every page. Each token covers one purpose: training, search, or pages fetched when a user asks.
Safe stateA group with Disallow: / for each token you refuse, in the robots.txt of every host name, including www and other subdomains; the file answers 200; server or network blocking for fetchers that do not follow the file.
Check on Windowscurl.exe -s https://DOMAIN/robots.txt
Check on Linuxcurl -s https://DOMAIN/robots.txt
Check on macOScurl -s https://DOMAIN/robots.txt
Fixadd one group per token, such as User-agent: GPTBot followed by Disallow: /, to robots.txt in the site's top folder

Which token does what

Each company documents its own tokens. OpenAI says each of its settings is independent of the others: a site can allow OAI-SearchBot to appear in ChatGPT search while disallowing GPTBot to keep its content out of training. Crawlers match the token without regard to case, so meta-externalagent and Meta-ExternalAgent are the same.

Training and data collection

TokenCompanyWhat the company says it controls
GPTBotOpenAICrawls content that may be used to train its generative AI foundation models
ClaudeBotAnthropicCollects content that could contribute to training; a block signals that the site's future content should be left out of training data
Google-ExtendedGoogleNot a crawler: decides whether content Google crawls may train future Gemini models and be used for grounding in Gemini Apps and Vertex AI. No effect on inclusion or ranking in Google Search
Applebot-ExtendedAppleNot a crawler: decides whether content Applebot crawls may train Apple's foundation models. Pages that disallow it can still appear in Apple's search results
meta-externalagentMetaCrawls for training foundation AI models and for indexing content to improve Meta's products
AmazonbotAmazonImproves Amazon's products and services, and may be used to train Amazon AI models
MistralAI-TrainingMistral AICrawls content to build datasets for training Mistral's generative AI models
CCBotCommon CrawlBuilds the non-profit's open repository of web crawl data; its page does not say who uses the data
TokenCompanyWhat the company says it controls
OAI-SearchBotOpenAISites shown in ChatGPT's search features; an opted-out site is not shown in ChatGPT search answers, though it can still appear as a navigational link
Claude-SearchBotAnthropicIndexes content to improve the relevance of Claude's search results; blocking it may reduce the site's visibility there
PerplexityBotPerplexitySurfaces and links sites in Perplexity's search results; Perplexity says it is not used to crawl content for AI foundation models
meta-webindexerMetaImproves Meta AI search results; allowing it lets Meta AI cite and link the site
Amzn-SearchBotAmazonSearch in Amazon products such as Alexa; Amazon says it does not crawl content for generative AI training
MistralAI-IndexMistral AIIndexes content for Mistral's search; Mistral says this content is not used for training
DuckAssistBotDuckDuckGoCrawls pages in real time for AI-assisted answers; DuckDuckGo says the data is not used to train AI models
ApplebotAppleSearch technology used by Spotlight, Siri and Safari; Apple says its data may also help train Apple's foundation models, which Applebot-Extended controls

Pages fetched when a user asks

TokenCompanyWhat the company says about robots.txt
ChatGPT-UserOpenAINot used for automatic crawling; because a user starts the action, robots.txt rules may not apply
Claude-UserAnthropicDisabling it stops Claude retrieving the site in response to user questions
Perplexity-UserPerplexityVisits a page when a user asks a question, and generally ignores robots.txt rules
meta-externalfetcherMetaFetches links users ask for, and may bypass robots.txt rules
Amzn-UserAmazonLive information for user requests, such as Alexa questions; may not follow all robots.txt directives
MistralAI-UserMistral AIUser actions in Mistral's Vibe; the token governs which sites these requests can be made to

Example: refuse training, keep search

This file refuses every training token above and leaves search and user fetches alone. It must answer at https://DOMAIN/robots.txt. Repeat it on every host name: crawlers read each host's own file, and Anthropic asks for it on every subdomain you want to opt out.

robots.txt in the site's top folder
User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: Applebot-Extended
Disallow: /

User-agent: meta-externalagent
Disallow: /

User-agent: Amazonbot
Disallow: /

User-agent: MistralAI-Training
Disallow: /

User-agent: CCBot
Disallow: /
  • To leave a company's search as well, add its search and user tokens from the tables in the same way.
  • A crawler that finds a group with its own name follows that group and ignores User-agent: *. Repeat in its group any * rule it should also follow.
  • If no group names Applebot but one names Googlebot, Apple says Applebot follows the Googlebot group.
  • Amazon also reads a noarchive robots meta tag on a page as "do not use the page for model training".

Check the live file

Linux or macOS terminal
curl -s https://DOMAIN/robots.txt
curl -s -o /dev/null -w '%{response_code}\n' https://DOMAIN/robots.txt

The first command prints the rules as crawlers see them, the second the status code. On Windows, type curl.exe; curl.exe -sI https://DOMAIN/robots.txt shows the status code on its first line.

Under the standard, RFC 9309, a 200 means crawlers read the groups in the file; a 404 or another 4xx means there are no rules and crawlers may fetch anything; a 5xx error means they must assume the whole site is disallowed.

Changes take time. The standard says crawlers should not use a cached copy for more than 24 hours. OpenAI says its search results take about 24 hours to adjust, Perplexity and Meta say up to 24 hours, and Amazon says its crawlers may use a copy from the last 30 days.

robots.txt is a request, not a lock

  • The standard says its rules "are not a form of access authorization". A crawler that ignores the file is not stopped by it, and the companies above say their user-triggered fetchers may not follow it.
  • A user-agent name is a claim that any program can send; Common Crawl warns that some crawlers falsely use the CCBot name. Most of the companies above publish the addresses their crawlers use, linked from the pages in Sources.
  • Enforcement happens at the web server, the host or a content delivery network. Anthropic warns that blocking its addresses may not work as an opt-out, because it stops Anthropic reading robots.txt.
  • Anthropic describes a ClaudeBot block as a signal about the site's future content; it says nothing about content collected before.
  • Google-Extended and Applebot-Extended never appear in server logs: Google and Apple crawl with their usual crawlers and read these tokens only as controls.
See which crawlers visit
Ubuntu with Apache, as a user with sudo
sudo grep -iE 'GPTBot|ClaudeBot|CCBot|PerplexityBot|meta-externalagent|Amazonbot|MistralAI' /var/log/apache2/access.log | tail -n 20

On nginx, the log is /var/log/nginx/access.log. The names in a log are what each visitor claimed to be.

Sources