How CDNs, Firewalls, and WAFs Can Block AI Search Crawlers
AI crawler firewall configuration is the step most AEO projects skip. A company updates robots.txt to welcome AI search crawlers, then wonders why ChatGPT or Perplexity still cannot read its pages. The answer often sits one layer down. A CDN, web application firewall (WAF) or rate limiter blocks the crawler before robots.txt ever matters.
This guide explains how CDNs and WAFs treat automated traffic, how to read 403, 429 and 503 errors, how Cloudflare’s AI controls work and how to verify real crawlers. It ends with a tested access script and a firewall checklist.
How do CDNs and web application firewalls handle automated traffic?
Short answer: CDNs and WAFs score every request for signs of automation, then allow, challenge, rate limit or block it. Crawlers look automated by design, so they are easy to block by accident.
Most platforms combine several signals: the user agent, the IP address and its network, request rate, browser fingerprints and whether the client can run JavaScript challenges. Search and AI crawlers fail many of these checks. They do not run JavaScript challenges, and they send many requests from data center IPs.
That is why robots.txt alone is not enough. Robots.txt tells polite crawlers what they may fetch. The firewall decides whether a request reaches your server at all. Our guide to robots.txt for AI crawlers covers the first layer; this article covers the second.
How does bot management identify AI crawlers?
Short answer: Bot management tools keep lists of known crawlers and confirm them by IP range, reverse DNS or cryptographic signatures. Confirmed crawlers get a “verified” label that you can allow or block in rules.
Cloudflare, for example, runs a verified bots program and publishes the list in its Radar directory. It now also accepts bots that sign requests with Web Bot Auth, an IETF draft that uses HTTP message signatures. Other CDNs and WAFs offer similar “known bot” or “good bot” categories.
The practical lesson for AI crawler firewall configuration is simple. Write rules against verified bot labels, not raw user agent strings. A user agent can be copied by anyone, while a verified label means the platform checked the source.
How does AI crawler firewall configuration cause 403, 429 and 503 errors?
Short answer: A 403 usually means a firewall rule or bot setting refused the request. A 429 means a rate limit fired. A 503 can mean an overloaded server or a challenge page that a crawler cannot pass.
| Status | Common cause at the edge | What to check |
|---|---|---|
| 403 Forbidden | WAF rule, bot fight mode, AI bot block, country block | Firewall events filtered by user agent or bot category |
| 429 Too Many Requests | Rate limiting by IP or session | Rate limit rules and the Retry-After header |
| 503 Service Unavailable | Origin overload or an interstitial challenge | Origin health and challenge settings |
| 200 with a challenge page | JavaScript or CAPTCHA challenge served as content | Page body for challenge text, cf-mitigated header |
The last row is the trickiest. Some challenges return a 200 or 403 status with a “Just a moment” page. A crawler then indexes the challenge instead of your content. Always inspect the response body, not just the status code.
What should you know about Cloudflare’s AI crawler controls?
Short answer: Cloudflare now groups AI traffic into Search, Agent and Training behaviors, each with its own allow or block setting. Since September 15, 2026, new domains block Training and Agent bots on pages with ads by default, while Search stays allowed.
The controls live under Security settings, in the AI crawler and agent access policies. Options include blocking everywhere, blocking only on pages with ads, allowing, or sending a robots.txt disallow for training. Cloudflare documents the details in its AI bot policy guide.
Two details matter for AI crawler firewall configuration on Cloudflare:
- Mixed-purpose crawlers count as Training. A crawler used for both search and training is blocked by any setting that blocks training.
- Older settings still apply. Bot Fight Mode, custom WAF rules and rate limits can block a crawler even when the AI policy allows it.
Check every layer in order: AI policies, bot settings, custom rules, rate limits and any page rules that add challenges.
How do you handle IP verification and user agent spoofing?
Short answer: Trust a crawler only when its IP matches the vendor’s published ranges or the platform marks it as verified. Treat a matching user agent from an unknown IP as a possible impersonator.
OpenAI, Perplexity and other vendors publish their crawler IP ranges as JSON files. You can turn those files into an allowlist. This script builds an Nginx geo block from any number of published files:
#!/usr/bin/env python3
"""Turn published crawler IP range files into an Nginx geo allowlist.
Usage: python build_allowlist.py searchbot.json perplexitybot.json > ai_crawlers_geo.conf
Download the JSON files from each vendor first (for example
https://openai.com/searchbot.json and https://www.perplexity.com/perplexitybot.json).
"""
import ipaddress
import json
import sys
def networks(obj):
# Walk any JSON shape and keep values that parse as IP networks.
if isinstance(obj, dict):
for v in obj.values():
yield from networks(v)
elif isinstance(obj, list):
for v in obj:
yield from networks(v)
elif isinstance(obj, str):
try:
yield ipaddress.ip_network(obj, strict=False)
except ValueError:
pass
nets = set()
for path in sys.argv[1:]:
with open(path, encoding="utf-8") as f:
nets.update(networks(json.load(f)))
print("# Generated allowlist of verified AI crawler ranges. Rebuild it on a schedule.")
print("geo $verified_ai_crawler {")
print(" default 0;")
for net in sorted(nets, key=lambda n: (n.version, n)):
print(f" {net} 1;")
print("}")
Rebuild the list on a schedule, because vendors add ranges. For one-off checks, the verification script in our AI crawler log analysis guide tests a single IP.
How should AI crawler firewall configuration handle rate limiting?
Short answer: Rate limits protect your server, but crawlers fetch pages in bursts and often share IPs. Tight per-IP limits can turn a normal crawl into a stream of 429 errors.
In a sound AI crawler firewall configuration, a safer pattern is to exempt verified crawler IPs from general limits and give them their own, higher limit. In Nginx, the allowlist above can feed the rate limit key:
# Exempt verified AI crawler IPs from rate limiting (Nginx).
# ai_crawlers_geo.conf is generated by build_allowlist.py and defines $verified_ai_crawler.
include /etc/nginx/ai_crawlers_geo.conf;
map $verified_ai_crawler $limit_key {
1 ""; # empty key = not rate limited
default $binary_remote_addr;
}
limit_req_zone $limit_key zone=perip:10m rate=10r/s;
server {
location / {
limit_req zone=perip burst=20 nodelay;
limit_req_status 429;
}
}
On Cloudflare, use the verified bot field in your rate limiting rule to skip or relax limits for known crawlers, rather than matching user agent text.
How do you test AI crawler firewall configuration with cURL?
Short answer: Request the same URL with a browser user agent and with each AI crawler user agent, then compare status codes and headers. Any difference shows a rule that targets crawlers.
# Compare a browser request with an AI crawler user agent
curl -s -o /dev/null -w "browser: %{http_code}\n" \
-A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Chrome/131.0" https://www.example.com/pricing/
curl -s -o /dev/null -w "OAI-SearchBot: %{http_code}\n" \
-A "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; OAI-SearchBot/1.0; +https://openai.com/searchbot" \
https://www.example.com/pricing/
# Show the response headers that reveal a CDN block or challenge
curl -sI -A "PerplexityBot/1.0" https://www.example.com/pricing/ | grep -iE "^(HTTP|server|cf-|retry-after|x-cache)"
This Python script runs the same test for every major crawler and flags results that differ from the browser baseline:
#!/usr/bin/env python3
"""Test whether your CDN, WAF or server treats AI crawler user agents differently.
It requests each URL once per user agent and reports the status code, response
time, rate-limit hints and signs of a bot challenge page.
Limits: this only catches rules based on the User-Agent header. Real crawlers
also come from their own IP ranges, so IP-based or "verified bot" rules can
only be confirmed in your server or CDN logs.
Usage: python crawler_access_test.py https://www.example.com/ https://www.example.com/pricing/
"""
import sys
import time
import requests
USER_AGENTS = {
"Browser (baseline)": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 "
"(KHTML, like Gecko) Chrome/131.0 Safari/537.36",
"Googlebot": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
"Bingbot": "Mozilla/5.0 (compatible; bingbot/2.0; +http://www.bing.com/bingbot.htm)",
"OAI-SearchBot": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; "
"OAI-SearchBot/1.0; +https://openai.com/searchbot",
"GPTBot": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; "
"GPTBot/1.1; +https://openai.com/gptbot",
"ChatGPT-User": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; "
"ChatGPT-User/1.0; +https://openai.com/bot",
"Claude-SearchBot": "Mozilla/5.0 (compatible; Claude-SearchBot/1.0; +https://www.anthropic.com)",
"ClaudeBot": "Mozilla/5.0 (compatible; ClaudeBot/1.0; [email protected])",
"PerplexityBot": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; "
"PerplexityBot/1.0; +https://perplexity.ai/perplexitybot)",
}
CHALLENGE_MARKERS = ["just a moment", "cf-challenge", "captcha", "attention required",
"verify you are human", "access denied", "request blocked"]
def check(url, name, ua):
start = time.time()
try:
r = requests.get(url, headers={"User-Agent": ua}, timeout=20, allow_redirects=True)
except requests.RequestException as exc:
return {"bot": name, "status": "ERR", "ms": 0, "note": type(exc).__name__}
ms = int((time.time() - start) * 1000)
body = r.text[:5000].lower()
notes = []
if r.headers.get("cf-mitigated"):
notes.append(f"cf-mitigated={r.headers['cf-mitigated']}")
if r.headers.get("Retry-After"):
notes.append(f"Retry-After={r.headers['Retry-After']}")
if any(m in body for m in CHALLENGE_MARKERS):
notes.append("challenge or block page")
if r.history:
notes.append(f"redirects={len(r.history)}")
return {"bot": name, "status": r.status_code, "ms": ms, "note": ", ".join(notes)}
def main(urls):
problems = 0
for url in urls:
print(f"\n{url}")
baseline = None
for name, ua in USER_AGENTS.items():
res = check(url, name, ua)
if baseline is None:
baseline = res["status"]
flag = ""
if res["status"] != baseline or res["note"]:
flag = " <-- CHECK"
problems += 1
print(f" {res['bot']:<20}{str(res['status']):<6}{res['ms']:>6} ms {res['note']}{flag}")
print(f"\n{problems} result(s) differ from the browser baseline.")
return 1 if problems else 0
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))
We ran it against a test server configured with three common mistakes. It flagged all three:
https://www.example.com/pricing/
Browser (baseline) 200 2 ms
Googlebot 200 0 ms
Bingbot 200 0 ms
OAI-SearchBot 200 1 ms
GPTBot 403 0 ms challenge or block page <-- CHECK
ChatGPT-User 200 1 ms
Claude-SearchBot 200 0 ms
ClaudeBot 403 0 ms cf-mitigated=challenge, challenge or block page <-- CHECK
PerplexityBot 429 0 ms Retry-After=120 <-- CHECK
3 result(s) differ from the browser baseline.
Remember the limit of any outside test. It checks rules based on the user agent only. Rules based on IP reputation or verified status can only be confirmed in your CDN or server logs.
What should an AI crawler firewall configuration checklist include?
Short answer: Review AI policies, bot modes, custom rules, rate limits, challenges and logs, in that order. Then retest with the script and confirm real crawler traffic in your logs.
- Decide which crawlers you want: search, training and user-triggered fetchers.
- Set the CDN’s AI policy to match that decision.
- Check Bot Fight Mode or similar global bot settings.
- Review custom WAF rules for user agent, country or ASN blocks that catch crawlers.
- Exempt verified crawlers from aggressive rate limits.
- Make sure challenges never apply to verified search crawlers.
- Allowlist published IP ranges where you run your own firewall.
- Run the access script on key pages after every security change.
- Watch logs for 403, 429 and 503 responses to crawlers each week.
How do you balance cybersecurity with AI search discoverability?
Short answer: Keep strict protection on logins, forms, APIs and admin paths, and open public content to verified crawlers. Security and discoverability conflict only when rules apply to the whole site.
Most businesses need tight rules on a small part of the site and light rules on the rest. Scope your strongest protection to paths like /wp-admin/, /login/ and /api/. Then let verified search crawlers read your marketing pages, blog and documentation without challenges. For the related technical checks, see our technical AEO checklist.
Frequently asked questions about AI crawler firewall configuration
Can a firewall block AI crawlers even if robots.txt allows them?
Yes. Robots.txt only tells crawlers what they may fetch. A CDN or WAF can still refuse the request before it reaches your server.
Should I allowlist AI crawlers by user agent?
No. User agents are easy to fake. Allow verified bot categories or published IP ranges instead.
Does Cloudflare block AI crawlers by default?
It depends on your domain and settings. New domains block Training and Agent bots on pages with ads by default since September 15, 2026. Check your zone’s AI crawler policies.
How often should we review AI crawler firewall configuration?
After every security change, and at least once a quarter. Vendors add new crawlers and IP ranges often.
Why does a crawler get a 200 status but index the wrong text?
It probably received a challenge page instead of your content. Inspect the response body and headers, not just the status code.
Next step
Run the access script on your homepage, pricing page and top blog post today. If any crawler you want gets a different result than a browser, fix that rule first.
Want more practical guides on AI crawler firewall configuration? Browse the latest articles on the Blippu blog.