Repository navigation
Releases
v1.0.1
Changed
- CI is split into tiers (Story 4.29). Pull requests into
mainand pushes to
mainrun a fast set of twelve jobs in.github/workflows/ci.yml:go test -race
on ubuntu, macOS and Windows, one lint job (golangci-lint, gofmt, vet including
GOOS=windows), the leak test, the self-scan, workflow lint, community files, npm
packages and PyPI wheels on ubuntu, and the Action self-test on ubuntu and
Windows. Everything else (arm64 legs, macOS and Windows packaging legs, fuzz
targets, the benchmark jobs, reproducible builds, the goreleaser snapshot and
container image, the docs walkthrough, the adoption suite, examples, registry id
stability, supply chain and coverage) moves to the new
.github/workflows/nightly.yml, which runs daily onmainand opens or updates one
issue labelledci-nightlywhen a job fails, closing it on the next passing run.
Docs-only changes run the tools tests instead of the whole race suite
(scripts/ci-changes.sh); lint, the leak test and the self-scan always run. The
release gates are unchanged.tools/workflowcheckallowsnightly.ymlno write
scope butissuesandid-token.
Fixed
- The GitHub Action runs on Windows ARM runners (
windows-11-arm) (Story 4.30).
sigstore/cosign-installerstops there withunsupported architecture ARM64, so
the Action failed before it downloaded TokenHound. On Windows ARM64 the Action now
downloads cosign v3.1.4'scosign-windows-amd64.exefrom the sigstore/cosign GitHub
release (it has no Windows ARM64 build; Windows 11 on ARM runs it under x64
emulation), checks it against a sha256 pinned from that release's
cosign_checksums.txtand fails closed on a mismatch; every other runner keeps
cosign-installer. The post-publish install check's Windows ARM64 binaries row
installs cosign the same way, and the Action self-test gains a nightly
windows-11-armleg. How the TokenHound binary is verified is unchanged. - The post-publish install check's Homebrew rows run
brew updatebefore
brew install(analytics off), as a user's auto-updating Homebrew does. With
HOMEBREW_NO_AUTO_UPDATE=1and no update, themacos-15-intelimage's Homebrew
6.0.18 rejected the published cask (invalid 'zap' stanza: wrong number of arguments) and failed the v1.0.0homebrew brew (macos amd64)row, though the
cask installs with an updated brew. The cask is unchanged.
Benchmark
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: https://github.com/aiagentpro/tokenhound/blob/v1.0.1/docs/benchmark/results.json.
Verify this release
Download checksums.txt, checksums.txt.sigstore.json and the archives you want, then check the signature and the digests:
cosign verify-blob --bundle checksums.txt.sigstore.json --certificate-identity https://github.com/aiagentpro/tokenhound/.github/workflows/release.yml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com checksums.txt
sha256sum --ignore-missing -c checksums.txt(shasum -a 256 --ignore-missing -c checksums.txt on macOS.) Every archive has an SPDX JSON SBOM named <archive>.spdx.json, also listed in checksums.txt. The container image is signed too:
cosign verify ghcr.io/aiagentpro/tokenhound:1.0.1 --certificate-identity https://github.com/aiagentpro/tokenhound/.github/workflows/release.yml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.comInstall
| 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 |
v1.0.0
Added
-
Repository skeleton: Go module, package layout,
tokenhound --help. -
Apache-2.0 licence for the code and CC0-1.0 for registry data; contributing,
security, governance and code of conduct documents. -
Lint gates for architecture rules (secret reveal, HTTP clients, error text, stage
imports) with a self-test, a dash lint, a cross-OS CI matrix, CodeQL and GoReleaser
snapshot builds. -
Provider registry: JSON Schema (
registry/schema/provider.json), embedded snapshot
2026.11.13with OpenAI (project, service account, admin and legacy user keys) and
Anthropic (API and admin keys), a validating loader that reports
file:line: field: message,_template.yaml, thetools/testkeysgenerator,
make registry-testand themake registry-idsid stability check. -
CLI root with global flags (
--format,--config,--no-verify,--deterministic,
--no-color,--plain,--quiet,-v/--verbose,--log-format text|json),
log/sloglogging to stderr and one-line usage errors with the correct form (exit 2). -
tokenhound versionshows the version, commit, build date, registry snapshot and
schema version;tokenhound providerslists every provider with its detectors,
verify host and revoke URL. Both support--format json. -
Finding and Report model in the root package (statuses with live, unverified and
dead classes, confidence, grades, locations, targets, warnings) and the JSON Schema
docs/schema/report.v1.json(schema_version: 1, USD with two decimals, RFC 3339
UTC times). -
internal/secret.Secret, an opaque key type whose every print, marshal and log
path shows only the redacted form (sk-pro...a1b2 (51)), never more than half of
a key; theth_fingerprint id;internal/warnxwarnings built from error codes
without error text; and the internal detect-to-verify candidate envelope. -
Library scan API:
tokenhound.Scan(ctx, Options)withPath,StdinandReader
sources,Results.Events()progress events (finding-detected,location-added),
Results.Wait()for the final Report andResults.Findingsfor range loops;
Options.Timeoutreturns partial results with atimeoutwarning per incomplete
source, andOptions.Deterministicpins the generated time and duration. -
Scan engine: source, decode (pass-through for now), detect, suppress, verify
(verification off for now), enrich, grade and fix plan stages over bounded
channels withGOMAXPROCSworkers; each stage has one interface and an adapter
registry. The working tree source skips.git, never follows symlinks inside the
tree, reads plain files only (no archive expansion) and names the target after the normalisedoriginremote;
unreadable files becomefile_unreadablewarnings. Detect matches every registry
pattern, dedupes each key into one finding with every location, picks one winning
detector (keyword context, then confidence, then id) and lists the others in
also_matched_by. Generated test keys are suppressed astest_markerunless
IncludeTestKeysis set. Findings, locations, targets and warnings are sorted
deterministically. -
tokenhound scan [path|-]scans a directory, a file or standard input and prints
the JSON Report (--format json) or a minimal terminal summary (meta line, count
line, one row per finding with status word, provider, redacted key and first
location).--include-test-keyskeeps generated test keys unsuppressed;-o
writes one format to a file, or several formats (--format json,terminal) to a
directory astokenhound.jsonwith the summary on stdout. When stdout carries JSON
or everything goes to files, the summary goes to stderr unless--quiet. Exit
codes: 0 nothing matchedfail_on(default: unsuppressed live keys), 1 something
did, 2 usage or fatal error. -
report.Render(w, format, *Report)with thejsonandterminalreporters;
meta.files_scannedin the Report and its schema;tokenhound.ErrRegistryfor a
broken embedded registry. -
make leak-test(also a CI job on Linux, macOS and Windows) fails if any output or
debug log contains more than 10 characters of a generated key;make self-scan
(also a CI job) scans this repository and fails on any unsuppressed finding. -
Configuration:
tokenhound.yaml(project tier, or--config), the user file
<user config dir>/tokenhound/config.yaml,TOKENHOUND_*environment variables
and flags, resolved once with that precedence by the new publicconfig.Loadinto
tokenhound.Options, which gains typedVerify,FailOn,Grade,Limits,
Network,Hook,Alerts,PingandWarningsfields. The published schema
docs/schema/config.v1.jsonlists every key; a missingversionmeans 1 and any
other version exits 2. Schema errors print asfile:line: field: messageand fail
every verb with exit 2. Trust tiers:network.*,alerts.*,hook.*andping
are honoured only from the user tier; a project file may not disable verification,
settimeout, lower alimits.*value orverify.timeout, raise a limit above
4x its default, or raisegrade.f_threshold_usd_per_dayor
verify.max_concurrency; a projectfail_onmay only tighten (unioned on top of
every layer, flags included);${NAME}expands only in the user tier (also inside
one-line{ ... }mappings, so the documented example parses as written) and
project paths must stay inside the root;
ignored values becomeuntrusted_config_keyandconfig_path_outside_root
warnings in the log and the Report. The library never reads config or env itself. -
scanexits 1 perfail_on: statuses,min_dollars_at_risk(a missing amount
counts as 0) and warning codes; withCI=true,fail_on.warningsdefaults to
[timeout]. New scan flags--fail-on-status,--fail-on-warnings,
--fail-on-min-dollarsand--timeout;--no-verifyand--config(paths inside
it resolve against the scan root) are wired, and--no-verify=falsechanges nothing. Config files
must be regular files: a FIFO, device or directory is a config error, never a hang.
Durations must be greater than 0, andverify.timeoutandalerts.timeoutat most
5m. An emptyTOKENHOUND_*variable counts as unset (an empty
TOKENHOUND_FAIL_ON_WARNINGSstill means no codes), and an empty
--fail-on-statusis a usage error. -
limits.max_file_bytes(default 10 MiB) bounds every file and stdin read; larger
input is skipped with afile_too_largewarning and not counted as scanned (add
file_too_largetofail_on.warningsto fail on it). The schema caps every
limits.*key (for examplemax_file_bytesat 1 GiB) and
verify.max_concurrency(64) in every tier.tokenhound helpand--helpnever load config, so a broken config cannot
block help. -
internal/netx, the one HTTP client factory: a closed purpose enum (verify,
registry,forge,alert,image,git,ping), host allowlists (literal
hosts and one-label*templates under a fixed suffix) checked before any dial,
HTTPS and TLS 1.2+ only, no redirects forverify, an HTTPS proxy over CONNECT
withno_proxyand credentials held as a secret, a CA bundle added to the system
pool, typed errors with codes and no URL, query or credential text, a process-wide
dial counter, andinternal/netx/netxtest(test CA, TLS server, CONNECT proxy). -
Decoding: the default decode stage now unwraps base64 (standard and URL-safe,
padded or not), percent-encoding, JSON escapes and env-file values in memory,
recursively up tolimits.decode_max_depth(default 3). A key found in decoded
content is located at the line and column where its encoded form starts in the
original file. Deeper nesting, or decoded output past 4 times the file size, stops
with a newdecode_depth_limitwarning (detailsmax_depth,size_budget).
Corrupt input is skipped silently and decoded content is never logged or printed. -
Confidence: computed per finding from one documented rule table
(docs/detection.md): declared pattern confidence, +1 with
keyword context on the match line or an adjacent line, -1 for prefix-less
patterns found in decoded content. Patterns withentropy.mindrop matches below
it. New registry fieldrequires_keywordsdrops prefix-less matches without
keyword context. -
Generic detector
generic.high-entropy(providergeneric): high-entropy values
assigned toapi_key,tokenorsecretnames, confidencelowormedium,
always losing to a provider detector on the same secret (listed in
also_matched_by). -
tools/testkeystemplates gainb64,b64url,pctandjsonescso fixtures
can hold generated keys in every encoding. -
Frontier providers (registry snapshot
2026.11.13.1):google-gemini,
google-vertex,azure-openai,aws,mistral,cohere,groq,xai,
deepseek,openrouterandperplexity, each with revoke, rotate and usage links
and a read-only verify request (gcp-key,azure-key,aws-sigv4against Bedrock
ListFoundationModels, orbearer). Prefix-less key shapes (Mistral, Cohere, Azure
keys, AWS secret access keys, Vertex AI keys) count only with keyword context. -
Multi-part credentials: detect pairs the parts of a credential
(credential.parts,same-fileorsame-surface-entry) within one file and what
was decoded from it, nearest by line, and reports one finding whose id covers every
part in declared order. A primary part without its partners is reported alone with
confidence: lowandstatus_reason: unpaired; a lone secondary part is not
reported. Pairing rules are indocs/detection.md. -
Provider schema: snake_case or kebab-case part names, a templated
verify.url
(https://<resource>.openai.azure.com/...) withverify.host_suffixes, template
labels constrained to[a-z0-9-]{1,63}, and an optional per-patternverifybl...