changelog

secret scanning for the agentic era

tkenhunt

Catch secrets at chat time, not commit time.

By the time you run git commit, your key has been sitting in the agent transcript for 30 minutes — indexed, synced, maybe re-emitted by a later tool call. token-hunt fires while it's happening.

$pip install token-hunt# zero cloud · zero telemetry · fail-closed

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.

token-hunt watch ~/.claude/projects/
$ echo "ANTHROPIC_API_KEY=sk-ant-…" > notes.txt
$ token-hunt scan notes.txt

● LEAK anthropic_api_key  notes.txt:1
  fingerprint 9f2c…e41a   action BLOCKED
  → rotate at console.anthropic.com, then:
$ token-hunt close 1 --note "rotated"

01 Six hooks. Every entry point.

hookwhat it seesaction on leak
UserPromptSubmityour pasteWARN
PreToolUse:Bashcommand about to runBLOCK
PostToolUse:Bashcommand outputWARN + log
PostToolUse:Readfile contentsWARN + log
PreToolUse:Edit/Writenew file contentBLOCK
PostToolUse:Edit/WriteechoWARN + 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_TOKEN

direct echo of a secret var

ALLOWED

[ -n "$ANTHROPIC_API_KEY" ] \
&& echo SET

status check — no value emitted

03 Three shapes. One hunt.

01token-huntfree · MITThe 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.→

11 providers built in