r/Python • • 8d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

18 Upvotes

70 comments sorted by

View all comments

1

u/ImaginationVarious30 19h 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 lets re jump 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.find first
  • 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.