Fake ClaudeBot scanners: check your site for exposed keys
The short version
Scanners are calling themselves ClaudeBot and GPTBot and asking websites for /.env and for the exact files where Claude Code, Cursor and Codex keep their keys. The real crawlers never do this. Tin, a team that watched it on ten of their own sites from late September to 18 November 2026, saw one scanner ask for about 300 secret files in about ten seconds under 32 AI crawler names, all from one machine.
The fix is not a bot-name block list. It is to make sure those files return 404, and to block every path that starts with a dot (except /.well-known/). This page is the check, the path list and the block rules.
| What you see | What it means | What to do |
|---|---|---|
| A request for /.env from "ClaudeBot" or "GPTBot" | A scanner wearing a crawler name | Make sure /.env returns 404 |
| 404 on every path below | Nothing is exposed | Add the dot-path block anyway |
| 200 with the home page | A single-page app answering every path | Harmless; check the body to be sure |
| 200 with real keys | Keys are public | Rotate them now |
Copy these prompts
Paste them into Claude Code (or any assistant that can see your project).
1. Find secret files that would be served
Look at my project's public output folders (public, dist, out, build). List every file or folder whose name starts with a dot, and every .env, .git, .claude, .cursor, .codex or .aws path. Tell me which ones a web server would serve and how to stop that.
2. Write the block rule for my host
My site runs on <Cloudflare / nginx / Vercel / Netlify>. Write the rule that returns 404 for every path starting with a dot except /.well-known/, and tell me how to test it with curl.
3. Check my ignore files
Check my .gitignore and deploy ignore files. Make sure .env*, .claude/settings.local.json, .claude/.credentials.json and .codex/ are ignored and were never committed. Tell me if any of them appear in git history.
The check
Run this against your own site. You want 404:
curl -s -o /dev/null -w '%{http_code}' https://yoursite.com/.env
Then loop over the seven paths that should all return 404:
for p in /.env /.env.production /.git/config /.claude/settings.local.json /.cursor/mcp.json /.codex/auth.json /.aws/credentials; do
echo "$p $(curl -s -o /dev/null -w '%{http_code}' https://yoursite.com$p)"
done
How to read a 200: open the response. Many single-page apps answer every path with the home page, which is harmless. A real file with keys is not, and you must rotate those keys.
Why they ask for two missing pages first
Each visit starts with a canary path, then two random paths that always get a 404, then the secret files. Tin's reading (their inference) is that the scanner learns what your site sends for a missing page, so it can tell a real .env from a page that says "not found" with a 200.
The block rules
Block requests for paths that start with a dot and keep /.well-known/ (it is used for things like certificate checks). Tin's rule stops the requests for .env, .git and agent config files.
Cloudflare (custom rule, action Block or a 404 response):
starts_with(http.request.uri.path, "/.") and not starts_with(http.request.uri.path, "/.well-known/")
nginx:
location ~ /\.(?!well-known/) { return 404; }
Blocking helps a little. Not having the files helps a lot.
If you are building
- Run
find public dist out -name '.*'before every deploy and delete what should not be public. - Add these to .gitignore:
.claude/settings.local.json,.claude/.credentials.json,.codex/,.env*. - Do not block AI crawler names to stop these scanners. You will block real crawlers too, and the scanners will pick other names.
If you got a 200 with real keys
- Rotate the exposed keys first (Anthropic, OpenAI, cloud, anything in that file). Scanners use keys within seconds, so rotate anything that was ever public.
- Remove the file from the public folder and redeploy.
- Check your provider's usage page for calls you did not make.
- Add the dot-path block above and run the check again.
Run this on your codebase
Audit this project for secrets that could be served publicly: list dotfiles in public output folders, check .gitignore for .env*, .claude, .codex and .cursor files, and give me the exact curl commands to test each path against my live site.