Sub topic 4
AI crawlers: training, search and user-triggered fetching
This chapter assumes you can read a robots.txt file, know what a user-agent string is, and have seen a web server access log. It covers the idea behind AI crawler user-agent tokens and how to write rules that treat different AI uses of your content differently.
One name, three different jobs
"AI crawler" covers at least three kinds of request. They differ in why the request happens and in what you lose by refusing it.
- Training crawlers collect content in bulk. The content may be used to build or tune a model. Refusing them has no direct effect on whether your pages appear in an assistant's answers today.
- Search and index crawlers build an index that an AI search product queries when it answers questions. Refusing them can make your pages less likely to be cited or linked by that product.
- User-triggered fetchers request one page because a person asked an assistant to read it, for example by pasting a URL into a chat. Nothing is crawled in the background.
The distinction matters because a single rule such as "block AI" mixes goals that are often opposed. Many publishers want to be cited in AI search and also prefer that their text is not used for training.
| Purpose | Example tokens | Triggered by | What blocking changes |
|---|---|---|---|
| Training | GPTBot, ClaudeBot, CCBot, Google-Extended, Applebot-Extended | The vendor's scheduled crawl | Content is not collected for training, as far as the vendor honors it |
| Search or index | OAI-SearchBot, Claude-SearchBot, PerplexityBot | The vendor's scheduled crawl | The product may not index or cite your pages |
| User-triggered | ChatGPT-User, Claude-User, Perplexity-User | One user's request | The assistant may fail to read a page the user pointed it to |
The names above were current when this was written. Vendors add, rename and split tokens, so treat their own documentation pages as the source of truth.
Tokens are not always crawlers
A user-agent token is the name you put after User-agent: in robots.txt. Usually it matches the name in the User-Agent request header. For some products it does not.
Google-Extended is the clearest case. It is a robots.txt token only. No request ever arrives with Google-Extended in its header. Google's regular crawlers fetch your pages, and the token tells Google whether that content may be used for its generative AI models, such as Gemini. Blocking Google-Extended does not remove you from Google Search, because Search inclusion is governed by Googlebot. Applebot-Extended works the same way for Apple.
Because of this, you cannot find these tokens in your logs. You can only find the underlying crawler, and a log line from Googlebot does not tell you which AI uses the content may serve.
Writing the rules
A robots.txt file is made of groups. A group starts with one or more User-agent lines and contains the rules that apply to those agents. The example below separates the three purposes.
# Training: opt out
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
Disallow: /
# Search: stay eligible for AI search citations
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Allow: /
# Everyone else, including user-triggered fetchers
User-agent: *
Allow: /
Sitemap: https://example.com/sitemap.xmlTwo parsing rules cause most of the mistakes in files like this.
- A crawler obeys only its most specific matching group. It does not combine that group with the
*group. If you give GPTBot a group containing onlyDisallow: /private/, GPTBot ignores everything in your*group. - Matching is on the token, not on the vendor. Blocking GPTBot says nothing about OAI-SearchBot or ChatGPT-User. Each product needs its own line if you want it treated differently.
You can test the rules with Python's standard library before you deploy them.
from urllib.robotparser import RobotFileParser
rules = """User-agent: GPTBot
User-agent: ClaudeBot
User-agent: CCBot
User-agent: Google-Extended
Disallow: /
User-agent: OAI-SearchBot
User-agent: Claude-SearchBot
User-agent: PerplexityBot
Allow: /
User-agent: *
Allow: /
""".splitlines()
rp = RobotFileParser()
rp.parse(rules)
agents = ["GPTBot", "ClaudeBot", "CCBot", "OAI-SearchBot",
"PerplexityBot", "ChatGPT-User", "Googlebot"]
for agent in agents:
verdict = "allowed" if rp.can_fetch(agent, "https://example.com/docs/") else "blocked"
print(f"{agent:15} {verdict}")GPTBot, ClaudeBot and CCBot print blocked. The other four print allowed: ChatGPT-User and Googlebot reach the * group because nothing names them. The script checks only how a compliant parser reads your file. It does not tell you what any vendor's crawler will do.
Not every fetcher reads robots.txt the same way
Robots.txt is a convention for automated crawlers that discover pages by themselves. A user-triggered fetcher is closer to a browser acting for one person, and vendors disagree about whether it should obey the file.
- Some vendors document that their user-triggered agent follows robots.txt.
- Some document that, because a person initiated the request, robots.txt rules may not apply.
- Policies change. A statement from last year may no longer hold.
Read each vendor's current crawler documentation before you rely on a token to stop a user-triggered fetch. If you must stop one, robots.txt is the wrong tool. Chapter material on enforcement covers the alternatives.
Common errors
- Blocking a search token to stop training. OAI-SearchBot and GPTBot are separate. Blocking the search token can reduce your appearance in that product's search answers without affecting training collection.
- Expecting Google-Extended to hide you from AI Overviews. Overviews are part of Google Search, so they follow Search controls and not this token.
- Misspelled tokens.
GPT-BotorClaudebotmay fail to match. Matching in most parsers is case-insensitive but spelling still has to be exact. A group that matches nothing silently falls through to*. - Trusting the user-agent header. Anyone can send
GPTBotin a header. A spoofed request shows up in logs as the real crawler. - A
Disallowwith no path.Disallow:with an empty value allows everything. It does not block anything.
Seeing which AI agents reach you
Your access log records requests from agents that visit, whatever your robots.txt says. Counting by user-agent tells you which of these tokens matter to your site.
# Requests per AI-related agent, most active first
grep -oE "GPTBot|OAI-SearchBot|ChatGPT-User|ClaudeBot|Claude-SearchBot|Claude-User|PerplexityBot|CCBot" access.log \
| sort | uniq -c | sort -rn
# Did any of them request robots.txt before fetching pages?
grep "GET /robots.txt" access.log | grep -E "GPTBot|OAI-SearchBot|ClaudeBot|PerplexityBot"The second command is a useful check on good faith. A crawler that honors robots.txt requests it regularly, and it should stop fetching paths you disallowed after it sees a new version. A crawler that never requests robots.txt but fetches thousands of pages is either ignoring the convention or is a user-triggered fetcher.
To go beyond the header, verify an agent by source address. Several vendors publish IP ranges for their crawlers, and search engines also support reverse DNS checks. A request whose header says GPTBot but whose address is outside the published ranges is not GPTBot.
Choosing a policy
Decide per purpose, then write the rules.
- Do you want to be cited in AI search? If yes, allow the search tokens. Allowing them is a precondition for citation, not a guarantee of it.
- Do you accept use for training? If not, block the training tokens, and accept that this is a request and not a barrier.
- Do you want assistants to read pages users give them? Usually yes. Blocking these fetchers mostly harms your own readers.
- Is blocking a hard requirement? Then robots.txt is not enough. You need verification of the requester, rate limits, firewall rules or authentication.
Review the file when vendors announce new tokens. Run the log command above every few months, because the list of agents visiting a site changes faster than most robots.txt files do.
Exercise
A news site wants its articles to appear as cited sources in an AI search product, does not want them used for model training, and wants assistants to be able to read an article when a reader pastes its URL. Using the tokens in this chapter, which robots.txt groups would you write, and why is robots.txt alone not a guarantee for the training goal?
Show answer
Disallow the training tokens (for example GPTBot, ClaudeBot, CCBot and Google-Extended) with Disallow: /. Allow the search tokens (for example OAI-SearchBot, Claude-SearchBot and PerplexityBot) with Allow: /. Leave the user-triggered fetchers (ChatGPT-User, Claude-User) unlisted or explicitly allowed, so they fall under User-agent: * with Allow: /. Robots.txt alone is no guarantee for the training goal because it is advisory. Only vendors that choose to honor it will comply, it does not remove content already collected, and a request can spoof a user-agent header. Verification by IP range and server-side enforcement are needed if the requirement is strict.