LLM Cloaking Worker
Show different content to ChatGPT, Claude, and Perplexity than you show to humans and Google. A user-agent gated content switch that runs at the Cloudflare edge.
What it does, in one line
A Cloudflare Worker sits in front of your site, reads the User-Agent header on every request, and routes LLM crawlers down a different path than humans and search engines.
The request flow
- 1
Request hits Cloudflare edge
Browser, bot, or LLM crawler issues a GET. Cloudflare routes it to the Worker before it touches your origin.
- 2
Worker reads the User-Agent
Pattern matches against the LLM crawler block list. Real browsers, Googlebot, and Bingbot pass through untouched.
- 3
One of two modes fires for LLM UAs
protect returns 404 for protected JS bundles, leaving the bot with an empty HTML shell. translate rewrites the URL to a markdown twin and serves that instead.
- 4
Humans and Google see full content
Normal users render the full app. SEO ranking is unaffected because real Googlebot is allow-listed and gets the canonical HTML.
Two modes
protect
Returns 404 for protected JavaScript bundles when the requester is an LLM crawler. The bot gets the empty HTML container and nothing else. About 69 percent of LLM crawlers cannot execute JavaScript, so they leave with no content.
Best for: proprietary content gated behind client-rendered JS. Audits, dashboards, datasets, paid frameworks.
translate
Rewrites the request to fetch a markdown twin of the page (for example, /about.md instead of /about) and serves that to LLMs. They still get content, but only the version you wrote.
Best for: public content you want cited in AI Overviews and ChatGPT search, with a curated summary and roughly 80 percent lower token cost.
User-agent rules
Block these
LLM crawlers. Refresh monthly against the https://github.com/ai-robots-txt/ai.robots.txt list.
GPTBotChatGPT-UserOAI-SearchBotClaudeBotanthropic-aiClaude-WebPerplexityBotPerplexity-UserCCBotBytespiderMeta-ExternalAgentGoogle-ExtendedApplebot-ExtendedAmazonbotcohere-ai
Never block these
Real search engines. Blocking them tanks rankings. Note thatGoogle-Extended and Applebot-Extended are the AI-training agents, not the search bots, and are safe to block.
GooglebotGooglebot-ImageGooglebot-NewsBingbot
When to use
Use it for
- Proprietary content being harvested by LLM crawlers
- Audits, datasets, frameworks, surveys, benchmarks
- Pages where you want a controlled markdown summary cited
- Sites already behind Cloudflare
Do not use it for
- Top-of-funnel SEO content that needs AI citation
- Sites not behind Cloudflare
- Public marketing pages you want LLMs to amplify
- Blocking real search engines, ever
Quick start
- 1. Run the
llm-cloaking-workerskill in Claude Code. It generates a wrangler project. - 2. Drop in the included
worker-template.tsand pick a mode (protect, translate, or both). - 3. Set the route in
wrangler.tomlto your Cloudflare-fronted domain. - 4. Deploy with
npx wrangler deploy. - 5. Validate with the included curl harness in
test/harness.mjsspoofing GPTBot vs a regular browser UA.