cd /news/ai-tools/cloudflare-captcha-on-at-least-one-a… · home topics ai-tools article
[ARTICLE · art-28783] src=simonwillison.net ↗ pub= topic=ai-tools verified=true sentiment=· neutral

Cloudflare CAPTCHA on at least one ampersand

Simon Willison configured Cloudflare's managed challenge to only trigger on search URLs containing an ampersand, preventing CAPTCHA prompts for simple queries. He used Claude Code to interact with the Cloudflare API after the Cloudflare MCP failed to edit the rules.

read1 min views1 publishedJun 16, 2026

TIL: Cloudflare CAPTCHA on at least one ampersand I'm using Cloudflare's CAPTCHA (they call it a "Web Application Firewall > Custom rules > Managed Challenge" these days) to prevent crawlers from aggresively spidering my faceted search engine on this site, but I got fed up of even simple ?q=term

searches triggering the challenge.

After some mucking around with Claude Code it turns out you can register the following rule instead, so the CAPTCHA only kicks in for search URLs containing at least one ampersand:

(http.request.uri.path wildcard r"/search/*" and http.request.uri.query contains "&")

And now /search/?q=lemur works without triggering a CAPTCHA! Also included: notes on trying out the Cloudflare MCP with Claude Code, though it turned out not to be able to edit the rules in question so I had Claude Code switch to the Cloudflare API instead.

Tags: captchas, cloudflare, model-context-protocol, claude-code

── more in #ai-tools 4 stories · sorted by recency
── more on @cloudflare 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/cloudflare-captcha-o…] indexed:0 read:1min 2026-06-16 ·