How to detect AI crawlers without guessing
· Edited by Chris Dolan
AI crawler detection is the practice of identifying automated AI traffic by checking the claimed user agent against the source IP, published crawler ranges, DNS, headers, tokens, and behavior, then applying an allow, block, challenge, or licensing rule. No single signal proves a crawler is authentic, so reliable detection combines identity checks with enforcement.
AI crawler user agents are self-declared identities
AI crawler user agents are the self-declared User-Agent strings that automated clients send so a server can label them; common examples include GPTBot, OAI-SearchBot, ChatGPT-User, PerplexityBot, ClaudeBot and Google-Extended. A user agent is a claim, not proof of identity, because any client can copy a string. Detection therefore starts with the claimed user agent and then verifies it against source IP ranges, DNS, tokens, headers and request behavior.
Published range lists are the reliable source for AI crawler IP addresses
A static list of common IP address ranges for major AI crawlers would be stale and unsafe, so the usable range list is each operator's current machine-readable file. Production detection needs a scheduled fetch that replaces the local list when the operator file changes, plus a log entry when a request matches or misses the list. Operator | Published range source | Notes Google | common-crawlers.json, special-crawlers.json, user-triggered-fetchers.json | User-triggered fetchers can resolve to gae.googleusercontent.com hostnames. Microsoft Bing | bingbot.json | Compare against the current file. Apple | applebot.json | Apple also documents reverse DNS in the applebot.apple.com domain. OpenAI | gptbot.json, searchbot.json, chatgpt-user.json, adsbot.json | OpenAI documents IP lists, not a reverse-DNS method for these crawlers. Perplexity | perplexitybot.json, perplexity-user.json | Compare against the current files. Anthropic | bots.json | Compare against the current source-address list.
Robots.txt directives for AI crawlers differ from search crawler directives
Robots.txt directives for AI crawlers and search crawlers are not interchangeable: a rule aimed at Googlebot does not automatically control GPTBot or Google-Extended, and a rule aimed at an AI token does not control Google Search crawling. Use robots.txt to state policy, then enforce the policy with server-side checks where compliance matters. Scenario | robots.txt pattern | Search-crawler effect | AI-crawler effect Block all | User-agent: * followed by Disallow: / | Search crawlers are told not to crawl; pages may drop from results | AI crawlers are told not to crawl only if they honor robots.txt Allow search, block training | User-agent: Googlebot followed by Allow: /; User-agent: GPTBot followed by Disallow: /; User-agent: Google-Extended followed by Disallow: / | Googlebot can crawl for Search | GPTBot training access is denied if honored; Google-Extended is a separate Google token, not Googlebot Allow AI search, block training | User-agent: OAI-SearchBot followed by Allow: /; User-agent: GPTBot followed by Disallow: / | Search crawling is unaffected by the OAI-SearchBot rule | AI search or indexing can be allowed while training access is denied if honored User-triggered fetch | User-agent: ChatGPT-User followed by Disallow: / | Search crawling is unaffected | OpenAI's crawler documentation says robots.txt rules may not apply to ChatGPT-User because its fetches are started by a person
Server-side user-agent blocking is a first filter, not proof
Server-side user-agent blocking in a Node.js Express application can reject self-identified AI crawlers before content is served, but it is only a first filter because user agents are easy to spoof. The sample returns a licensing message, and Cloudflare's AI Crawl Control documentation notes that the block response can be configured to tell an AI crawler how to license content (Cloudflare Docs, Manage AI crawlers · Cloudflare AI Crawl Control docs, https://developers.cloudflare.com/ai-crawl-control/features/manage-ai-crawlers/). const AI_CRAWLER_UA = [ /GPTBot/i, /OAI-SearchBot/i, /ChatGPT-User/i, /PerplexityBot/i, /ClaudeBot/i, /Google-Extended/i ]; app.use((req, res, next) => { const ua = req.get('user-agent') || ''; if (AI_CRAWLER_UA.some((pattern) => pattern.test(ua))) { res.status(403).type('text/plain').send('AI crawler access is not permitted without a license. Licensing contact: YOUR_LICENSING_CONTACT'); return; } next(); });
Token-based access control gives known crawlers a revocable credential
Token-based access control gives a known crawler operator a revocable credential, such as a signed value in an Authorization header or a custom header, and the server grants content only when the token is present, unexpired, in scope and correctly signed. A token should be bound to the operator identity, logged on every request, rotated on a schedule and revoked when the agreement ends. Token-based access control is stronger than user-agent matching because possession of the secret, not the declared string, determines access, but it works only when issuance and validation are handled properly.
DNS verification steps confirm whether a crawler is authentic
DNS verification of crawler authenticity uses the source IP from the connection, not a forwarded header, then confirms the operator's documented hostname pattern and a forward lookup that returns the same address. Google's Verify Googlebot documentation describes a reverse DNS lookup on the visiting IP address, a hostname ending in googlebot.com, google.com or googleusercontent.com, and a forward lookup that returns the same address (Google Search Central, Verify Googlebot, https://developers.google.com/search/docs/crawling-indexing/verifying-googlebot). Bingbot uses a hostname ending in search.msn.com and the same forward-confirmed reverse DNS pattern, while Apple identifies Applebot by reverse DNS in the applebot.apple.com domain or by CIDR prefixes in applebot.json. 1. Read the source IP from the TCP connection and exclude values that appear only in X-Forwarded-For or Forwarded unless a trusted proxy sets them. 2. Perform a reverse DNS lookup on the source IP. 3. Require the resulting hostname to end in the operator's documented domain, such as googlebot.com, google.com, googleusercontent.com, search.msn.com or applebot.apple.com. 4. Perform a forward DNS lookup on that hostname and compare the returned address to the original source IP. 5. Reject the request when either lookup fails or the addresses do not match. 6. For OpenAI, Perplexity and Anthropic, compare the source IP against the operator's published address files instead of requiring reverse DNS, because those operators publish IP lists and OpenAI documents no DNS method.
HTTP header signals and the request-response lifecycle
HTTP header signals can triage automated traffic, but headers alone do not authenticate a crawler; they tell a server which request deserves an IP, DNS, token or behavior check. The request-response lifecycle below shows where those checks belong, and robots.txt is a separate policy fetch rather than an authentication step. Header signal | What it may show | Why it is not proof User-Agent | claimed browser or crawler identity | self-declared and spoofable From | contact address for a bot | optional and rarely enforced Accept, Accept-Encoding | generic fetch capabilities | browsers and bots overlap Sec-Fetch-Site, Sec-Fetch-Mode | navigation versus subresource context | bots may omit them and browser behavior varies Referer | page that triggered the request | can be absent or spoofed Authorization, custom token header | presented access credential | only as strong as issuance and validation X-Forwarded-For, Forwarded | proxy chain | client-controlled unless a trusted proxy strips it Cookie | session state | bots may carry none and browsers may block Via, CDN headers | proxy or CDN path | infrastructure-specific, not identity Crawler or client -> DNS and TLS connection -> HTTP request: source IP, User-Agent, headers, optional token -> Edge, WAF or application checks: published IP range, reverse DNS, forward DNS, user agent, token, rate and behavior -> Decision: allow, block, challenge, or return a licensing response -> Response: 200 content, 403 denial, 429 rate limit, or licensing message -> Logs: source IP, verified identity, path, status, rule
Legal and ethical implications plus a site-owner checklist
Legal and ethical implications for content scraping depend on jurisdiction, contract, copyright, database rights, privacy law and licensing terms, and robots.txt is a policy signal rather than a complete legal permission system. Ethical crawling controls should identify bots, minimize load, honor opt-outs, rate-limit unidentified automation, provide a licensing contact and avoid disguising automated traffic. Cloudflare's AI Crawl Control documentation says a configured block response can open dialogue with the AI crawler owner and inform it how to license content (Cloudflare Docs, Manage AI crawlers · Cloudflare AI Crawl Control docs, https://developers.cloudflare.com/ai-crawl-control/features/manage-ai-crawlers/). Site-owner checklist for managing AI training access: - Decide policy separately for search indexing, AI training, AI search or indexing, and user-triggered fetches. - Publish robots.txt tokens for each crawler class and keep the rules explicit. - Verify claimed crawlers with source IP, published range lists, documented DNS methods and tokens. - Deploy server or WAF rules that return a clear block or licensing response. - Log verified identity, rule matched, path, status and timestamp; review logs for false positives. - Rate-limit unidentified automation and challenge suspicious sessions before serving content. - Fetch operator range files on a schedule and replace stale local lists. - Review terms, licensing and enforcement with legal counsel before scaling blocks. - Use crawler logs to see which evidence AI systems and search engines fetch; The Ranking Factory finds what AI search and Google are missing about a business, builds the evidence they look for, publishes it, and measures whether AI answers and search results cite the business.
Common questions
Can robots.txt alone block AI crawlers?
Robots.txt alone cannot enforce a block because a crawler must choose to honor it. Use robots.txt to state policy and combine it with server-side IP and DNS verification, WAF rules, tokens or rate limits when access must be controlled.
How can a site tell whether a GPTBot request is genuine?
A GPTBot user agent is only a claim, so compare the source IP from the connection against OpenAI's current gptbot.json list. OpenAI documents IP lists rather than a reverse-DNS method for GPTBot, so a hostname match is not the right test for that crawler.
Does blocking AI training crawlers affect Google Search rankings?
Blocking an AI training crawler such as GPTBot is separate from allowing Googlebot to crawl for Search. Google-Extended is a Google token separate from Googlebot and does not control Google Search crawling, so search access and AI training access need distinct rules.
What should a site owner do when an AI crawler ignores robots.txt?
Log the source IP, user agent, headers and paths, then compare the request against the operator's published IP lists and any documented DNS method. Apply server-side blocking, rate limits or token requirements, and return a response that states licensing terms so a legitimate operator has a path to contact the site owner.
References
- Declare your AIndependence: block AI bots, scrapers and crawlers with a single click — Cloudflare Blog
- Manage AI crawlers · Cloudflare AI Crawl Control docs — Cloudflare Docs
- Verify Googlebot — Google Search Central
The Ranking Factory — How to detect AI crawlers without guessing
Sources and supporting material
Further reading:
- Guide: automated search engine optimization
- Guide: ai search optimization for local businesses
- Guide: ai citation stats
- Guide: aeo checker
- Guide: Automated Tiered Link Building
- Guide: automated blog content pipeline
- Guide: ai gbp
- Guide: ai citations seo
More from The Ranking Factory
- AI bot detection
- Automated SEO campaigns managed service AI SEO campaign platform 2026
- Best solution to improve restaurant SEO for AI search UK
- Automated SEO campaigns services managed SEO automation agency 2026
- Rank Tracking API Integrations
- Bing rank position
- Beneifits of AI generative overviews SEO
- Local SEO Entity Stacking