Keys and incidents

Bots posing as AI crawlers are asking for your .env file

Scanners are requesting /.env, /.git/config and /.aws/credentials from websites while calling themselves ClaudeBot, GPTBot or Googlebot. The name proves nothing. What matters is whether your site answers, and an app built with AI tools can answer without its founder knowing. Check your own site with the command below, then make sure nothing in your code lets a bot skip a control because of its name.

TL;DR

  • GreyNoise reported on 28 August 2026 that one scanner fingerprint, using six AI crawler names, requested credential files from 824 addresses on 795 networks (28 July to 23 August). None of the addresses were on the crawlers’ published lists.
  • Paths requested include /.env, /.env.production, /.env.bak, /api/.env, /.git/config and /.aws/credentials.
  • AI-built apps serve these files when the repo root is published, a .env sits in public/, or a Vite dev server is left open to the internet.
  • A 200 response isn’t proof: single-page apps answer every path with the home page. Look at what came back.
  • Never let a user agent grant access. Check the address against the crawler owner’s published list.

This guide is for founders whose app is live on its own domain, built with Lovable, Bolt, Replit, Cursor, Claude Code or similar. The facts about the scanning come from GreyNoise’s report (28 August 2026). GreyNoise saw requests only. It says nothing shows a file was returned or that any organisation was affected, and it doesn’t say who is behind the scanning.

What GreyNoise saw

QuestionGreyNoise’s answer
Names used13 AI crawler names from eight companies. Six of them, belonging to Anthropic, OpenAI, Google and Perplexity, arrived on one HTTP client fingerprint in matched volume.
How many824 addresses across 795 separate /24 networks, so blocking by network doesn’t work. Requests for credential paths on that fingerprint ran into the millions.
When28 July to 23 August 2026, mostly in August. The biggest day was 23 August.
What they asked for/.env, /.env.local, /.env.production, /.env.old, /.env.bak, /.env.swp, /app/.env, /api/.env, /backend/.env, /.aws/credentials, /.git/config, plus private keys and password stores.
How they knew it was fakeNone of the 824 addresses were on the lists Anthropic, OpenAI, Google, Perplexity and Amazon publish. The fake crawlers never asked for /robots.txt. The real ClaudeBot asked for it more than any other path and never asked for a credential file.

How an AI-built app ends up serving its .env

A well-built app never has a .env file in the folder the web server hands out. It usually gets there in one of four ways:

  1. The whole repo is published. The host’s publish directory is set to the project root (.) instead of the build output (dist, build, out), or the repo was cloned straight into a server’s web root. Every file is then a URL, including .env and the .git folder, which holds the full history.
  2. A .env file in public/. Vite and Next.js copy everything in public/ into the site unchanged. A .env placed there to “make the variables load” is public the moment you deploy.
  3. The dev server is the live site. vite or npm run dev started on a server with --host, instead of building and serving dist/. The dev server is not made to face the internet: Vite versions before 6.2.3, 6.1.2, 6.0.12, 5.4.15 and 4.5.10 let anyone read files outside the allowed list (CVE-2025-30208), and GreyNoise lists the upgrade in its advice.
  4. The secret is already in the bundle. A key in a VITE_ or NEXT_PUBLIC_ variable is copied into the JavaScript every visitor downloads. No one needs /.env to get it (finding PL-010).

Check your own site

Run this against a site you own. It asks for the same paths the scanners did and prints the status, the content type and the start of what came back, with anything after an = hidden so a real key doesn’t land in your terminal history.

terminal
site=https://yourapp.com
for p in /.env /.env.local /.env.production /.env.bak /app/.env /api/.env /backend/.env /.git/config /.aws/credentials; do
  printf '%-20s ' "$p"
  curl -s -m 10 -o /tmp/pl-body -w '%{http_code} %{content_type}  ' "$site$p"
  head -c 300 /tmp/pl-body | sed 's/=.*/=…/' | tr '\n' ' ' | cut -c1-70; echo
done
rm -f /tmp/pl-body
What you seeWhat it means
404 or 403Not served. Good.
200 text/html and <!doctype html>Your host sends the home page for every unknown path, which single-page apps do. Not a leak, but it means a 200 alone tells you nothing.
200 and lines like OPENAI_API_KEY=…Your environment file is public. Go to if a file came back now.
200 and [core] or [remote "origin"]Your .git folder is public. Anyone can download the full history, including keys you deleted long ago (finding PL-011).
200 and [default] with aws_access_key_idCloud credentials are public. Treat the AWS account as compromised.

If a file came back

  1. Rotate first, then fix. Assume every key in the file was copied. Issue new keys and revoke the old ones, AI provider and payment keys first (where to rotate each kind of key). Removing the file doesn’t un-copy it.
  2. Stop serving it. Point the host’s publish directory at the build output, delete any .env from public/, and serve vite build output instead of the dev server. If you run your own nginx, refuse every dotfile except .well-known:
nginx
location ~ /\.(?!well-known/) {
    return 404;
}
  1. Look for use you didn’t make. Check each provider’s usage page and your server logs for requests to these paths that got a 200, and keep a dated note of what you found and what you rotated (the first hour after a leak).

Never let a bot’s name unlock anything

A user agent is a line of text the caller writes. Apps built for AI search sometimes let anything calling itself GPTBot, ClaudeBot or Googlebot skip a login wall, a paywall, a rate limit or bot protection, so the crawler can read the page. Anyone can send that name. Search your code for it:

terminal
grep -rniE "gptbot|claudebot|claude-user|perplexitybot|googlebot|google-extended|bingbot" --exclude-dir=node_modules --exclude-dir=.git .

If a match changes what the request is allowed to do, either serve the same public page to everyone, or check the connecting address against the list the crawler’s owner publishes (Google explains how; OpenAI and Anthropic publish their crawler addresses too). GreyNoise found requests named ClaudeBot coming both from Anthropic’s published ranges and from impostors, so the name alone can’t tell them apart.

Sources

The checks behind this guide, each with example code, a self-check and the fix.

Free check

Are any of these keys also in your code?

Paste code, a .env or your built JavaScript bundle into the free key check. It runs in your browser: no request is sent and nothing is stored. It flags secret keys (AI providers, Stripe, AWS, GitHub, database URLs), tells a Supabase anon key from a service role key, and links to where to rotate each one.

Open the free key check

Free, no sign-upNothing leaves your browserSee a sample result

Written by Manraj Singh Dhillon. Last checked 12 Nov 2026. Code samples are synthetic and run against your own project; nothing here names a real app. Spotted a mistake? Tell us.