How to Check AI Crawler Access in robots.txt (2026 Guide)
Check AI crawler access in robots.txt: test GPTBot, ClaudeBot and PerplexityBot with RFC 9309 rules, then confirm your firewall and CDN let them through.
Kazi Khalid Hasan Tamim · BugViso Team
14 min read
To check AI crawler access in robots.txt, find the group that applies to each AI user agent (OAI-SearchBot, Claude-SearchBot, PerplexityBot, GPTBot, ClaudeBot), apply the longest matching rule to the path, then request the page with that user agent to see what your CDN or firewall returns. Both layers have to say yes.
The second layer is where most blocks hide. In BugViso's crawl of 219 random homepages (Tranco ranks 1,001–50,000, October 2026), 15.1 % didn't return 200 to a plain HTTP request, mostly a 403 from bot protection, while only 1.9 % blocked OAI-SearchBot in robots.txt. To compare testers, including why Python's built-in parser gets most rules wrong, see the best robots.txt tester tools.
By the end you'll be able to read a robots.txt the way the crawlers do, run one script that checks the file and the live response for six AI bots, and spot the seven mistakes that block AI crawlers without any visible error.
Which AI User Agents to Check, and Why the Purpose Matters
Check the search crawlers first: they decide whether AI answers can cite you. Training crawlers only decide whether your pages go into future models, which is a policy choice rather than a visibility problem.
| Token | Company | Purpose | Blocking it means |
|---|---|---|---|
OAI-SearchBot | OpenAI | ChatGPT search | Not shown in ChatGPT search answers (OpenAI) |
ChatGPT-User | OpenAI | Fetches a page a user asked about | ChatGPT can't open the page for that user |
GPTBot | OpenAI | Model training | Opted out of training; search unaffected |
Claude-SearchBot | Anthropic | Indexing for Claude's search | Lower visibility in Claude's search results |
Claude-User | Anthropic | Fetches a page a user asked about | Claude can't retrieve it for that user |
ClaudeBot | Anthropic | Model training | Opted out of training (Anthropic) |
PerplexityBot | Perplexity | Search index | Not surfaced in Perplexity search (Perplexity) |
Google-Extended | robots.txt token for Gemini training and grounding | Google Search and AI Overviews unaffected |
ClaudeBot is the token people misread most. Older guides call it Claude's retrieval bot; Anthropic now describes it as the training crawler, with Claude-SearchBot and Claude-User covering search and user requests. We checked 40 documentation sites against all three in our ClaudeBot documentation crawling study. If you want the full policy (which to block, which to allow, and templates), use our guide to blocking AI training while allowing AI search.
How to Check AI Crawler Access in robots.txt, Step by Step
Read the file the way RFC 9309 tells crawlers to, not top to bottom. Order of lines barely matters; group selection and path length do.
- Fetch the live file at
https://yourdomain.com/robots.txtand note the status code.200means rules apply, a4xxmeans crawlers may fetch everything, and a5xxmeans they must treat the whole site as disallowed (RFC 9309, section 2.3.1). - Find the group for each bot. A crawler uses the group whose
User-agentline names its token (case-insensitive). Only if no group names it does it fall back toUser-agent: *. It never combines its own group with*. - Apply the longest match. Within that group, the rule with the longest matching path wins. If an
Allowand aDisallowmatch with equal length,Allowwins. - Check the paths you care about: homepage,
/pricing,/docs/,/blog/. A rule can allow the homepage and still block the pages that answer buyer questions. - Repeat per host. Google's robots.txt documentation says the rules apply only to the host, protocol and port where the file sits, so
docs.example.comneeds its own check.
Here's step 2 catching a real-looking file out:
User-agent: *
Disallow: /
User-agent: PerplexityBot
Allow: /PerplexityBot has its own group and crawls everything. OAI-SearchBot, Claude-SearchBot, Googlebot and Bingbot have none, fall back to *, and are blocked from the whole site. Syntax details are in our robots.txt guide.
Test robots.txt and the Live Response in One Script
This script checks both layers for six AI bots: the RFC 9309 verdict for the URL's path, and the HTTP status the server returns to that bot's user agent. It uses only the Python standard library and exits 1 when a search or user-triggered crawler is blocked, so it can run in CI or a cron job.
#!/usr/bin/env python3
"""ai_crawler_access.py: can each AI crawler read this URL, per robots.txt and per the live server?
Usage: python3 ai_crawler_access.py https://example.com/pricing [more URLs...]
For each bot: the RFC 9309 robots.txt verdict for the URL's path, then the HTTP
status your server (or CDN) returns to that bot's user agent. Exit code 1 when a
search crawler is blocked by either.
"""
import re, ssl, sys, urllib.error, urllib.request
from urllib.parse import urlsplit
# token -> (purpose, user agent close to the one each company documents)
BOTS = {
"OAI-SearchBot": ("search", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.3; +https://openai.com/searchbot"),
"ChatGPT-User": ("user", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot"),
"Claude-SearchBot": ("search", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Claude-SearchBot/1.0)"),
"PerplexityBot": ("search", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)"),
"GPTBot": ("training", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; GPTBot/1.3; +https://openai.com/gptbot"),
"ClaudeBot": ("training", "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)"),
}
BROWSER = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0 Safari/537.36"
CTX = ssl.create_default_context()
def status(url, ua):
req = urllib.request.Request(url, headers={"User-Agent": ua, "Accept": "text/html,*/*"})
try:
with urllib.request.urlopen(req, timeout=20, context=CTX) as r:
return r.status, r.read(500_000).decode("utf-8", "replace")
except urllib.error.HTTPError as e:
return e.code, ""
except Exception as e:
return type(e).__name__, ""
def robots_groups(text):
"""[(agents, [(allow, path)])]; consecutive user-agent lines share one group (RFC 9309)."""
groups, agents, rules, last_was_agent = [], [], [], False
for raw in text.splitlines():
line = raw.split("#", 1)[0].strip()
if ":" not in line:
continue
key, val = (s.strip() for s in line.split(":", 1))
key = key.lower()
if key == "user-agent":
if not last_was_agent and agents:
groups.append((agents, rules))
agents, rules = [], []
agents.append(val.lower())
last_was_agent = True
elif key in ("allow", "disallow") and agents:
rules.append((key == "allow", val))
last_was_agent = False
if agents:
groups.append((agents, rules))
return groups
def path_matches(pattern, path):
rx = re.escape(pattern).replace(r"\*", ".*")
if rx.endswith(r"\$"):
rx = rx[:-2] + "$"
return re.match(rx, path) is not None
def allowed(groups, bot, path):
"""Groups naming the bot (else '*'); longest matching path wins; Allow wins a tie."""
token = bot.lower()
rules = [r for agents, rs in groups if token in agents for r in rs]
if not any(token in agents for agents, _ in groups):
rules = [r for agents, rs in groups if "*" in agents for r in rs]
best = None
for allow, pat in rules:
if pat and path_matches(pat, path):
if best is None or len(pat) > best[0] or (len(pat) == best[0] and allow):
best = (len(pat), allow)
return True if best is None else best[1]
def check(url):
s = urlsplit(url)
path = (s.path or "/") + (f"?{s.query}" if s.query else "")
rcode, rtext = status(f"{s.scheme}://{s.netloc}/robots.txt", BROWSER)
print(f"\n{url}\n robots.txt: {rcode}")
if isinstance(rcode, int) and rcode >= 500:
print(" ! robots.txt answers 5xx: RFC 9309 tells crawlers to treat the whole site as disallowed")
groups = robots_groups(rtext) if rcode == 200 else []
bstatus, _ = status(url, BROWSER)
print(f" browser user agent: {bstatus}")
bad = False
for bot, (purpose, ua) in BOTS.items():
ok = allowed(groups, bot, path) and not (isinstance(rcode, int) and rcode >= 500)
code, _ = status(url, ua)
reachable = code == 200
flag = "ok" if ok and reachable else "BLOCKED"
if purpose != "training" and flag == "BLOCKED":
bad = True
print(f" {flag:<8} {bot:<17} {purpose:<8} robots.txt {'allow' if ok else 'DISALLOW'}, HTTP {code}")
return bad
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.exit(__doc__)
sys.exit(1 if any([check(u) for u in sys.argv[1:]]) else 0)Real output for our own pricing page on 9 November 2026:
$ python3 ai_crawler_access.py https://bugviso.com/pricing
https://bugviso.com/pricing
robots.txt: 200
browser user agent: 200
ok OAI-SearchBot search robots.txt allow, HTTP 200
ok ChatGPT-User user robots.txt allow, HTTP 200
ok Claude-SearchBot search robots.txt allow, HTTP 200
ok PerplexityBot search robots.txt allow, HTTP 200
ok GPTBot training robots.txt allow, HTTP 200
ok ClaudeBot training robots.txt allow, HTTP 200Three patterns to read for. DISALLOW with HTTP 200 is a robots.txt problem. allow with HTTP 403, 429 or 503 is a firewall or CDN problem. A browser 200 next to a bot 403 confirms the server is treating the bot differently on purpose.
Run it from outside your network. A test from the office or a server inside your VPC can pass rules that the internet doesn't.
Quick Checks With curl
For a one-off test, curl -I with a bot's user agent shows the status code your edge returns.
# ChatGPT search
curl -sI -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.3; +https://openai.com/searchbot" https://example.com/pricing | head -1
# Perplexity
curl -sI -A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)" https://example.com/pricing | head -1
# Compare with a browser user agent
curl -sI -A "Mozilla/5.0 (X11; Linux x86_64) Chrome/124.0" https://example.com/pricing | head -1200: the edge lets the bot through.403,401or429: a firewall, bot-management rule or rate limit is refusing it.503with a challenge page: an "under attack" mode or JavaScript challenge. Crawlers can't solve it, so it's a block in practice.301/302: follow it withcurl -ILand confirm the final hop is200, not a chain or a login page.
A spoofed user agent can't prove the real crawler gets the same answer, because some CDNs verify bots by IP. It does prove when your rules match the token, which is the usual cause.
When robots.txt Allows It but the Firewall Doesn't
A permissive robots.txt guarantees nothing if the CDN answers first. Bot-management products, WAF rules and one-click "block AI bots" settings decide before your origin, or robots.txt, is involved.
- Find which bots your CDN's AI-bot setting covers. Some group search and training crawlers under one switch. If yours does, turn it off and block training tokens in robots.txt instead.
- Add an explicit allow rule for the search crawlers you want, placed above generic bot rules, and keep rate limits on unknown automated traffic.
- Watch the logs. Filter access logs for the tokens in the table and look for
403,429and503. A crawler that only ever gets errors stops being a source.
Status codes matter for normal indexing too; if Google is also skipping pages, see why a page isn't indexed.
7 robots.txt Mistakes That Block AI Crawlers by Accident
Each of these removes AI crawlers from pages you meant to keep open, and none produces an error message.
1. A named group that drops the wildcard's rules
Covered in the steps above: a crawler with its own group ignores User-agent: * entirely. The reverse catches people too. If you add User-agent: OAI-SearchBot / Allow: / to give it access, it also stops obeying the Disallow: /admin/ lines you wrote under *. Repeat any rule a named group should keep.
2. Blocking a search bot while aiming at training
The classic version blocks GPTBot, OAI-SearchBot and ChatGPT-User together. The 2026 version blocks ClaudeBot believing it's Claude's search crawler, or adds Claude-SearchBot to a "no training" list. Match each token to its documented purpose before adding it.
# Blocks training only
User-agent: GPTBot
User-agent: ClaudeBot
User-agent: Google-Extended
Disallow: /3. Prefix collisions from a missing trailing slash
Rules match prefixes. Disallow: /blog blocks /blog, /blog/, /blog-archive and /blogging-tips. Write Disallow: /blog/ to block only the folder, or Disallow: /blog$ for the single URL.
4. Path case that doesn't match your URLs
User-agent tokens are case-insensitive; paths are case-sensitive. Disallow: /Docs/ does nothing to /docs/, and an Allow: /Pricing won't open /pricing. Copy paths from real URLs, not from memory.
5. A robots.txt that answers with a server error
RFC 9309 says a 5xx robots.txt means "complete disallow". Google stops crawling for 12 hours, then uses its last cached copy for up to 30 days. A misconfigured edge function or an origin outage on /robots.txt alone can switch off every compliant crawler at once. The script above flags it.
6. Forgetting subdomains
Rules on www.example.com/robots.txt don't cover docs.example.com or help.example.com. Each host serves its own file, and a forgotten staging-era Disallow: / on the docs subdomain blocks the pages AI engines quote most.
7. Disallowing the files you want AI tools to read
A broad rule such as Disallow: /*.txt$ or Disallow: /*.md$ also blocks /llms.txt and the Markdown versions it links to. If you publish an llms.txt file, check its path with the script too. A Sitemap: line costs nothing and helps compliant crawlers find the rest.
How BugViso Checks AI Crawler Access Automatically
BugViso's AI Search Readiness engine evaluates your live robots.txt for each known AI crawler with RFC 9309 matching, labels each as a training or search bot, and reports which can fetch your pages. It's the same logic as the script above, run as part of a full site scan.
It also requests the page with GPTBot, OAI-SearchBot, ClaudeBot and PerplexityBot user agents and flags a 403, 401, 429 or challenge response as an edge block, so the firewall layer is checked alongside the file. Those results feed a 0–100 GEO citability score together with llms.txt validation, extractability, E-E-A-T signals and indexability, with ranked fixes in the report and PDF.
The full list of checks is on the AI search readiness feature page.
Frequently Asked Questions
How do I know if my site blocks AI crawlers?
Find the robots.txt group for each AI user agent and apply the longest matching rule to your key paths, then request a page with that user agent from outside your network. A 200 means access; a 403, 429 or challenge page means your CDN or firewall blocks it. The script in this guide does both for six bots.
What is the difference between GPTBot and ChatGPT-User?
GPTBot crawls content for training OpenAI's models. ChatGPT-User fetches a specific page when a user's request needs it, and OpenAI notes robots.txt rules may not apply to it. ChatGPT search itself depends on a third bot, OAI-SearchBot.
Does blocking Google-Extended stop Googlebot or AI Overviews?
No. Google-Extended has no user agent of its own and doesn't affect inclusion in Google Search. AI Overviews come from Googlebot's index, so blocking Google-Extended leaves them alone.
Does a Disallow rule remove pages from AI search?
It stops compliant crawlers from fetching the page, which isn't the same as removal. OpenAI says pages opted out of OAI-SearchBot aren't shown in ChatGPT search answers but can still appear as navigational links. In Google, a disallowed URL can stay indexed without its content; use noindex on a crawlable page to remove it.
Are robots.txt rules case-sensitive?
Paths are, user-agent tokens aren't. User-agent: gptbot matches GPTBot, but Disallow: /Blog/ doesn't match /blog/.
What happens if I have no robots.txt file?
A 404 means crawlers may fetch everything, training crawlers included. A 5xx is the dangerous case: crawlers must treat the whole site as disallowed until it recovers.
How do I know if Perplexity is crawling my site?
Search your access logs for PerplexityBot and Perplexity-User, check the status codes they received, and confirm the source IPs against the ranges Perplexity publishes. Perplexity says Perplexity-User generally ignores robots.txt because a person triggered the fetch.
Check the Two Layers on Your Money Pages Today
Run the script on your homepage, pricing page and top documentation page. If any search crawler shows DISALLOW, fix the group; if it shows a 403, fix the edge. Then keep it checked: a BugViso scan repeats both tests every time you audit.
Written by
Kazi Khalid Hasan Tamim · BugViso Team
Kazi writes BugViso’s guides on website audits, Core Web Vitals, technical SEO, accessibility and AI search. The data in them comes from audits BugViso runs in a real Chromium browser, including our 219-site study of website health.
Summarise with AI
Open this guide in your assistant.
Follow BugViso
New guides and audit data as we publish them.
AI visibility tracker
Is your brand in AI answers?
See how often AI assistants mention you, cite your site and rank you against your competitors.
- ChatGPT
- Gemini
- Perplexity
- Claude
- AI Overviews
See where your site stands
Run a free BugViso audit for SEO, speed, accessibility and AI search readiness — with fixes you can ship today.