leakscan
Find leaked AI API keys, Claude Code session links and committed .env files in a repo and its entire git history. Then rotate the right thing.
pipx install git+https://github.com/genzagents/leakscan leakscan . # this repo: working tree + every commit on every branch leakscan github YOUR_USERNAME # every public repo you own
Zero dependencies, one Python file, nothing leaves your machine. Source and README.
Paste and check
A diff, a log, a .env, a commit message. Runs in your browser with the same patterns as the CLI. Nothing is uploaded.
Why
In one week of October 2026 the Railway breach went straight for customers' stored AI API keys, and Claude Code began putting https://claude.ai/code/… session links into commit messages. A session made public exposes everything it showed, including env vars. Generic scanners know AWS and Stripe. Most do not know OpenRouter, Groq, Replicate, Perplexity, xAI, Hugging Face or agent session links, and almost none tell you where to go to rotate. Deleting a key in a new commit does not remove it from GitHub, so this one reads the whole history.
What it finds
| Thing | Rotate at |
|---|---|
| Anthropic, OpenAI (project, service account, admin, legacy), OpenRouter, Groq, Replicate, Hugging Face, Perplexity, xAI, Fireworks, Google AI Studio, ElevenLabs, DeepSeek | the provider's key page, linked in the output |
| Together, Mistral, Cohere, Voyage, Cerebras, LangSmith, Pinecone, Tavily, Exa, Deepgram, Stability and more | matched by variable name plus a real-looking value |
| Claude Code session links in commit messages and files | open the session, make it private or delete it |
.env files ever committed, even if since deleted | rotate everything inside, purge from history |
| AWS access keys, GitHub tokens, Stripe live keys, Slack tokens, Supabase service_role JWTs, Resend, Railway tokens, private key blocks | linked in the output |
Watch your repos
Free and self-hosted: copy one workflow file into a repo. It fails the build when a key appears and re-scans every Monday. Set OWNER and it scans every public repo you own.