tokenhound

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2026 License: Apache-2.0

README

TokenHound

Find the AI keys your coding agents have spread, see which are live and what they cost, and stop them going public.

Release CI npm downloads PyPI downloads Go Reference Discussions

Works with Claude Code · Codex · Cursor · VS Code · GitHub Actions · git hooks and pre-commit

English · 简体中文 · 日本語 · 한국어 · Español · Português (Brasil) · Deutsch · Français

$ npx tokenhound

  2 live keys, $29,227.68 a day at risk, grade F

  LIVE  OpenAI     sk-pro...TEST (56)   $28,800/day  .env:1
  LIVE  Groq       gsk_m3...TEST (56)   $427.68/day  app.py:2
  DEAD  Anthropic  sk-ant...H-AA (108)           $0  .env:2

  Why F: In repo app: 2 live keys, $29,227.68 a day at risk, at or over the $500.00 threshold.
  Next:  tokenhound fix th_676a05fa4d1c9bb1

Example output on synthetic test keys. Keys are only ever shown redacted.

Quickstart

npx tokenhound                                  # scan this machine's agent files and the current repo
npx tokenhound fix <finding-id>                 # step-by-step fix plan for one key
npx tokenhound hook install --claude-code --command "npx tokenhound"   # block live and high-confidence keys before Claude Code writes or runs them

--command "npx tokenhound" makes the hook run TokenHound through npx, so it works without an install. Once TokenHound is installed (Install), run tokenhound hook install --claude-code instead and the hook uses that binary.

No account, no sign-up and no telemetry. Prefer Homebrew, pip, Docker or Go? See Install.

What you get

Coding agents copy API keys into config files, .env files, notebooks, shell history and session transcripts. TokenHound is a scanner, run on your own machine, built to find them:

  • Find the AI provider keys your agents have spread: in the files of Claude Code, Codex, Cursor, Gemini CLI, Windsurf and more on this machine (full list), in Claude Code and Codex session transcripts, and in your repositories, with --history their full git history too.
  • Prove which keys still work, with one read-only call per key to its own provider, how many dollars per day each one puts at risk, and an A to F grade for every repository and machine. The live or dead check covers the 14 providers that support it.
  • Prevent new leaks: the Claude Code hook blocks live and high-confidence keys before Claude Code writes or runs them. High-confidence means a strong match that is not verified yet (policy). Git hooks and the GitHub Action fail a commit, push or pull request that adds a live key; to fail on unverified keys too, add not-verified, unknown and rate-limited to fail_on.status.
  • Fix each one with a plan you can paste (tokenhound fix <id>): revoke the key on the provider's revoke page, replace it everywhere it is used (with the usual environment variable name), purge it from git history when it was committed, and check usage for abuse.

Why not just ask your agent?

"Check this repo for leaked API keys" is a reasonable prompt, but it can't do this job:

Asking your agent TokenHound
The keys themselves The agent has to read every key it checks, so each one lands in its context, its transcript and the model provider's logs. Looking for a leak makes another one. Redacts each key as it reads it. No key ever reaches a model.
Where it looks The project it is working in, with grep. The config files of Claude Code, Codex, Cursor, Gemini CLI, Windsurf and more, Claude Code and Codex transcripts and shell history on the machine, plus repositories (with --history, their full git history), decoding base64, URL encoding, JSON escapes and notebooks.
Live or dead Has to curl the key itself, which logs it again, and guess a safe endpoint. One read-only call per key to a vetted endpoint from the registry, for the 14 providers that support it.
What is at risk No way to know. Dollars at risk per day and an A to F grade.
Same answer twice Varies from run to run; "looks clean" proves nothing. Deterministic, with results published on an open benchmark.
New leaks Caught only when someone remembers to ask. The Claude Code hook blocks live and high-confidence keys before they are written or run; git hooks and the GitHub Action fail commits and pull requests that add a live key.
Cost Tokens and minutes for every scan. Seconds, free, and fully offline with --no-verify.

You can still use your agent: the MCP server and agent skill let it run TokenHound and get back redacted results instead of raw keys.

Benchmark

The open agent leak benchmark plants generated AI keys, and decoys that only look like keys, in the places coding agents leave them, then runs each scanner over the same files.

Of 1,047 AI keys hidden in agent files, repository files, git history, encoded values and notebooks, TokenHound found 1,047, gitleaks 825 and TruffleHog 440.

Tool Keys found Keys missed False alarms
TokenHound 1,047 of 1,047 (100%) 0 39
gitleaks 825 of 1,047 (79%) 222 203
TruffleHog 440 of 1,047 (42%) 607 8

The test keys are generated from TokenHound's own patterns, which favours TokenHound at finding them; read the method before comparing.

Each row is a tool at its default config: the tuned gitleaks and TruffleHog configs found no extra keys, so they get no rows of their own. Not compared yet: GitHub secret scanning.

What these numbers mean:

  • Keys found: of the 1,047 keys planted, how many the tool reported. A missed key is a leak you never hear about, so this is the number that matters most.
  • False alarm: an alert on something that was not a key (the test also holds 1,175 look-alike decoys). A false alarm costs you a moment to check and dismiss.

Where others do better: TruffleHog raises fewer false alarms (8 against TokenHound's 39), but it found only 440 of the 1,047 keys (42%).

TokenHound's live or dead check gave the right answer for 534 of the 534 keys it checked (against the benchmark's stand-in for the provider APIs, not real providers).

Run on 2026-11-19 with the open agent leak benchmark against TokenHound commit b6aa45ed4bc9, seed 20261119. Full technical results, with precision and recall per category, the tuned configs and every place TokenHound scores lower: RESULTS.md; summary: summary.json; data: docs/benchmark/results.json.

How the benchmark is built and kept in sync with this page: docs/benchmark.md.

What it scans

  • Your coding agents' files on this machine: Claude Code settings and transcripts, Codex, Cursor, Gemini CLI, Windsurf, Claude Desktop, VS Code MCP config, Jupyter, .npmrc and friends, and Bash, Zsh, Fish and PowerShell history.
  • Repositories: the working tree, staged changes and, with --history, every commit, including keys hidden in base64, URL encoding, JSON escapes and notebooks.
  • Standard input, single files and saved reports.
Agent surface Files read (macOS paths)
Claude Code ~/.claude/settings.json, ~/.claude/settings.local.json, ~/.claude.json, **/.claude/settings.local.json, ~/.claude/projects/**/*.jsonl
Claude Desktop ~/Library/Application Support/Claude/claude_desktop_config.json
Codex ~/.codex/config.toml, ~/.codex/auth.json, ~/.codex/sessions/**/*.jsonl
Cursor ~/.cursor/mcp.json, **/.cursor/mcp.json, ~/Library/Application Support/Cursor/User/settings.json
dotenv files **/.env, **/.env.*
Gemini CLI ~/.gemini/settings.json, **/.gemini/settings.json
Gemini CLI .env ~/.gemini/.env, **/.gemini/.env
Jupyter notebooks **/.ipynb_checkpoints/*.ipynb
Jupyter config ~/.jupyter/*.json, **/.jupyter/*.json
npmrc, yarnrc and pypirc ~/.npmrc, **/.npmrc, ~/.yarnrc, **/.yarnrc, ~/.pypirc, **/.pypirc
Bash history ~/.bash_history
Fish history ~/.local/share/fish/fish_history
PowerShell history ~/.local/share/powershell/PSReadLine/ConsoleHost_history.txt
Zsh history ~/.zsh_history, ~/.zhistory
VS Code MCP ~/Library/Application Support/Code/User/mcp.json, ~/Library/Application Support/Code/User/settings.json, **/.vscode/mcp.json, **/.vscode/settings.json
Windsurf ~/.codeium/windsurf/mcp_config.json

macOS paths shown; Linux and Windows: tokenhound providers --surfaces and docs/surfaces.md.

Verified live or dead (14) Detected (12)
Anthropic, AWS (Amazon Bedrock), Azure OpenAI, Cohere, DeepSeek, Google Gemini, Google Vertex AI, Groq, Hugging Face, Mistral AI, OpenAI, OpenRouter, Perplexity, xAI Cerebras, ElevenLabs, Fireworks AI, Helicone, Jina AI, Langfuse, LangSmith, Pinecone, Replicate, Stability AI, Together AI, Voyage AI

tokenhound providers lists every provider and detector in your binary. Missing one? Add it in 10 minutes.

How it is different

TokenHound General secret scanners
Reads coding agent files and transcripts on your machine Built in Point them at the paths yourself
Live or dead check Read-only call per key Varies by tool and detector
Dollars at risk per day and an A to F grade Yes No
Blocks live and high-confidence keys in agent tool calls before they run Claude Code hook Not built in
Fix plan with revoke, replace, purge and usage-check steps Yes No

TokenHound is focused on AI provider keys. Keep your general secret scanner for everything else; the two work side by side.

Install

Channel Command Platforms
npm (no install) npx tokenhound macOS, Linux and Windows; amd64 and arm64
PyPI uvx tokenhound, pipx run tokenhound or pip install tokenhound macOS, Linux and Windows; amd64 and arm64
Homebrew brew install aiagentpro/tap/tokenhound macOS and Linux; amd64 and arm64
Scoop scoop bucket add aiagentpro https://github.com/aiagentpro/scoop-bucket then scoop install tokenhound Windows; amd64 and arm64
Docker docker run --rm -v "$PWD:/src" ghcr.io/aiagentpro/tokenhound scan /src Linux; amd64 and arm64
Go go install github.com/aiagentpro/tokenhound/cmd/tokenhound@latest macOS, Linux and Windows; amd64 and arm64
GitHub Action uses: aiagentpro/tokenhound/dist/github-action@v1.0.1 macOS, Linux and Windows; amd64 and arm64
Binaries Releases, with checksums.txt and its cosign bundle macOS, Linux and Windows; amd64 and arm64

Every release is built reproducibly and ships with a cosign-signed checksums.txt and an SPDX SBOM per archive; npm and PyPI packages carry provenance. How to verify a download: docs/releasing.md.

Every command, flag, output format and exit code: docs/cli.md. Config file and environment variables: docs/configuration.md. Go library: docs/library.md.

MCP server and agent skill

claude mcp add tokenhound -- tokenhound mcp

The MCP server gives any agent scan, verify_status, fix_plan and report tools that only ever return redacted keys. Setup for Codex, Cursor, Claude Desktop and VS Code: docs/mcp.md. The agent skill teaches Claude Code, Codex and Cursor when and how to run TokenHound: docs/skill.md.

CI and hooks

GitHub Action

Fail pull requests that add a live AI key, with one updated PR comment, line annotations and SARIF in code scanning:

on: pull_request
permissions:
  contents: read
jobs:
  tokenhound:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write    # the PR comment
      security-events: write  # the SARIF upload
    steps:
      - uses: actions/checkout@v5
        with:
          fetch-depth: 0
      - uses: aiagentpro/tokenhound/dist/github-action@v1.0.1
        with:
          new-only: true      # fail only on keys that are not in the baseline

Without new-only, the step fails on every live key it finds in the checkout, not only the ones the pull request adds. Pin both actions by commit SHA in production. Inputs and outputs: dist/github-action. Other CI systems run tokenhound scan --format sarif or --format json and use the exit code.

Hooks

tokenhound hook install --claude-code   # Claude Code: PreToolUse hook plus a session-end scan
tokenhound hook install --pre-commit    # git pre-commit (or --pre-push)

The git hooks fail a commit or push that adds a key matching fail_on, by default a live key; add not-verified, unknown and rate-limited to fail_on.status to fail on unverified keys too (docs/hooks/git.md). The pre-commit framework, husky and lefthook are supported too: see docs/hooks.

What it prevents and what it does not

The Claude Code hook prevents live and high-confidence keys in Bash commands, file writes, edits, notebook edits and MCP calls from running or being written, and keeps a blocked command from being saved to Claude Code's "don't ask again" allowlist.

It does not see:

  • keys the agent reads into its context (for example by opening a .env file);
  • keys pasted into a prompt;
  • warned keys (dead or lower-confidence) that the user lets through, including with "don't ask again";
  • anything with hook.mode: warn, which only warns.

The session-end scan reports keys like these after the session, when they end up in Claude Code's settings files or the session's transcript. It reports; it does not prevent. Full policy: docs/hooks/policy.md.

Privacy and safety

TokenHound runs on your machine. It sends nothing anywhere except the one read-only verify call per key to that key's own provider, and none with --no-verify. There is no telemetry, no account and no phone-home. Raw keys are held only in memory during the scan and never appear in any output, log or report.

How verification stays safe

  • Each key gets one read-only call to its own provider (GET/HEAD, or a POST documented as side-effect free), never a generation, billing or write call.
  • TokenHound never revokes a key and never calls a revoke URL. fix --open only opens the revoke page in your browser.
  • Verify calls go only to the provider host in the registry, through your proxy and CA bundle if you set them. --no-verify makes no network call at all.
  • No output, log, report or error ever holds more than the redacted form sk-pro...a1b2 (51). A leak test checks every output format on every build.

Details: docs/verification.md.

Contributing

Add a provider in 10 minutes: providers are one YAML file each. Copy registry/providers/_template.yaml, fill in the pattern and the read-only verify call, run make registry-test, and open a pull request. Everything else, including how to run every CI gate locally with make ci, is in CONTRIBUTING.md.

How TokenHound works inside, for contributors: architecture rules, detection, spend model and threat model. Providers and agent surfaces are YAML data in registry/, not code.

Community

Licence

Code: Apache License 2.0. Registry data in registry/: CC0 1.0, public domain. See NOTICE.

Star history

Star history chart

Directories

Path Synopsis
cmd
tokenhound command
Command tokenhound finds leaked AI keys before attackers do.
Command tokenhound finds leaked AI keys before attackers do.
docs
schema
Package schema embeds the published JSON Schemas: the Report (report.v1.json), the tokenhound.yaml config (config.v1.json), the baseline file (baseline.v1.json) and the benchmark ground truth (bench-truth.v1.json).
Package schema embeds the published JSON Schemas: the Report (report.v1.json), the tokenhound.yaml config (config.v1.json), the baseline file (baseline.v1.json) and the benchmark ground truth (bench-truth.v1.json).
examples
library command
Command library is the Go library example (examples/README.md): it scans a directory with github.com/aiagentpro/tokenhound/pkg/tokenhound, prints one line per finding with the redacted key and the first fix step, then the grade, and exits 1 when it found a key.
Command library is the Go library example (examples/README.md): it scans a directory with github.com/aiagentpro/tokenhound/pkg/tokenhound, prints one line per finding with the redacted key and the first fix step, then the grade, and exits 1 when it found a key.
internal
agenthook
Package agenthook installs and uninstalls TokenHound's coding agent hooks in the agent's own settings file (Claude Code's settings.json today).
Package agenthook installs and uninstalls TokenHound's coding agent hooks in the agent's own settings file (Claude Code's settings.json today).
benchtruth
Package benchtruth loads the ground truth file of a benchmark build (go build -tags benchmark, see docs/benchmark.md).
Package benchtruth loads the ground truth file of a benchmark build (go build -tags benchmark, see docs/benchmark.md).
browser
Package browser opens a URL in the operating system's default browser.
Package browser opens a URL in the operating system's default browser.
candidate
Package candidate defines the stage envelopes: Chunk, which carries content from source through decode to detect, and Candidate, which detect hands on toward verify with a Finding, its secret.Secret key material and the precomputed suppression context.
Package candidate defines the stage envelopes: Chunk, which carries content from source through decode to detect, and Candidate, which detect hands on toward verify with a Finding, its secret.Secret key material and the precomputed suppression context.
cli
Package cli is the command line front door: it defines the Cobra commands, maps results to exit codes and carries the build version, commit and date injected by ldflags.
Package cli is the command line front door: it defines the Cobra commands, maps results to exit codes and carries the build version, commit and date injected by ldflags.
config
Package config resolves TokenHound configuration once per run.
Package config resolves TokenHound configuration once per run.
decode
Package decode is the second pipeline stage: it decodes base64, URL, JSON-escaped and env-file encodings and expands archives in memory within configured size, depth and entry limits.
Package decode is the second pipeline stage: it decodes base64, URL, JSON-escaped and env-file encodings and expands archives in memory within configured size, depth and entry limits.
detect
Package detect is the third pipeline stage: it matches registry patterns, entropy and keyword context, computes the fingerprint id and confidence, and emits candidate.Candidate envelopes.
Package detect is the third pipeline stage: it matches registry patterns, entropy and keyword context, computes the fingerprint id and confidence, and emits candidate.Candidate envelopes.
engine
Package engine wires the scan pipeline: it connects the stages (source, decode, detect, suppress, verify, enrich, grade, fixplan) over bounded channels, runs the worker pools and the single barrier after enrich, applies timeouts and sorts findings once.
Package engine wires the scan pipeline: it connects the stages (source, decode, detect, suppress, verify, enrich, grade, fixplan) over bounded channels, runs the worker pools and the single barrier after enrich, applies timeouts and sorts findings once.
enrich
Package enrich is the sixth pipeline stage: it derives tier, scopes, org, first_seen, age and dollars at risk per day from verify evidence and the spend registry.
Package enrich is the sixth pipeline stage: it derives tier, scopes, org, first_seen, age and dollars at risk per day from verify evidence and the spend registry.
fixplan
Package fixplan runs once after the engine barrier and the location sort: it sets the fix plan of every finding (live, dead, unverified and suppressed alike).
Package fixplan runs once after the engine barrier and the location sort: it sets the fix plan of every finding (live, dead, unverified and suppressed alike).
fuzzcheck
Package fuzzcheck holds the assertions every fuzz target shares and the fuzz inventory (Story 4.13).
Package fuzzcheck holds the assertions every fuzz target shares and the fuzz inventory (Story 4.13).
githook
Package githook installs and uninstalls the TokenHound git pre-commit and pre-push hooks with a single owner (AD-18).
Package githook installs and uninstalls the TokenHound git pre-commit and pre-push hooks with a single owner (AD-18).
gitx
Package gitx is the only package that runs the system git binary, with argument slices, validated refs and hardened flags and environment.
Package gitx is the only package that runs the system git binary, with argument slices, validated refs and hardened flags and environment.
gitx/gitxtest
Package gitxtest builds throwaway git repositories for tests.
Package gitxtest builds throwaway git repositories for tests.
grade
Package grade runs once after the engine barrier: it computes the A to F grade per target and overall, with the reasons for each grade.
Package grade runs once after the engine barrier: it computes the A to F grade per target and overall, with the reasons for each grade.
hook
Package hook runs TokenHound as a coding agent pre-tool hook.
Package hook runs TokenHound as a coding agent pre-tool hook.
ignore
Package ignore holds the parts of the ignore grammar (docs/schema/ignore.v1.md) that both the config resolver and the suppress stage need: rule validation and the forward-slash glob matcher.
Package ignore holds the parts of the ignore grammar (docs/schema/ignore.v1.md) that both the config resolver and the suppress stage need: rule validation and the forward-slash glob matcher.
lintcheck
Package lintcheck owns the lint self-test fixtures under testdata.
Package lintcheck owns the lint self-test fixtures under testdata.
mcpserver
Package mcpserver is the `tokenhound mcp` front door: a stdio Model Context Protocol server with exactly four tools (scan, verify_status, fix_plan and report).
Package mcpserver is the `tokenhound mcp` front door: a stdio Model Context Protocol server with exactly four tools (scan, verify_status, fix_plan and report).
netx
Package netx is the only package that builds HTTP clients and transports: HTTPS only, a closed purpose enum, registry-declared hosts for verification, no redirects for verify, proxy and custom CA support.
Package netx is the only package that builds HTTP clients and transports: HTTPS only, a closed purpose enum, registry-declared hosts for verification, no redirects for verify, proxy and custom CA support.
netx/netxtest
Package netxtest holds loopback test wiring for code that talks through internal/netx: a throwaway certificate authority, TLS test servers whose leaf certificates name any host, and a CONNECT-only proxy.
Package netxtest holds loopback test wiring for code that talks through internal/netx: a throwaway certificate authority, TLS test servers whose leaf certificates name any host, and a CONNECT-only proxy.
ownership
Package ownership is a test helper for AD-2 field ownership: each Finding field is set only by its owning stage.
Package ownership is a test helper for AD-2 field ownership: each Finding field is set only by its owning stage.
registry
Package registry loads and validates the provider, surface and spend registries (YAML validated by JSON Schema) from the embedded snapshot or a refreshed copy.
Package registry loads and validates the provider, surface and spend registries (YAML validated by JSON Schema) from the embedded snapshot or a refreshed copy.
report/social
Package social is how tools/socialpreview reaches the share card renderer for the repository social preview without making it public library API (Story 4.14).
Package social is how tools/socialpreview reaches the share card renderer for the repository social preview without making it public library API (Story 4.14).
secret
Package secret holds credential material in an opaque Secret type whose formatting and marshalling methods return only the redacted form.
Package secret holds credential material in an opaque Secret type whose formatting and marshalling methods return only the redacted form.
source
Package source is the first pipeline stage: adapters read files, staged changes, git history, images, notebooks, agent surfaces, stdin and forge orgs, and emit content chunks with their Location.
Package source is the first pipeline stage: adapters read files, staged changes, git history, images, notebooks, agent surfaces, stdin and forge orgs, and emit content chunks with their Location.
source/fs
Package fs is the working tree source adapter ("fs"): it walks a directory, or reads one file, and emits each regular file as one chunk.
Package fs is the working tree source adapter ("fs"): it walks a directory, or reads one file, and emits each regular file as one chunk.
source/git
Package git holds the git source adapters.
Package git holds the git source adapters.
source/stdin
Package stdin is the stream source adapter ("stdin"): it reads one stream, such as standard input, whole and emits it as one chunk with Location kind stdin and target {stdin, stdin, unknown}.
Package stdin is the stream source adapter ("stdin"): it reads one stream, such as standard input, whole and emits it as one chunk with Location kind stdin and target {stdin, stdin, unknown}.
source/surface
Package surface is the agent surface source adapter ("surface"): it reads the files coding agents keep on disk (settings, allowlists, MCP config, transcripts) as the registry describes them, parses each with the format's structure-aware parser and emits one chunk per extracted entry with a Location of kind surface (surface id, path, field) so that credentials in one entry pair under same-surface-entry.
Package surface is the agent surface source adapter ("surface"): it reads the files coding agents keep on disk (settings, allowlists, MCP config, transcripts) as the registry describes them, parses each with the format's structure-aware parser and emits one chunk per extracted entry with a Location of kind surface (surface id, path, field) so that credentials in one entry pair under same-surface-entry.
source/surface/parse
Package parse reads the file formats of agent surfaces (json, jsonc, jsonl, toml, yaml, ini, dotenv, shell-history and ipynb) into a small tree that keeps the 1-based source line of every value, and selects string values from it with field selectors.
Package parse reads the file formats of agent surfaces (json, jsonc, jsonl, toml, yaml, ini, dotenv, shell-history and ipynb) into a small tree that keeps the 1-based source line of every value, and selects string values from it with field selectors.
stagereg
Package stagereg is the adapter registry every pipeline stage package uses: adapters register a factory under a name at init(), and the engine looks factories up by name.
Package stagereg is the adapter registry every pipeline stage package uses: adapters register a factory under a name at init(), and the engine looks factories up by name.
suppress
Package suppress is the fourth pipeline stage: it alone decides whether a candidate is suppressed (test keys, inline allows, allowlists, ignore files, baselines) and records the reason.
Package suppress is the fourth pipeline stage: it alone decides whether a candidate is suppressed (test keys, inline allows, allowlists, ignore files, baselines) and records the reason.
verify
Package verify is the fifth pipeline stage: it checks keys with read-only, registry-declared requests through netx and sets status, status_reason and verify_evidence.
Package verify is the fifth pipeline stage: it checks keys with read-only, registry-declared requests through netx and sets status, status_reason and verify_evidence.
warnx
Package warnx builds report warnings from errors as {code, location, detail_code}, so foreign error text never reaches warnings, logs or MCP output.
Package warnx builds report warnings from errors as {code, location, detail_code}, so foreign error text never reaches warnings, logs or MCP output.
yamlschema
Package yamlschema parses single-document YAML files and validates them against a JSON Schema, reporting every problem as "file:line: field: message".
Package yamlschema parses single-document YAML files and validates them against a JSON Schema, reporting every problem as "file:line: field: message".
pkg
config
Package config resolves configuration once, with precedence flags, then TOKENHOUND_* environment, then user config, then project tokenhound.yaml, then defaults, into tokenhound.Options.
Package config resolves configuration once, with precedence flags, then TOKENHOUND_* environment, then user config, then project tokenhound.yaml, then defaults, into tokenhound.Options.
model
Package model is the TokenHound Finding and Report model: statuses and their classes, confidence, grades, targets, locations, warnings, progress events and the canonical JSON Report (docs/schema/report.v1.json).
Package model is the TokenHound Finding and Report model: statuses and their classes, confidence, grades, targets, locations, warnings, progress events and the canonical JSON Report (docs/schema/report.v1.json).
report
Package report renders a tokenhound.Report.
Package report renders a tokenhound.Report.
tokenhound
Package tokenhound finds leaked AI keys, verifies them safely and prices the exposure.
Package tokenhound finds leaked AI keys, verifies them safely and prices the exposure.
Package registry embeds the TokenHound registry data: the snapshot manifest, the JSON Schemas and the provider, spend and surface YAML files.
Package registry embeds the TokenHound registry data: the snapshot manifest, the JSON Schemas and the provider, spend and surface YAML files.
tools
benchsync command
Command benchsync pulls the published summary of the agent leak benchmark (benchmark/ in this repository) into docs/benchmark/results.json and regenerates the README block between <!-- benchmark:start --> and <!-- benchmark:end --> from it, so every benchmark number in the README comes from that one data file.
Command benchsync pulls the published summary of the agent leak benchmark (benchmark/ in this repository) into docs/benchmark/results.json and regenerates the README block between <!-- benchmark:start --> and <!-- benchmark:end --> from it, so every benchmark number in the README comes from that one data file.
changelogrelease command
Command changelogrelease keeps the hand-written CHANGELOG.md in step with releases.
Command changelogrelease keeps the hand-written CHANGELOG.md in step with releases.
channelcheck command
Command channelcheck checks the Homebrew cask and the Scoop manifest of a GoReleaser bin/release/ directory against its checksums.txt (Story 4.4).
Command channelcheck checks the Homebrew cask and the Scoop manifest of a GoReleaser bin/release/ directory against its checksums.txt (Story 4.4).
checklistcheck command
Command checklistcheck keeps docs/release/v1-checklist.md honest (Story 4.19, NFR11): every adoption blocker of the PRD and every non-functional requirement NFR1 to NFR10 has a row, and every row has evidence that exists.
Command checklistcheck keeps docs/release/v1-checklist.md honest (Story 4.19, NFR11): every adoption blocker of the PRD and every non-functional requirement NFR1 to NFR10 has a row, and every row has evidence that exists.
communitycheck command
Command communitycheck validates the community and governance files of Story 4.14, reporting each problem as "file:line: message":
Command communitycheck validates the community and governance files of Story 4.14, reporting each problem as "file:line: message":
covercore command
Command covercore runs `go test -cover` on the core packages, prints a per-package coverage table and exits 1 when any package is below the minimum, naming it.
Command covercore runs `go test -cover` on the core packages, prints a per-package coverage table and exits 1 when any package is below the minimum, naming it.
dashlint command
Command dashlint fails on em dash, en dash and ellipsis characters in tracked text files.
Command dashlint fails on em dash, en dash and ellipsis characters in tracked text files.
errtextlint command
Command errtextlint enforces the AD-3 text hygiene rule that forbidigo cannot see: outside internal/warnx and _test.go files, an error value must not be passed to a fmt print function (Sprint*, Print*, Fprint*, Append*) or to any log or log/slog function, method or attribute constructor.
Command errtextlint enforces the AD-3 text hygiene rule that forbidigo cannot see: outside internal/warnx and _test.go files, an error value must not be passed to a fmt print function (Sprint*, Print*, Fprint*, Append*) or to any log or log/slog function, method or attribute constructor.
gates command
Command gates holds the threshold logic of the v1.0 release gates and the post-publish install check (Story 4.18, NFR11).
Command gates holds the threshold logic of the v1.0 release gates and the post-publish install check (Story 4.18, NFR11).
genremembers command
Command genremembers generates the launch post "What your coding agent remembers" (docs/launch/what-your-coding-agent-remembers.md) from the embedded surface registry (registry/surfaces/): for each agent or tool, every surface with its files per OS, its file format, the fields that can hold a key, the registry note (for example that Claude Code's "don't ask again" allowlist in settings.local.json stores whole commands) and the vendor documentation (Story 4.17).
Command genremembers generates the launch post "What your coding agent remembers" (docs/launch/what-your-coding-agent-remembers.md) from the embedded surface registry (registry/surfaces/): for each agent or tool, every surface with its files per OS, its file format, the fields that can hold a key, the registry note (for example that Claude Code's "don't ask again" allowlist in settings.local.json stores whole commands) and the vendor documentation (Story 4.17).
internal/channel
Package channel holds what the Homebrew and Scoop channel tools share (Story 4.4): release version rules, archive names and download URLs, checksums.txt parsing and the Scoop manifest renderer.
Package channel holds what the Homebrew and Scoop channel tools share (Story 4.4): release version rules, archive names and download URLs, checksums.txt parsing and the Scoop manifest renderer.
internal/evidence
Package evidence resolves the evidence references that documents in this repository cite, so a checker can fail when a cited test, CI job or file no longer exists.
Package evidence resolves the evidence references that documents in this repository cite, so a checker can fail when a cited test, CI job or file no longer exists.
internal/labels
Package labels reads and validates .github/labels.yml, the repository labels that tools/labelsync syncs to GitHub and tools/communitycheck checks in CI (Story 4.14).
Package labels reads and validates .github/labels.yml, the repository labels that tools/labelsync syncs to GitHub and tools/communitycheck checks in CI (Story 4.14).
issueguard command
Command issueguard decides whether a new or edited issue, or issue comment, holds what looks like a key (Story 4.14).
Command issueguard decides whether a new or edited issue, or issue comment, holds what looks like a key (Story 4.14).
labelsync command
Command labelsync creates or updates every label of .github/labels.yml on GitHub with `gh label create --color <c> --description <d> --force -- <name>` (Story 4.14).
Command labelsync creates or updates every label of .github/labels.yml on GitHub with `gh label create --color <c> --description <d> --force -- <name>` (Story 4.14).
launchrender command
Command launchrender renders the launch artefacts under docs/launch/ from the templates in docs/launch/templates/ and checks every launch file (Story 4.17).
Command launchrender renders the launch artefacts under docs/launch/ from the templates in docs/launch/templates/ and checks every launch file (Story 4.17).
linkcheck command
Command linkcheck checks the relative links and #anchors of Markdown files offline: every relative link must name a file or directory that exists, and every anchor into a Markdown file must match one of its headings (GitHub's slug rules, including the -1, -2 suffixes of repeated headings) or an explicit <a name> or id.
Command linkcheck checks the relative links and #anchors of Markdown files offline: every relative link must name a file or directory that exists, and every anchor into a Markdown file must match one of its headings (GitHub's slug rules, including the -1, -2 suffixes of repeated headings) or an explicit <a name> or id.
mdcheck
Package mdcheck holds the Markdown checks that tools/readmegen (the README) and tools/launchrender (the launch files under docs/launch/) share: line and fence splitting, the hook-claims check against docs/hooks/policy.md wording, and the AD-3 leak check.
Package mdcheck holds the Markdown checks that tools/readmegen (the README) and tools/launchrender (the launch files under docs/launch/) share: line and fence splitting, the hook-claims check against docs/hooks/policy.md wording, and the AD-3 leak check.
readmegen command
Command readmegen generates the README blocks between <!-- name:start --> and <!-- name:end --> markers from the registry and the data files, and checks the README (Story 4.16):
Command readmegen generates the README blocks between <!-- name:start --> and <!-- name:end --> markers from the registry and the data files, and checks the README (Story 4.16):
registryids command
Command registryids is the registry id stability check (AD-4).
Command registryids is the registry id stability check (AD-4).
releasecredits command
Command releasecredits prints the "Registry contributors" block of the release notes from GitHub pull request JSON.
Command releasecredits prints the "Registry contributors" block of the release notes from GitHub pull request JSON.
scoopmanifest command
Command scoopmanifest renders the Scoop manifest tokenhound.json from the template in dist/scoop and a release's signed checksums.txt (Story 4.4).
Command scoopmanifest renders the Scoop manifest tokenhound.json from the template in dist/scoop and a release's signed checksums.txt (Story 4.4).
selfscan command
Command selfscan checks a TokenHound JSON Report for unsuppressed findings, so the CI self-scan needs no jq (AD-16).
Command selfscan checks a TokenHound JSON Report for unsuppressed findings, so the CI self-scan needs no jq (AD-16).
serverjson command
Command serverjson renders the MCP registry manifest for a release and checks what the registry lists after publishing (Story 4.7).
Command serverjson renders the MCP registry manifest for a release and checks what the registry lists after publishing (Story 4.7).
socialpreview command
Command socialpreview renders the repository social preview, a 1280x640 PNG in the DESIGN.md identity (ink background, Hound amber wordmark, the headline sentence, no key material), with the share card's fonts and renderer, reached through internal/report/social (pkg/report registers it; it is not library API).
Command socialpreview renders the repository social preview, a 1280x640 PNG in the DESIGN.md identity (ink background, Hound amber wordmark, the headline sentence, no key material), with the share card's fonts and renderer, reached through internal/report/social (pkg/report registers it; it is not library API).
testkeys command
Command testkeys prints synthetic test keys generated from the embedded registry.
Command testkeys prints synthetic test keys generated from the embedded registry.
testkeys/keygen
Package keygen generates synthetic test keys from registry patterns (AD-16).
Package keygen generates synthetic test keys from registry patterns (AD-16).
testkeys/leakcheck
Package leakcheck is the one AD-3 leak checker of the test suites: it looks for more of a generated key than its redacted form in a captured output, raw and in its JSON-escaped, URL-encoded and base64-encoded views, and reports each hit by format, file, byte offset, encoding and finding id, never by the matched text.
Package leakcheck is the one AD-3 leak checker of the test suites: it looks for more of a generated key than its redacted form in a captured output, raw and in its JSON-escaped, URL-encoded and base64-encoded views, and reports each hit by format, file, byte offset, encoding and finding id, never by the matched text.
threatmodelcheck command
Command threatmodelcheck keeps docs/threat-model.md honest: every evidence reference it cites must exist in the repository, and every threat row must name a mitigating AD rule and at least one piece of evidence.
Command threatmodelcheck keeps docs/threat-model.md honest: every evidence reference it cites must exist in the repository, and every threat row must name a mitigating AD rule and at least one piece of evidence.
workflowcheck command
Command workflowcheck enforces the workflow hygiene rules of AD-27 on every GitHub Actions workflow:
Command workflowcheck enforces the workflow hygiene rules of AD-27 on every GitHub Actions workflow:

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL