Skip to main content

This page is not yet available in this language

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

StepWhat you doEvidence
1Choose a policy per purposeObserved
2List each operator's agents from its own documentationOfficial documentation
3Read the current robots.txt on every hostStandard
4Write the new groupsStandard
5Decide how to handle user-triggered fetchersOfficial documentation
6Publish, test and recordObserved
7Compare logs for a weekObserved

1. Choose a policy per purpose · Observed

AI agents fall into three purposes. Decide your policy for each before writing any rule.

PurposeWhat the agent doesMost brands
TrainingCollects pages that may train or fine-tune modelsDisallow, if keeping content out of training matters to you
Search indexBuilds the index an AI search product retrieves from and citesAllow
User-triggeredFetches a page because a person asked a question or gave a taskAllow 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.

OperatorTrainingSearchUser-triggered
OpenAIGPTBotOAI-SearchBotChatGPT-User
AnthropicClaudeBotClaude-SearchBotClaude-User
Perplexitynone listed for trainingPerplexityBotPerplexity-User
GoogleGoogle-Extended tokenGooglebot, which also serves AI Overviews and AI Modenone 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 Disallow in 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:

GroupRules
User-agent: GPTBotDisallow: /
User-agent: ClaudeBotDisallow: /
User-agent: Google-ExtendedDisallow: /
User-agent: OAI-SearchBotAllow: /
User-agent: Claude-SearchBotAllow: /
User-agent: PerplexityBotAllow: /
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

  1. Deploy the new robots.txt to every host.
  2. Fetch it from outside your network and confirm the groups appear as written.
  3. Request a representative page and confirm it returns 200 and renders its main text without scripts.
  4. 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

MistakeEffectInstead
User-agent: * with Disallow: / to stop AIBlocks every search engine tooName training agents individually
Disallowing Googlebot to stop Google's AIRemoves you from Google SearchUse Google-Extended
Editing only the main hostSubdomains keep the old policyCheck every host
Forgetting private paths in named groupsNamed agents can reach themRepeat private rules in each group

Read crawler roles · Check site readiness

Sources