Scanners watch git.
Your keys live in chat.
gitleaks and trufflehog scan history. The transcript is the new leak surface — pastes, file reads, tool output. token-hunt hooks the agent runtime itself, at all six points a secret can enter.

01 Six hooks. Every entry point.
| hook | what it sees | action on leak |
|---|---|---|
UserPromptSubmit | your paste | WARN |
PreToolUse:Bash | command about to run | BLOCK |
PostToolUse:Bash | command output | WARN + log |
PostToolUse:Read | file contents | WARN + log |
PreToolUse:Edit/Write | new file content | BLOCK |
PostToolUse:Edit/Write | echo | WARN + log |
02 Catches what regex can't.
Bash evaluates secrets into emitted text with no literal in sight. token-hunt runs a runtime detector for the escape-hatch class — no other scanner sees it.
BLOCKED
echo ${ANTHROPIC_API_KEY:+SET}
${ANTHROPIC_API_KEY:-UNSET}both branches run — the value leaks
BLOCKED
echo $GITHUB_TOKENdirect echo of a secret var
ALLOWED
[ -n "$ANTHROPIC_API_KEY" ] \
&& echo SETstatus check — no value emitted
03 Three shapes. One hunt.
01token-huntfree · BUSL-1.1The engine. CLI (scan / list / close / watch), six hooks with block-and-rotate behavior, the allowlist, and the bash escape-hatch runtime detector no regex can see.→02pat-scannerfree · MITThe one-command plugin. One hook, 13 credential classes, regex matching. Install it and you're covered. The guard, without the workflow.→03token-hunt-procommercialSilent redaction — the agent never sees the raw value. Active verification — checks whether a found key is actually live against GitHub, Stripe, and Slack. Offline ed25519 licensing. Zero phone-home.→265 rules · 51 providers built in
- AI21
- Anthropic
- Baidu Qianfan
- Baseten
- BytePlus
- Cerebras
- Chutes
- Cohere
- Crusoe
- DashScope
- DeepInfra
- DeepSeek
- fal.ai
- Featherless
- Figma
- Fireworks
- FriendliAI
- GitHub
- GitLab
- GMI Cloud
- Groq
- Hugging Face
- Inference.net
- Linear
- MiniMax
- Mistral
- Moonshot Kimi
- Nebius
- Novita
- npm
- NVIDIA NIM
- OpenAI
- OpenRouter
- OVHcloud
- Perplexity
- Poe
- PyPI
- Qwen
- Replicate
- Requesty
- SambaNova
- Scaleway
- SiliconFlow
- Slack
- StepFun
- Stripe
- Together AI
- Upstage
- Vercel AI Gateway
- xAI
- Z.ai
04 Measured, not marketed.
Three chat-time vectors, synthetic fixtures, fake values only, one OS. Commit-time scanners evaluate after the secret has already been sent to a model; the numbers below are what that gap looks like in practice.
| vector | token-hunt 0.1.1 | gitleaks 8.30.1 | trufflehog 3.97.9 |
|---|---|---|---|
| pasted secret in chat (10 keys) | 10/10 | 9/10 | 6/10 |
| bash escape-hatch (7 shapes) | 7/7 | 0/7 | 0/7 |
| .claude/settings.local.json (5 keys) | 5/5 | 1/5 | 3/5 |
| 59 benign lines (false positives) | 14 — all low-confidence entropy; 0 at ≥ 0.5 | 0 | 0 |
escape-hatch runs at the PreToolUse:Bash detection point; the other tools return zero findings on the same file at any setting.
3.2% vs 1.5% — AI-assisted commits leak at twice the baseline rate. GitGuardian, State of Secrets Sprawl 2026
2,539 keys — persisted into.claude/settings.local.json across 1,994 repos that traditional scanning missed. Apiiro, Nov 2026
+81% YoY — 1.27M AI-service credentials leaked in 2025.GitGuardian 2026