Allow AI search while limiting training crawls
Write and check a robots.txt policy that keeps AI search crawlers able to reach your pages while asking training crawlers to stay out, on any server or CDN.
AI assisted in drafting. This local editorial draft is pending review.
Last verified 30 November 2026
This guide shows how to write and check a robots.txt policy that keeps AI search crawlers able to reach your public pages while asking AI training crawlers to stay out, on any server or CDN. It takes one to two hours, plus a week of reading logs, and applies only to sites you administer. If your site is on Cloudflare, the companion guide on blocking training crawlers on Cloudflare adds managed rules and enforcement.
The reason to separate the two is simple. Blocking a training crawler keeps your content out of future model training and leaves AI search untouched. Blocking a search crawler removes you from that product's AI answers. A single rule for "AI bots" usually does both, which most brands do not want.
Steps at a glance
| Step | What you do | Evidence |
|---|---|---|
| 1 | Choose a policy per purpose | Observed |
| 2 | List each operator's agents from its own documentation | Official documentation |
| 3 | Read the current robots.txt on every host | Standard |
| 4 | Write the new groups | Standard |
| 5 | Decide how to handle user-triggered fetchers | Official documentation |
| 6 | Publish, test and record | Observed |
| 7 | Compare logs for a week | Observed |
1. Choose a policy per purpose · Observed
AI agents fall into three purposes. Decide your policy for each before writing any rule.
| Purpose | What the agent does | Most brands |
|---|---|---|
| Training | Collects pages that may train or fine-tune models | Disallow, if keeping content out of training matters to you |
| Search index | Builds the index an AI search product retrieves from and cites | Allow |
| User-triggered | Fetches a page because a person asked a question or gave a task | Allow for public pages |
If you sell licensed or paid content, put it behind authentication. robots.txt is a public request, not access control.
2. List the agents · Official documentation
Use each operator's own documentation, because names and purposes change.
| Operator | Training | Search | User-triggered |
|---|---|---|---|
| OpenAI | GPTBot | OAI-SearchBot | ChatGPT-User |
| Anthropic | ClaudeBot | Claude-SearchBot | Claude-User |
| Perplexity | none listed for training | PerplexityBot | Perplexity-User |
| Google-Extended token | Googlebot, which also serves AI Overviews and AI Mode | none in robots.txt terms |
Google is the exception that causes most mistakes. AI Overviews and AI Mode are part of Google Search and use Googlebot. Google-Extended is a control token, not a separate crawler: it governs use for training and grounding in some of Google's other AI products and, in Google's words, does not affect inclusion in Google Search. Never disallow Googlebot to limit Google's AI; that removes you from Google Search.
Add any regional operators that matter in your markets, such as Moonshot AI's Kimi agents, from their documentation. Our pillar on AI crawlers keeps a fuller list.
3. Read the current robots.txt · Standard
Fetch /robots.txt from every host you serve, including www, subdomains and language hosts: rules apply per host. Save each file. RFC 9309 defines how crawlers match their user-agent to a group and how the most specific path rule wins, so read the file the way a crawler would:
- Which group would GPTBot, OAI-SearchBot, ClaudeBot and Claude-SearchBot match? A crawler with its own group ignores the
*group. - Does a broad
Disallowin the*group catch search agents that have no group of their own? - Does any line block CSS, JavaScript or images your pages need to render?
4. Write the new groups · Standard
A typical policy that allows search and asks training agents to stay out:
| Group | Rules |
|---|---|
User-agent: GPTBot | Disallow: / |
User-agent: ClaudeBot | Disallow: / |
User-agent: Google-Extended | Disallow: / |
User-agent: OAI-SearchBot | Allow: / |
User-agent: Claude-SearchBot | Allow: / |
User-agent: PerplexityBot | Allow: / |
User-agent: * | Your existing rules for everyone else |
Keep private paths disallowed in every group that should not reach them, because a crawler that matches a named group does not read the * group. Add a Sitemap: line so search agents find your pages.
If you want to state preferences beyond allow and disallow, some CDNs add a Content Signals line, for example search=yes, ai-train=no. It expresses a preference; it does not enforce one.
5. Handle user-triggered fetchers · Official documentation
User-triggered fetchers act for a person who asked about your page. OpenAI says robots.txt rules may not apply to ChatGPT-User, and Perplexity says Perplexity-User generally ignores robots.txt. Anthropic says its bots, including Claude-User, respect robots.txt. For public marketing pages, allowing these fetchers is usually in your interest. If a page must not be read, protect it with authentication or a server rule, not robots.txt.
6. Publish, test and record · Observed
- Deploy the new robots.txt to every host.
- Fetch it from outside your network and confirm the groups appear as written.
- Request a representative page and confirm it returns 200 and renders its main text without scripts.
- Record the date, the old and new files and the reason in your change log.
7. Compare logs for a week · Observed
In your server or CDN logs, compare the week before and after:
- training agents should request less, or only
/robots.txt; - search agents should keep fetching your pages;
- any agent requesting disallowed paths should be checked before you act. User-agent strings can be faked, so confirm identity against the operator's published IP ranges or reverse DNS first.
What this does not change
- Citations are a separate measure. Being reachable is the first stage of the AI visibility funnel; whether answers cite you is measured from sampled answers.
- Past training is not undone. The policy affects future crawls.
- Non-compliant crawlers. robots.txt relies on crawlers choosing to honor it; enforcement needs server or CDN rules.
Common mistakes
| Mistake | Effect | Instead |
|---|---|---|
User-agent: * with Disallow: / to stop AI | Blocks every search engine too | Name training agents individually |
| Disallowing Googlebot to stop Google's AI | Removes you from Google Search | Use Google-Extended |
| Editing only the main host | Subdomains keep the old policy | Check every host |
| Forgetting private paths in named groups | Named agents can reach them | Repeat private rules in each group |
Read crawler roles · Check site readiness