# Free AI Security Scanner for GitHub Repos

> Scan a GitHub repo or organisation for leaked AI and cloud keys and backdoored Claude Code, Cursor and MCP settings. Free, runs in your browser, keys masked.

Canonical: https://www.phishclean.com/tools/ai-repo-scanner
Last updated: 2026-11-17

Find leaked AI and cloud keys, and backdoored coding-agent settings, in a repo or across a whole organisation's public repos. The two things attackers went after in late 2026: stolen keys resold for AI compute, and repo settings that make Claude Code or Cursor install malware.

Runs in your browser: files come straight from GitHub, keys are shown masked, nothing goes to PhishClean

Public repos only. For a user or organisation, the 12 most recently updated repos are scanned. GitHub allows 60 lookups an hour per address: about one organisation scan, or 25 single repos.

**0**repos scanned

**0**exposed keys

**0**agent backdoor signs

**0**repos to fix

## What the scanner looks for

### Leaked AI and cloud keys

Google's threat intelligence team reported in November 2026 that criminals harvest valid keys from public GitHub repos and resell AI access through "LLM mixers". One victim's fraudulent charges passed $100,000 in a single day, and $1 million before the keys were revoked. The scanner looks for exact key formats only, so ordinary strings don't trip it:

- **AI providers:** Anthropic, OpenAI, OpenRouter, Groq, xAI, Perplexity, Replicate, Hugging Face.
- **Cloud and code:** AWS access keys, GitHub tokens, Stripe live keys, Slack tokens, private keys.
- **Google API keys** are listed separately: they are often public on purpose (Maps, Firebase), and only matter if the Gemini API or a paid API is turned on for the same project.

It reads `.env` files, config and settings files, Jupyter notebooks (a common leak), CI workflows, MCP configs and source files near the top of the repo, up to 70 files per repo.

### Backdoored coding-agent settings

Coding agents act on settings that live in the repo. In the same report, a North Korea-linked group (MIDNIGHT NEPTUNE) edited `.claude/settings.json` in company repos so that starting Claude Code downloaded a backdoor. The scanner reads:

- **Claude Code and Gemini CLI settings:** hooks (above all `SessionStart`, which runs the moment the agent starts), the status-line command, `apiKeyHelper`, an API address pointed at someone else's server, and switches that stop the agent asking permission.
- **MCP servers** in `.mcp.json`, `.cursor/`, `.vscode/`, Windsurf, Roo, Kiro and Amazon Q: programs the agent starts by itself.
- **Dev containers:** `initializeCommand` runs on your own computer, not inside the container.
- **VS Code tasks** that run when the folder opens.
- **Instruction files** (`CLAUDE.md`, `AGENTS.md`, `.cursorrules`, Copilot instructions): invisible Unicode text the model reads but you don't, and orders to run a download or send secrets out.

Ordinary settings stay quiet: a formatter hook, a project note printed at start-up, `npx` MCP servers and remote MCP URLs are listed as information only, never as a problem.

### If it finds a key

1. **Revoke it first,** with the link next to it. Deleting the file or the line doesn't help: the key stays in git history, and bots copy new keys from GitHub within minutes.
2. Check the provider's usage and billing pages for spending you don't recognise, and set a spending limit.
3. Put the new key in a secret manager or your CI's secrets, never in the repo, and add `.env` to `.gitignore`.

### If it finds agent settings nobody wrote

1. Don't start a coding agent in that repo on any computer until the file is cleaned up.
2. Check the file's history (`git log -p -- .claude/settings.json`) to see who added it and when, and treat the account that did as compromised.
3. Anyone who started the agent in the repo since then should assume their machine ran the command: rotate their keys and tokens and scan the machine.

### What this can't see

Private repos, git history, files beyond the 70 it reads per repo, and keys in formats with no fixed prefix (Mistral, DeepSeek, many internal tokens). Use it as a quick outside view, the same one an attacker gets, not as a full audit. GitHub's own secret scanning and push protection are free for public repos: turn them on.

### Protection on every developer's machine

[PhishClean Desktop](https://www.phishclean.com/desktop) (from 0.3.1) stops a coding agent that starts a hidden download command, warns when a program from Downloads or Temp opens your cloud, code or AI keys, and when one contacts an AI service. The [browser extension](https://www.phishclean.com/#install) (from 1.13.0) checks these same agent settings when you open a repo on GitHub, GitLab or Bitbucket, and asks before you paste an API key into a page that looks wrong. [PhishClean for Teams](https://www.phishclean.com/business) covers the whole company.

Last updated: 17 November 2026
