# Spillcheck: Find Secrets Your AI Agent Leaked

> Your API keys end up in places you forget: old commits, the chat logs your AI agent saves, config files and terminal history. Spillcheck finds every one, tells you which to replace first and where, and writes the exact commands to wipe them from git history.

Spillcheck: Find Secrets Your AI Agent Leaked is a paid AI agent skill on Agensi by Karma Wangchuk, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $7 (one-time purchase)
- Creator: [Karma Wangchuk](https://www.agensi.io/creators/karma-wangchuk)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.2
- Last updated: 2026-12-03
- Security: scan passed (2026-12-03); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/spillcheck-find-secrets-your-ai-agent-leaked
- Tags: security, secrets, api-keys, git, git-history, ai-agents, mcp, pre-commit

## What it does

- Checks your project, every old commit on every branch, and the logs and settings files AI coding agents keep
- Shows each leaked key once, with every place it turned up, most dangerous first, and leaves test keys and
- Tells you where to cancel and replace each key: AWS, GitHub, Stripe, OpenAI, Anthropic and more
- Writes the commands to wipe keys from git history and the lines to clean from agent logs and shell history
- Adds a check that blocks the next key before it is committed (only if you say yes)

## Who it's for

- **Developers who code with an AI agent:** every key the agent pasted, printed or logged, and where it is now Try: "I pasted my GitHub token into Claude Code, find every place it ended up"
- **Maintainers about to make a repo public:** a short list of what to replace, plus the history-cleanup commands Try: "Scan this repo and its history before I make it public"
- **Teams adding MCP servers:** keys typed straight into `.mcp.json`, `~/.claude.json` or Cursor settings, found and moved to environment variables Try: "Check my MCP configs for pasted keys"
- **Anyone who just leaked a key:** what to do first for that provider Try: "I committed my .env, what do I do?"

## About this skill

Leaked keys rarely sit only in your code. You paste a token into an agent chat. The agent runs `cat .env` and the output is saved in its session log. You type a key into an MCP config. A `curl` with your token stays in your shell history. You delete a key from a file, but the old commit still has it, and it was already pushed.

Spillcheck looks in all of those places at once: the project, every commit on every branch, and the logs and settings of Claude Code, Codex, Cursor, Gemini CLI and Aider, plus your shell history. The same key found in five places is one line with five locations, not five alerts.

Each key gets a risk level. A real key that is in the repo now or in history you already pushed is CRITICAL. One that sits in an agent log, a config or shell history is HIGH or MEDIUM. Test keys, test fixtures, a local database password and Firebase browser keys are LOW and stay off the to-do list. Code such as `settings.api_key` is not reported at all.

You get a fix plan: a checklist of what to replace, the file each key was found in, and where to cancel it. It also has the git-filter-repo commands to drop leaked files and scrub values from history, a quicker route for keys that were never pushed, one cleanup line for each log and history file, and settings that keep your agent away from `.env` files. If you want, it also adds a check that blocks the next key before it is committed.

It never shows a full key, never sends anything anywhere, and never runs the risky commands itself. You read them and run them.

## Requires

- terminal
- Python 3.9+
- Optional: Git

## Known limitations

Detection uses 20 built-in patterns plus randomness checks, so unusual key formats can be missed. It is a checklist and scanner, not a security audit: a clean scan does not prove a key never leaked. It never rotates keys, rewrites git history or deletes logs itself; you run the commands it writes. Without a terminal or Python the agent can only read files (working tree only).

## Technical details

- 3 standalone Python 3 scripts, standard library only (no installs): `spillcheck.py` (scan + staged check), `fixplan.py` (fix plan), `install_guard.py` (pre-commit hook; keeps an existing hook as .bak; `--remove` undoes it).
- 20 detection rules: AWS key ID + secret, GitHub (classic + fine-grained), GitLab, Slack token + webhook, Stripe, Anthropic, OpenAI, Google, Hugging Face, npm, PyPI, SendGrid, Telegram, private keys, database URLs with passwords, JWTs, password assignments, .env-style lines; plus committed or staged .env files.
- Git history: `git log -p --all`, added lines only, first commit per secret, pushed or local-only.
- Agent home: `~/.claude` (project logs, file-history, settings), `~/.claude.json`, `~/.codex`, `~/.cursor`, `~/.gemini`, `~/.codeium`, Aider files, bash/zsh/fish/PowerShell/Python/psql history.
- Noise control: placeholders, test-mode keys, test/fixture paths, localhost database URLs, Firebase web keys and code references (`settings.api_key`, `var.x`) are kept off the rotation list; `spillcheck:allow` silences a line.
- Fix plan: AWS key ID + secret as one row, committed .env files and private keys dropped whole, one `sed` per history file (single pass), `$HOME` paths that work in bash and PowerShell.
- Output: `findings.json` (masked values, per-run salted fingerprints), `report.md`, `fix_plan.md`.
- Tested on a 38-commit, 4-branch repo plus a full fake agent home: 12 of 12 planted leaks found, no test data ranked above LOW, about 3 seconds.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Spillcheck: Find Secrets Your AI Agent Leaked skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### Is my data sent anywhere?

No. Everything runs on your computer with plain Python. Nothing is uploaded, no key is "tested" against an API, and the reports only hold masked values (first 4 and last 2 characters).

### Will it rewrite my git history or delete my logs?

No. It writes the commands into fix_plan.md. You read them and run them. The only thing it can install is the pre-commit check, and only after you say yes.

### Why look at agent logs?

Agents save full session logs on disk. If you paste a token into the chat, or the agent runs `cat .env`, the key now lives in a file under `~/.claude`, `~/.codex` or `~/.gemini`, which backups, sync tools and "share this session" features can copy.

### Will it flood me with false alarms?

It tries hard not to. Test keys, passwords in test files, local database URLs, Firebase browser keys and example values are marked LOW or INFO and kept off the to-do list, and code like `settings.api_key` is ignored. Anything else you know is safe: add a `spillcheck:allow` comment on that line.

### Does deleting the key from history fix the leak?

No. Anyone who cloned or scraped it keeps it. Replace the key first; history cleanup only stops future copies.

### Is this a security audit or legal advice?

No. It is a checklist and scanner. A clean scan does not prove a key never leaked.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
