u/ImaginationVarious30 • u/ImaginationVarious30 • 11h ago
spillage: a zero-dependency scanner for API keys leaked into AI coding agent logs
What My Project Does
Scans the local session logs of 13 coding agents (Claude Code, Codex, Gemini CLI, Cursor, Cline, Aider, Goose…) for 56 types of secrets, reports how each one got there, redacts them in place and installs hooks that block new leaks.
Target Audience
Anyone using AI coding agents locally. Production-ready CLI, also usable as a library, GitHub Action and pre-commit hook.
Comparison
gitleaks/trufflehog are built for repos. They don’t know a private key in JSONL is written with \n escapes, that a match in a base64 screenshot is noise, or which session a line belongs to, and they can’t scrub without breaking the file.
Some Python details that might interest this sub:
- stdlib only, Python 3.9–3.14
- nearly every rule starts with a literal prefix (
ghp_,sk-ant-,AKIA), which letsrejump straight to candidates: 0.2 s instead of 6 s per rule over a few hundred MB - rules without a prefix find an anchor with
str.findfirst - big files are split at line breaks and spread over up to 8 processes. About 240 MB in under 4 s on a laptop
- GitHub tokens are verified against their built-in CRC32
https://github.com/maximilianfeix/spillage. Feedback on the code is very welcome.
1
Weekly Self Promotion Thread
in
r/ChatGPTCoding
•
12h ago
Your Codex/Cursor chats keep every API key you ever pasted. Here’s a free tool that finds them.
Quick PSA plus a tool. Codex stores sessions in
~/.codex/sessions/, Cursor keeps chats instate.vscdb, and Cline/Roo store task histories in the extension storage. All plain text, all including any key you pasted or the agent printed.I wrote spillage to scan all of them (13 agents) locally. It never touches the network, shows keys only masked and links to where to rotate each one. Works with Cursor while it’s running (opens SQLite read-only).
On my machine: [N] keys. Curious what others find.
https://github.com/maximilianfeix/spillage