AI Visibility Tracking ToolFree checker

How do Allow and Disallow rules interact for AI crawlers?

99Visibility Research · Updated October 21, 2026 · 5 min read

Short answer

Under RFC 9309, a crawler first picks the one group of rules that names it. It only falls back to the wildcard (*) group when no group names it. Inside that group, the rule with the longest matching path wins. If an Allow and a Disallow match with equal length, Allow should win. A bot-specific group does not inherit anything from the wildcard group, so you must repeat any blocks you still want.

Key takeaways

  • A crawler obeys one group: the group that names its user-agent, or the * group if none does.
  • Rules in the * group do not carry over into a bot-specific group, so repeat every Disallow you need.
  • Within a group, the longest matching path wins, and Allow wins a tie of equal length.
  • Allowing OAI-SearchBot makes pages eligible for ChatGPT search; it does not guarantee retrieval or citation.
  • robots.txt is one gate: a firewall or CDN can still block a bot your file allows.

The two rules that decide every conflict

RFC 9309, the Robots Exclusion Protocol standard, resolves conflicts in two steps. Most mistakes come from mixing them up.

Step 1: pick one group

A crawler reads every User-agent line and looks for one that matches its own product token, such as OAI-SearchBot. The match is case-insensitive. If it finds one, it uses that group's rules. If several groups name the same bot, the crawler combines them into one. Only when no group names the bot does it use the User-agent: * group.

This is the part people miss. A bot-specific group replaces the wildcard group. It does not add to it. If your * group blocks /private/ and you add a group for OAI-SearchBot that only says Allow: /, OAI-SearchBot can now crawl /private/.

Step 2: the most specific rule wins

Inside the chosen group, the crawler compares the URL path against each Allow and Disallow directive. The match with the most characters wins. Line order does not matter. If an Allow and a Disallow match with the same length, RFC 9309 says crawlers should use the Allow.

So Disallow: / plus Allow: /docs/ means everything is blocked except /docs/. The longer /docs/ rule beats the one-character / rule for any path under /docs/.

A correct example: allow OAI-SearchBot, block one folder

Say you want ChatGPT search to reach your site but not a /private/ folder. You also want every other bot kept out of that folder.

User-agent: *
Disallow: /private/

User-agent: OAI-SearchBot
Allow: /
Disallow: /private/

Here is how OAI-SearchBot reads it. It finds its own group and ignores the * group. For /pricing, only Allow: / matches, so it may crawl. For /private/report, both rules match, but /private/ is longer than /, so the Disallow wins.

If you deleted the second Disallow: /private/ line, OAI-SearchBot would be allowed into the folder. That is the inheritance trap from the first section.

The reverse case, opening only one folder to a bot, looks like this:

User-agent: PerplexityBot
Disallow: /
Allow: /docs/

For more patterns like this, see whether you can allow an AI crawler on some pages but not others.

Why the bot name matters for AI crawlers

AI vendors run several crawlers with different jobs, and each one reads only its own group. OpenAI's crawler documentation says GPTBot governs training use, OAI-SearchBot governs ChatGPT search, and "each setting is independent of the others." You can allow OAI-SearchBot and block GPTBot in the same file. Our guide to GPTBot vs OAI-SearchBot covers which to allow.

Three consequences follow:

  • A group for GPTBot does nothing for ChatGPT search. Name OAI-SearchBot if search is what you care about.
  • A blanket User-agent: * with Disallow: / blocks every bot you did not name, including retrieval bots. If you want any AI search bot in, it needs its own group.
  • A bot you never mention falls back to the * group. Read what happens when robots.txt doesn't mention an AI bot before assuming it is blocked or allowed.

User-triggered fetchers behave differently. As of October 2026, OpenAI says robots.txt rules "may not apply" to ChatGPT-User, and Perplexity says Perplexity-User "generally ignores robots.txt rules." Precedence logic only matters for bots that read the file.

Edge cases that change the outcome

  • Trailing slashes. Disallow: /private also matches /private-notes and /private.html. Use /private/ if you mean the folder only.
  • Wildcards. RFC 9309 supports * (any sequence of characters) and $ (end of the path). Disallow: /*.pdf$ blocks PDFs. Specificity is still judged by the length of the matching rule.
  • Equal-length ties. Allow: /a and Disallow: /a in one group resolve to Allow under the RFC. Avoid writing ties at all; they are hard to read and easy to break.
  • Paths are case-sensitive. User-agent names are not, but /Docs/ and /docs/ are different paths.
  • Duplicate groups. Two separate User-agent: OAI-SearchBot groups get merged. That can surprise you if a forgotten group lower in the file contains a Disallow.

Robots.txt also applies per host, so a subdomain needs its own file. And the file itself has to be fetchable: if a bot cannot read robots.txt, it cannot read your rules.

What robots.txt does not control, and what to do next

A correct robots.txt buys eligibility, not inclusion. OpenAI's help center states that eligibility for ChatGPT search needs two things: allowing OAI-SearchBot, and confirming your host or CDN lets traffic from OpenAI's published search bot IP addresses through. A firewall that returns 403 to a bot your file allows removes you silently. Nobody outside the vendor controls whether a crawled page is later retrieved or cited.

Here is the order to work in:

  1. Write one group per AI bot you care about, and repeat every Disallow you still need inside each group.
  2. Check each important URL against each bot's group using the longest-match rule. Our playbook on testing robots.txt rules for each AI bot walks through it.
  3. Run the file through the free robots.txt Checker for AI Crawlers to see how each bot resolves.
  4. If the file looks right but you still never appear, check the network layer. Start with what else can block you from ChatGPT when robots.txt allows AI bots.

Frequently asked questions

Does the order of Allow and Disallow lines matter?

No, not under RFC 9309. Crawlers compare every rule in the chosen group and apply the one with the longest matching path, regardless of where it appears. Some older parsers read rules top to bottom, so putting the more specific rule first is a harmless habit. The order of groups does not matter either, because a crawler picks its group by name, not by position.

If I add a group for one AI bot, does it still follow my wildcard rules?

No. A crawler that finds a group naming it uses only that group and ignores the User-agent: * group entirely. Any Disallow you set for all bots must be copied into each bot-specific group. This is the most common reason a bot ends up crawling a folder the owner thought was blocked.

Can I list several AI bots in one group?

Yes. A group can start with several User-agent lines, one per bot, followed by shared rules. For example, you can list OAI-SearchBot, PerplexityBot and Claude-SearchBot together and give them the same Allow and Disallow lines. Each bot still reads only the group that names it, so keep training bots in a separate group if you want to treat them differently.

Does allowing OAI-SearchBot let GPTBot in too?

No. OpenAI documents each crawler setting as independent. Allowing OAI-SearchBot affects ChatGPT search eligibility only, and GPTBot follows its own group or the wildcard group. You can allow one and block the other. Blocking GPTBot does not remove you from ChatGPT search, and allowing it does not help you appear there.

What happens when Allow and Disallow match the same length?

RFC 9309 says the crawler should use the Allow rule when two matching rules are equally specific. Relying on that is risky, because a tie is easy to create by accident and hard to spot in review. Write rules so the one you intend to win is clearly longer, then test the exact URLs you care about against each bot.

Sources

  1. RFC 9309: Robots Exclusion Protocol
  2. Overview of OpenAI Crawlers
  3. Searching the web with ChatGPT
  4. Perplexity Crawlers - Perplexity
  5. Robots.txt Introduction and Guide

This page is AI-assisted. It was written from a verified evidence base and checked against our editorial policy. Engine behaviour changes often; facts are as of October 21, 2026.

Keep reading