Work / CS-16
Keeping secrets out of AI coding tools
- Year
- 2026
- Type
- Personal project
- Themes
- AI, Security, Personal
- Stack
- TypeScript (Bun), Go
Result, up front
- 6structured scanners plus an entropy check
- 2implementations: TypeScript (Bun), then Go
Situation
AI coding agents read files and command output, which can include API keys and tokens.
What I did
- Built clasp, a redaction layer that finds secrets before they reach the model:
- an entropy check (flags random-looking strings like keys and tokens)
- six structured scanners: JWTs, credentials in URLs, Bearer tokens, PEM keys and two key-value formats
- a per-session map so the same secret is redacted consistently and restored where it’s needed
- live redaction stats in the status line
- Then rewrote the idea as claude-secure, a single Go binary that does detection fully locally.
What I took away
Using AI safely is an engineering problem you can solve with code, not just a policy.