Skip to content

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 23:53
15a6b89

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.13 with 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, the tools/testkeys generator,
    make registry-test and the make registry-ids id stability check.

  • CLI root with global flags (--format, --config, --no-verify, --deterministic,
    --no-color, --plain, --quiet, -v/--verbose, --log-format text|json),
    log/slog logging to stderr and one-line usage errors with the correct form (exit 2).

  • tokenhound version shows the version, commit, build date, registry snapshot and
    schema version; tokenhound providers lists 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; the th_ fingerprint id; internal/warnx warnings built from error codes
    without error text; and the internal detect-to-verify candidate envelope.

  • Library scan API: tokenhound.Scan(ctx, Options) with Path, Stdin and Reader
    sources, Results.Events() progress events (finding-detected, location-added),
    Results.Wait() for the final Report and Results.Findings for range loops;
    Options.Timeout returns partial results with a timeout warning per incomplete
    source, and Options.Deterministic pins 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 with GOMAXPROCS workers; 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 normalised origin remote;
    unreadable files become file_unreadable warnings. 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 as test_marker unless
    IncludeTestKeys is 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-keys keeps generated test keys unsuppressed; -o
    writes one format to a file, or several formats (--format json,terminal) to a
    directory as tokenhound.json with the summary on stdout. When stdout carries JSON
    or everything goes to files, the summary goes to stderr unless --quiet. Exit
    codes: 0 nothing matched fail_on (default: unsuppressed live keys), 1 something
    did, 2 usage or fatal error.

  • report.Render(w, format, *Report) with the json and terminal reporters;
    meta.files_scanned in the Report and its schema; tokenhound.ErrRegistry for 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 public config.Load into
    tokenhound.Options, which gains typed Verify, FailOn, Grade, Limits,
    Network, Hook, Alerts, Ping and Warnings fields. The published schema
    docs/schema/config.v1.json lists every key; a missing version means 1 and any
    other version exits 2. Schema errors print as file:line: field: message and fail
    every verb with exit 2. Trust tiers: network.*, alerts.*, hook.* and ping
    are honoured only from the user tier; a project file may not disable verification,
    set timeout, lower a limits.* value or verify.timeout, raise a limit above
    4x its default, or raise grade.f_threshold_usd_per_day or
    verify.max_concurrency; a project fail_on may 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 become untrusted_config_key and config_path_outside_root
    warnings in the log and the Report. The library never reads config or env itself.

  • scan exits 1 per fail_on: statuses, min_dollars_at_risk (a missing amount
    counts as 0) and warning codes; with CI=true, fail_on.warnings defaults to
    [timeout]. New scan flags --fail-on-status, --fail-on-warnings,
    --fail-on-min-dollars and --timeout; --no-verify and --config (paths inside
    it resolve against the scan root) are wired, and --no-verify=false changes 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, and verify.timeout and alerts.timeout at most
    5m. An empty TOKENHOUND_* variable counts as unset (an empty
    TOKENHOUND_FAIL_ON_WARNINGS still means no codes), and an empty
    --fail-on-status is a usage error.

  • limits.max_file_bytes (default 10 MiB) bounds every file and stdin read; larger
    input is skipped with a file_too_large warning and not counted as scanned (add
    file_too_large to fail_on.warnings to fail on it). The schema caps every
    limits.* key (for example max_file_bytes at 1 GiB) and
    verify.max_concurrency (64) in every tier. tokenhound help and --help never 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 for verify, an HTTPS proxy over CONNECT
    with no_proxy and 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, and internal/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 to limits.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 new decode_depth_limit warning (details max_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 with entropy.min drop matches below
    it. New registry field requires_keywords drops prefix-less matches without
    keyword context.

  • Generic detector generic.high-entropy (provider generic): high-entropy values
    assigned to api_key, token or secret names, confidence low or medium,
    always losing to a provider detector on the same secret (listed in
    also_matched_by).

  • tools/testkeys templates gain b64, b64url, pct and jsonesc so 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, openrouter and perplexity, each with revoke, rotate and usage links
    and a read-only verify request (gcp-key, azure-key, aws-sigv4 against Bedrock
    ListFoundationModels, or bearer). 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-file or same-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: low and status_reason: unpaired; a lone secondary part is not
    reported. Pairing rules are in docs/detection.md.

  • Provider schema: snake_case or kebab-case part names, a templated verify.url
    (https://<resource>.openai.azure.com/...) with verify.host_suffixes, template
    labels constrained to [a-z0-9-]{1,63}, and an optional per-pattern verify block
    (AWS Bedrock API keys). The loader checks that templated hosts, suffixes and
    placeholders agree.

  • tools/testkeys templates gain {{keypart "<provider>" "<part>"}}; boundary
    groups such as (?:^|[^A-Za-z0-9]) no longer add a character to generated keys.

  • Complete provider registry (snapshot 2026.11.13.2, 26 providers): together,
    fireworks, huggingface, replicate, elevenlabs, stability, voyage,
    jina, pinecone, langsmith, langfuse, helicone and cerebras, each with
    revoke, rotate, usage and docs links and golden-tested generated keys. Only
    huggingface has a verify block in v1.0 (read-only GET of whoami-v2); the other
    twelve are detect-only until verification lands. Langfuse is a two-part credential
    (secret key primary, public key second, same-file): a lone secret key is an
    unpaired low finding, a lone public key yields nothing. CI tests count the
    providers (at least 25, all FR-1.2 ids) and reject any verify.url path on the
    generation endpoint denylist.

  • Live verification (internal/verify, adapter live): one read-only request per
    finding id, built only from the registry verify block (per-pattern block first)
    and signed by an auth scheme (bearer, header, query, basic, azure-key,
    gcp-key, stdlib aws-sigv4), sent through netx purpose verify. Responses map
    to live, dead or unknown (unexpected_response, redirect, timeout,
    network_error); 429 backs off exponentially (Retry-After honoured, 3 retries)
    and ends rate-limited. Per-provider token bucket, run-wide concurrency cap,
    in-memory cache with singleflight, capped evidence extraction (org, tier,
    scopes, limits) that drops any value holding a key part, status-updated
    events, Report providers.<id>.verify_host and verify_note, a read-only
    per-pattern block for Anthropic admin keys, and docs/verification.md listing every
    endpoint as unconfirmed against live services. --no-verify, verify: false and
    TOKENHOUND_VERIFY=false still make zero dials.

  • Spend registry and price exposure (snapshot 2026.11.13.3): registry/schema/spend.json
    and one registry/spend/<provider>.yaml per provider (tiers, limits, most expensive
    model, unit price, optional daily cap, spend_kind: data-access for observability and
    vector stores), with a CI test that every provider has exactly one spend file. Prices
    are written per large unit (price_unit_size, for example per 1M tokens) and read as
    integer cents. The spend enrich adapter sets tier, scopes, org,
    dollars_at_risk_per_day (live), 0 (dead) or potential_dollars_at_risk_per_day
    (unverified) and a full dollars_method, with verified limits taking precedence over
    tier defaults and the default tier flagged assumed. tokenhound providers --spend
    lists the tiers (--format json supported). All spend figures are unconfirmed against
    live pricing pages; see docs/spend.md.

  • Fix plans (snapshot 2026.11.17): every finding of a Report, including dead,
    unverified and suppressed ones, carries fix_plan with numbered steps {n, kind, title, detail, url, command, locations} in the order revoke, replace (every location,
    plus the provider's env_vars), purge (only with a commit or image location: a
    git filter-repo --replace-text command with one regex: line per credential part
    built from the redacted form, length and registry pattern, never the key; a
    --invert-paths alternative for dotenv and npmrc-style files; a rebuild-without-layer
    note for images), check usage and ScopeKeeper (always last, link from the new
    required links.scopekeeper snapshot field). Links only, no network call.
    internal/fixplan.Build is the only implementation; the library adds
    tokenhound.FixPlan(f), FixKind and its constants, and CredentialPart.
    Multi-part findings carry credential_parts (part name and redacted form). Providers
    gain the optional env_vars field.

  • tokenhound fix <id> [path|-]: prints the fix plan of one finding with a header
    (status word, provider, redacted key, dollars per day), a How: line for metered
    dollars figures (limit x price x 1,440, cap and tier source) and the numbered steps,
    commands flush left on their own lines. --from <file|-> reads a saved Report
    (bounded to 64 MiB, checked for meta.schema_version and validated against
    docs/schema/report.v1.json) without scanning or any network call; without it, the
    path is re-scanned through the public API with the scan flags (--history,
    --since, --staged, --include-ignored, --include-test-keys, --timeout,
    --no-verify, --config, --deterministic) and nothing is written. --format json
    prints {schema_version, id, provider, status, redacted, fix_plan}. --open hands
    an https revoke URL to the OS browser opener (new internal/browser, the only
    process start besides git, argument slices only); TokenHound never contacts a
    revoke or rotate host. Exit 0 when the plan was printed, 2 for usage and input
    errors. The report package adds report.RenderFix.

  • tokenhound scan --format sarif (Story 2.8): SARIF 2.1.0 for GitHub code scanning and
    other SARIF consumers, to stdout, to an -o file, or as tokenhound.sarif with several
    formats and -o <dir>. One run per target (automationDetails.id
    tokenhound/<kind>/<id>/), rules built from the Report's detectors and providers
    (revoke and rotate links as help), error/warning/note levels by status and
    confidence, a title plus the redacted key as the message, partialFingerprints
    tokenhound/v1 set to the finding id so re-uploads do not duplicate alerts, file-like
    locations relative to %SRCROOT% (commit and notebook cell as location properties),
    surface, image and stdin locations as logical locations, suppressions for suppressed
    findings (inSource for inline allows) and baselineState when the Report carries
    baseline data. No snippets, timestamps or host paths. Only scan takes it.
    Library: report.FormatSARIF, report.RenderSARIF. The OASIS schema is vendored as a
    test fixture (see NOTICE).

  • Share card and README badge: report.RenderCard(w, CardData) draws a 1200x630 PNG
    (wordmark, the card sentence such as "2 live keys, $3,100 a day at risk, grade D",
    the grade tile, a Hound amber rule and the footer) from a four-field CardData
    (live count, dollars at risk per day, grade, optional label) derived with
    report.CardDataFrom, so no path, provider, finding id or key can reach it. Fonts
    (Inter, JetBrains Mono, SIL OFL 1.1) are embedded and glyphs are rasterized with
    integer arithmetic, so the PNG is byte-identical on every OS and architecture; its
    only text chunk is the alt text (report.CardAltText). report.RenderBadge(w, *Report) writes a shields.io flat-style SVG (tokenhound, then the grade, a middle
    dot and the live count on the grade colour, the headline sentence as <title>, no
    external references) sized with an embedded 11px Verdana width table (anafanafo,
    MIT). tokenhound scan --format card|badge exposes them (-o <file>, or
    tokenhound.png and tokenhound.svg in an -o directory); a card prints
    Alt text: ... and an <img> snippet on stderr, refuses to write to a terminal
    (exit 2) and takes --card-label <text> (printable ASCII, at most 40 characters).
    New dependency: golang.org/x/image.

  • tokenhound scan --format gha: GitHub Actions workflow commands, one per location of
    every non-suppressed finding in Report order. ::error for live keys, ::warning
    for unverified high-confidence keys, ::notice otherwise; file, line and col
    for file and staged locations (other kinds are named in the message); the title
    carries the status, provider and dollars a day, the message the redacted key and the
    first fix step. Text is escaped per GitHub's rules and printable ASCII only; an empty
    Report prints nothing. Under GITHUB_ACTIONS=true the terminal summary on stdout is
    printed in plain style and followed by the same annotations (also with --quiet).
    The report package adds report.FormatGHA (also through report.Render) and
    report.GHA with GHAOptions{NewOnly}, which lowers baselined findings to
    ::notice.

  • make leak-test is the AD-3 release gate: one cross-reporter harness checks every
    registered format, the terminal modes, report --from, fix, the baseline file and
    the debug log over the full generated corpus with the shared tools/testkeys/leakcheck
    checker (raw, JSON-escaped, URL-encoded and base64 forms).

  • tokenhound hook run --agent claude-code: a Claude Code PreToolUse hook that scans
    only the proposed content (Bash command, Write content, Edit and MultiEdit new
    strings, NotebookEdit new source, every string value of an MCP tool's input) and
    answers in Claude Code's hook protocol. One shared policy in internal/hook
    (hook.mode: block by default) blocks live and high-confidence unverified keys and
    warns on dead and lower-confidence keys; a warning never grants permission.
    Verification stops after 3 s (unknown / deadline); internal failures follow
    hook.on_error (warn-allow by default) and show only a warning code. Inline
    tokenhound:allow in proposed content is not honoured; project hook.* keys are
    ignored with untrusted_config_key. See docs/hooks/policy.md.

  • Library: VerifyOptions.Deadline, Options.NoInlineAllow and
    Source.WithTargetID for Reader sources; status reason deadline.

  • Report: providers.<id>.env_var, the provider's conventional environment variable
    from the registry's env_vars (additive to schema v1).

  • tokenhound mcp: a stdio Model Context Protocol server (official Go SDK v1.8.0) with
    exactly four tools, scan, verify_status, fix_plan and report (json, sarif,
    badge, card as a PNG image), each with JSON input and output schemas. Results carry
    only redacted keys, locations, ids, counts and dollars; scans stay inside the
    client's roots (or the working directory); the last Report of each session lives in
    memory only; a second concurrent scan returns scan_in_progress and a cancelled scan
    keeps the previous results. --config and --no-verify apply to every scan. Install
    snippets for Claude Code, Codex, Cursor, Claude Desktop and VS Code are in
    docs/mcp.md; server.json is the MCP registry manifest. make leak-test covers
    every tool output, progress notification and the debug log (TestLeakMCP).

  • The GitHub Action (aiagentpro/tokenhound-action, staged in action/): a composite
    action with bash, jq and gh scripts that downloads the pinned release, verifies
    checksums.txt with cosign verify-blob against the release workflow identity and
    the archive's sha256 before running it, scans --since <base sha> with the base
    branch tokenhound.yaml, ignore file and baseline, prints annotations, uploads SARIF
    (category tokenhound, SHA-pinned upload-sarif), keeps one PR comment up to date
    by its hidden marker (new findings, the binary's quiet headline, the baselined count
    and a note when a config file changed in the PR) and falls back to the job summary
    with one warning for fork PRs or missing permissions. Outputs grade, live-count,
    new-count, dollars-at-risk-per-day and report-dir. Black-box tests in
    tests/action (part of make leak-test).

  • --project-config <file> (same as --config; both is a usage error), and on scan,
    report and the bare command --ignore-file <file> and --baseline <file>, which
    replace the project ignore file and the baseline file. Library:
    config.Input.IgnoreFile and config.Input.BaselineFile.

  • meta.path_prefix in the Report (additive to schema v1): the scan root relative to
    its git top level. gha file= and SARIF artifact URIs of file locations join it,
    so a scan of a subdirectory annotates repository paths, also through
    report --from.

  • Agent skill skills/tokenhound/SKILL.md (Agent Skills format): tells a coding agent
    to call the TokenHound MCP tools (else tokenhound on PATH, else npx tokenhound,
    always with --format json) instead of opening secret files, report findings by
    headline and status with redacted keys only, walk each live key through its fix plan,
    ask before any git filter-repo, never revoke, and re-scan to confirm the key is
    dead. Install for Claude Code, Codex and Cursor in docs/skill.md. make skill-lint
    checks its commands, flags and MCP tools against the binary and bans dashes,
    non-ASCII and key material; make leak-test runs its CLI commands on a fixture
    (TestLeakSkillTranscript).

  • tokenhound hook install|uninstall --claude-code adds TokenHound's PreToolUse hook
    (matcher Bash|Write|Edit|MultiEdit|NotebookEdit|mcp__.*, command
    <tokenhound> hook run --agent claude-code) to ~/.claude/settings.json, or with
    --project to the repository's .claude/settings.json. Settings are edited through
    an order-preserving JSON tree: every other key, hook and literal keeps its bytes,
    indent and line endings, the write is atomic and symlink-aware, a repeat install
    changes nothing, a stale TokenHound command is updated in place, and uninstall
    removes only TokenHound's hooks so the file returns to its pre-install bytes. The
    hook runs the absolute path of the running binary, or tokenhound from PATH when the
    binary sits in an npx, uvx, pipx or go run cache; --command overrides. A settings
    file that is not valid JSON, or no Claude Code on the machine (unless --force),
    exits 2 without changing anything. See docs/hooks/claude-code.md. hook run gains
    a hidden --include-test-keys for end-to-end tests with generated keys.

  • Session-end scan: tokenhound hook install --claude-code also adds a matcherless
    SessionEnd hook (<tokenhound> hook run --agent claude-code --event session-end,
    "timeout": 10); --no-session-scan leaves it out and uninstall removes both.
    hook run --event session-end scans only ~/.claude/settings.json,
    ~/.claude/settings.local.json, ~/.claude.json, the session cwd's
    .claude/settings*.json and the session's transcript under ~/.claude/projects/,
    prints keys new since the last run in at most two stderr lines, and records them,
    redacted, in <user config dir>/tokenhound/state/ (claude-code-baseline.json in
    baseline v1 format, last-session-findings.json). Bare tokenhound and
    tokenhound agents add "N new keys found after your last Claude Code session" to
    the meta line until the keys are fixed (tokenhound fix <id>) or gone. The run
    reads only user-tier config, returns within 5 seconds and always exits 0; new
    config key hook.session_scan (default true, user tier only). See
    docs/hooks/claude-code.md and docs/adr/0005-claude-code-session-end-hook.md.

  • Library: tokenhound.SurfaceFiles(surface, files...) scans exactly the given files
    with a registry surface's parser and fields; HookOptions.SessionScan;
    config.Input.UserOnly resolves configuration without any project tier.

  • Release chain (.github/workflows/release.yml, RELEASING.md): release-please opens
    the release PR and creates the tag and GitHub Release; GoReleaser then builds six
    reproducible binaries with one SPDX SBOM per archive and a cosign keyless
    checksums.txt.sigstore.json bundle, self-scans dist/ and only then uploads the
    assets. Release notes are this file's version section plus registry contributor
    credits (tools/changelogrelease, tools/releasecredits). PR CI adds a workflow
    lint (pinned actionlint and tools/workflowcheck), goreleaser check and a
    reproducible-build check; make workflow-check and make release-check run them
    locally.

  • npm packages so npx tokenhound works (packaging/npm/): the main package
    tokenhound is a launcher with no install scripts that runs the native binary from
    one of six exact-pinned optional platform packages @tokenhound/<os>-<arch>,
    passing arguments, stdio, SIGINT, SIGTERM, SIGHUP and exit codes through. The
    packages are built from the release archives after their sha256 is checked
    against the signed checksums.txt, and a separate npm-publish release job
    publishes them with provenance through OIDC trusted publishing (no npm token;
    tools/workflowcheck rejects npm tokens outside npm-bootstrap.yml), skipping
    versions already on npm and tagging backports release-X.Y and prereleases
    next. npm-bootstrap.yml claims the names once. CI runs the Node tests and
    installs the packed tarballs on every OS; make npm-test and
    make npm-install-test run them locally.

  • PyPI wheels so uvx tokenhound, pipx run tokenhound and python -m tokenhound
    work (packaging/pypi/): build_wheels.py (stdlib only) turns the release
    archives, after their sha256 is checked against the signed checksums.txt, into
    eight byte-reproducible py3-none wheels for macOS 12 or later (arm64, x86_64),
    manylinux 2.17 and musllinux 1.2 (x86_64, aarch64) and Windows (x64, arm64). Each
    installs the native binary as the tokenhound script; the tokenhound package's
    __main__.py only runs it with arguments and exit codes unchanged. No sdist,
    Python 3.9 or later. A separate pypi-publish release job uploads them with
    pypa/gh-action-pypi-publish through OIDC trusted publishing with PEP 740
    attestations, skipping files already on PyPI (no PyPI token;
    tools/workflowcheck rejects PyPI tokens and a publish password). CI runs the
    Python tests on 3.9 and the default Python, twine check, check-wheel-contents
    and installs each OS's wheel; make pypi-test and make pypi-install-test run
    them locally.

  • Homebrew, Scoop and go install channels: GoReleaser renders the cask
    aiagentpro/tap/tokenhound (download URLs, sha256, binary "tokenhound" and one
    macOS post-install step that removes the quarantine attribute) and
    tools/scoopmanifest renders tokenhound.json from packaging/scoop, both from
    the signed checksums.txt. A separate tap-publish release job commits them to
    aiagentpro/homebrew-tap and aiagentpro/scoop-bucket, each with its own
    repo-scoped token in the protected tap-publish environment (tools/workflowcheck
    confines both tokens to that job), and skips backports and pre-releases. tools/channelcheck checks both against a snapshot dist/ in CI
    and make release-check; a go-install CI job runs go install ./cmd/tokenhound
    on every OS.

  • Security policy, threat model and supply-chain hardening: SECURITY.md adds the
    90-day disclosure window, the supported-versions table (latest minor, security
    backports to the previous minor for 6 months), the hooks, MCP, verification and
    registry refresh scope, and how to verify a release (cosign verify-blob,
    npm audit signatures, PyPI attestations; gh attestation verify once SLSA
    provenance ships). docs/threat-model.md covers assets, seven trust boundaries and
    STRIDE threats, each with its AD rule and the test, lint rule or CI job that proves
    it; tools/threatmodelcheck (make threat-model-check, CI workflow lint) fails
    when a cited reference no longer exists. A tag-signature release job
    (scripts/tag-signature.sh) stops the release before anything is built unless the
    tag resolves to the run's commit and that commit has a GitHub-verified signature;
    tools/workflowcheck requires every build and publish job to depend on it. New
    scorecard.yml publishes the OpenSSF Scorecard weekly and on main; CodeQL also
    analyzes JavaScript and Python; Dependabot also covers packaging/npm and
    packaging/pypi, grouped weekly. The npm and PyPI release tool pins moved to
    packaging/npm/package.json and packaging/pypi/requirements-tools.txt so
    Dependabot updates them; scripts/tool-pins.sh is the one reader and rejects a
    missing, duplicate or inexact pin (and npm older than 11.5.1). docs/security-setup.md lists the maintainer steps
    (private vulnerability reporting, branch protection, bestpractices.dev) and
    docs/data/badges.yaml records the badge entries.

  • Benchmark build tag (Story 4.9): go build -tags benchmark makes a binary whose
    verify calls are answered in process from a ground truth file
    (TOKENHOUND_BENCH_TRUTH, docs/schema/bench-truth.v1.json) by the hex SHA-256 of
    the credential as the request presents it, with a response that satisfies the
    provider's live_when or dead_when and fills verify.extract, or HTTP 429 for
    rate-limited; unlisted credentials stay unknown with the new status reason
    not_in_ground_truth. Every other network purpose fails before any dial with the
    new benchmark_network_blocked warning code (no v1.0 run uses such a purpose yet).
    The CLI reports X.Y.Z+benchmark (+meta.benchmark when the version has build
    metadata), prints "Benchmark build: verification answers come from ground truth."
    on stderr, and every command, --help and version included, exits 2 without a
    valid ground truth (bounded regular file, schema, and every entry checked against
    the registry); library callers get no banner or suffix and a Scan error instead.
    The report schema now lists every status_reason. Default builds are unchanged.
    scripts/no-benchmark-tag.sh fails any release or snapshot binary, loose or inside
    the six archives of checksums.txt, with the benchmark build tag or the
    responder's sentinel symbol or string (CI snapshot job, release goreleaser job,
    make release-check), and its
    self-test proves a benchmark binary fails it; make test-benchmark and the CI
    test job run go test -tags benchmark ./.... See docs/benchmark.md.

  • Published benchmark results in the README: docs/benchmark/results.json holds the
    newest published agent leak benchmark summary (seed 20261113, TokenHound,
    gitleaks and TruffleHog with default and tuned configs, GitHub secret scanning
    "not run yet"), and the block between <!-- benchmark:start --> and
    <!-- benchmark:end --> is generated from it with precision, recall and "AI keys
    in agent files found" per tool, linking the method and full results.
    make bench-sync (the newest benchmark/results/<date>/summary.json) updates both
    (tools/benchsync); make bench-check, part of make ci and the CI
    workflow lint job, fails when the block drifts from the data.

  • Container image and MCP registry listing (Story 4.7):
    ghcr.io/aiagentpro/tokenhound for linux/amd64 and linux/arm64, built from
    dist/docker/Dockerfile on the Chainguard git image pinned by digest, nonroot
    (uid 65532), entrypoint tokenhound, with OCI labels source, version,
    revision, licenses=Apache-2.0 and
    io.modelcontextprotocol.server.name=io.github.aiagentpro/tokenhound. A mounted
    repository owned by the host user passes git's dubious-ownership check through the
    image's read-only GIT_CONFIG_GLOBAL file, also when the runtime overrides HOME:
    internal/gitx now passes GIT_CONFIG_GLOBAL to git when it is set (the system
    config stays off and every hardening flag stays). A separate docker-publish
    release job builds it reproducibly from the release archives after their sha256 is
    checked against the signed checksums.txt, pushes it by digest, smoke-tests and
    signs that digest with cosign keyless, and only then tags it X.Y.Z, X.Y, X
    and latest (backports X.Y.Z and X.Y, pre-releases X.Y.Z only); it is the only job
    with packages: write (tools/workflowcheck). The mcp-registry job then
    renders server.json from the tag (tools/serverjson, validated against the
    registry schema), now listing npm, PyPI and OCI packages (the OCI one mounts a
    required {workspace} at /src), publishes it with mcp-publisher through GitHub
    OIDC once the image is anonymously pullable, skips pre-releases, and checks the
    registry API lists the version.
    Ownership markers: mcpName in the npm package and an mcp-name: line in the
    PyPI description. scripts/docker-smoke.sh (make docker-smoke, CI docker job)
    checks labels, user, entrypoint, version and a history scan of a fixture
    repository owned by another uid; Dependabot also watches dist/docker.

  • Coding-agent baselines beside TokenHound: make bench-sync also copies each
    published agent baseline of the benchmark on the same corpus
    (benchmark/results/<date>/baseline-<agent>.json, Claude Code or Codex given a plain "find
    leaked keys" prompt) to docs/benchmark/baseline-<agent>.json, and the README
    benchmark block then shows TokenHound and each baseline side by side (precision,
    recall, F1, keys missed, false alarms, keys called live correctly, model id, run
    date). The drift check covers it.

  • The README benchmark table shows F1, keys missed (FN) and false alarms (FP) beside
    precision and recall for every tool, and notes that a missed live key is the
    expensive error, so recall matters most for leak scanning.

  • Governance and contributor onboarding (Story 4.14): GOVERNANCE.md now covers
    registry reviewers, the path to maintainer and the registry review rules (ids are
    permanent); CODEOWNERS requires a maintainer for internal/secret,
    internal/netx, .github/workflows/ and .goreleaser.yaml and registry reviewers
    for registry/; CITATION.cff (validated with cffconvert) and
    .all-contributorsrc. CONTRIBUTING.md "Add a provider in 10 minutes" is a checked
    guide: CI's docs-walkthrough job (scripts/docs-walkthrough.sh) runs its
    commands for a throwaway provider and fails past 10 minutes or when a schema error
    stops printing file:line: field: message; a new registry/spend/_template.yaml
    goes with it, the provider template's placeholder key prefix is xmpl_ (not the
    id, which golden files name), and the provider tests no longer pin the provider list.

  • Issue forms bug, false-positive (finding id, detector id and redacted form only),
    provider and surface (renamed from provider-request and surface-request), each
    opening with a warning never to paste a full key; .github/labels.yml with a label
    sync workflow (tools/labelsync); and the issue-guard workflow, which scans new and
    edited issues (title and body) and comments, pull request comments included, with
    tokenhound scan - --no-verify, counting findings an inline tokenhound:allow would
    suppress, and on a finding posts a fixed rotation comment once per issue and adds
    possible-secret, without echoing the key
    (tools/issueguard, self-tested on fake event payloads with generated keys).

  • scripts/repo-settings.sh (maintainer-run, idempotent, --dry-run) enables
    Discussions and sets the 20 repository topics; examples/ (GitHub Actions,
    pre-commit, Claude Code hook settings and a Go library example run on generated
    fixtures in CI); the 1280x640 social preview docs/media/social-preview.png,
    rendered by tools/socialpreview with the share card fonts and renderer (reached
    through internal/report/social, not library API) and drift-checked in CI. New CI jobs community,
    docs-walkthrough and examples; make community-check, make examples-test and
    make docs-walkthrough.

  • Fuzzing on pull requests (Story 4.13): a fuzz target for every v1.0 parser and
    decoder, adding FuzzParseDiff (git log -p), FuzzInlineAllow
    (tokenhound:allow), FuzzGlob (ignore globs), FuzzParseBaseline,
    FuzzClaudeCodeHook and FuzzSessionEnd (hook stdin), FuzzSettings (Claude Code
    settings edits) and FuzzServe (MCP request decoding). Every parser and decoder
    target uses the shared internal/fuzzcheck assertions: no panic, AD-26 size, depth and entry limits, and
    no warning, issue or message repeating 8 or more bytes of the input (AD-3). The
    fuzz inventory test fails when a registered decoder or parse format has no target
    and lists the Epic 5 parsers still pending (archives, image layers, importers,
    custom detectors, Codex and Cursor adapters). scripts/fuzz.sh gains --list,
    --matrix and a one-target mode (make fuzz-list) that fails a target go test
    cannot fuzz (build tag, wrong signature; make fuzz-selftest), and the CI fuzz job becomes
    the fuzz-short matrix: every target for 20 seconds in parallel, uploading any
    crasher (still only when the repository is public or run by hand). Fuzzing found
    one limit breach, now fixed: a surface key with invalid UTF-8 and a control
    character could grow past the 256-byte key limit when its characters were replaced.
    The MCP server now writes every JSON-RPC error response as a fixed line without
    data: errors the SDK builds itself (an unknown method, a malformed request, an
    unknown prompt or resource) used to echo the method name or a parameter.

  • Release gates and post-publish install checks (Story 4.18).
    .github/workflows/release-gates.yml runs on release-please pull requests and fails
    naming the gate, the measured value and the threshold unless every v1.0 gate passes:
    the benchmark reproduced from a clean checkout with precision_verified >= 0.95 and
    TokenHound recall at or above the gitleaks and TruffleHog union (pending until
    benchmark/ is in the repository), at least 85% coverage on each core package,
    the OpenSSF Scorecard score (recorded only), the AD-3 leak test, the dash lint,
    no-benchmark-tag, the reproducible build, and the golden inventory (every provider
    pattern and surface has a golden; go test ./... passed on ubuntu, macos and
    windows for the release commit). It uploads gates-summary.json; making it a
    required check is in docs/security-setup.md. .github/workflows/post-publish.yml
    runs after a release, daily as a retry and by hand: it installs exactly the release
    from every v1.0 row of the new docs/data/install-matrix.yaml on each listed runner
    (npm npx, PyPI uvx and pipx run, Homebrew, Scoop, Docker, go install, the
    GitHub Action from dist/github-action at the release tag and the cosign verify-blob-checked download), runs version and a
    fixture history scan, marks a channel that has not caught up pending (never
    passed), retries it daily for up to 7 days, and opens or updates a release-blocker
    issue and the job summary table. The logic is the new tools/gates
    (run, evaluate, plan, report, fixture, check-version, check-scan)
    with threshold edge tests; each install is scripts/post-publish-install.sh, with a
    self-test on fake channel tools (scripts/post-publish-install-selftest.sh, in
    make workflow-check). tools/covercore also gates pkg/report,
    internal/fixplan, internal/candidate and internal/warnx and gains -json;
    scripts/cover-library.sh can write its total (COVER_TOTAL_OUT); the dotenv
    surface gets a golden (surfaces-project.golden); tools/workflowcheck allows
    no write scope in release-gates.yml and only issues: write in
    post-publish.yml.

  • Generated and checked README (Story 4.16): make readme-gen (tools/readmegen)
    regenerates the badge row (a fixed list plus docs/data/badges.yaml; a badge whose
    status is pending is not shown, so the OpenSSF Scorecard badge is hidden until its
    first published score), the demo block, the surfaces table (one row per agent from
    the surface registry, macOS paths, with a pointer to the other OSes), the providers table (verified when the registry has a verify
    block, otherwise detected) and the install matrix, now generated from the new
    docs/data/install-matrix.yaml (npm, PyPI, Homebrew, Scoop, Docker, go install,
    the GitHub Action and release binaries, with platforms; every one is required). make readme-check, part of
    make ci and the CI workflow lint job, fails on block drift, on a missing, extra
    or moved README section (readme-order), on a quickstart that is not exactly the
    three commands, on a prevention claim in "What it prevents and what it does not"
    that the policy section of docs/hooks/policy.md does not list (or a policy limit
    the README leaves out; fenced lines count), on any other README sentence that says
    hooks block or prevent keys without the policy's "live and high-confidence keys", on a key-shaped string in the README or the demo tape output
    log (AD-3), and on a demo GIF of 5 MB or more or longer than 15 seconds.
    make link-check (tools/linkcheck) checks every relative link and #anchor in the
    tracked Markdown files offline with GitHub's heading slug rules.

  • Demo GIF setup for the maintainer: the VHS tape docs/media/demo.tape,
    scripts/demo-env.sh (a sandboxed HOME and project seeded from disposable keys in
    DEMO_OPENAI_KEY, DEMO_ANTHROPIC_KEY and optional DEMO_GROQ_KEY, printing no key;
    exit 2 when a key is missing or the directory is inside a git work tree, and the
    sandbox is deleted when the script fails) with a self-test on generated test keys
    (make demo-env-selftest), and the recording checklist
    docs/media/README-recording.md (revoke the keys right after recording and re-run to
    confirm they are dead). Until the GIF is recorded the README keeps the synthetic
    text output; once docs/media/demo.gif and its log exist, the README shows the GIF
    with the final headline as alt text.

  • Generic false positive rules (Story 4.21): the generic entropy detector no longer
    reports bare hex of a sha224, sha384 or sha512 length, bare hex of an md5, sha1 or
    sha256 length assigned to a name with a hash word (token_sha256), a UUID
    assigned to a name with an id word (token_id), or a cut-short provider key: a
    value starting with a registry prefix, shorter than that pattern allows, with only
    the pattern's own characters after the prefix. Session, JWT and Datadog hex
    secrets, UUID API keys and other keys that only share a prefix (Stripe sk_live_,
    sk-ant-oat01-, sk-None-, proxy sk- keys) are still found. Provider detectors
    are unchanged. See docs/detection.md.

  • Launch artefacts (Story 4.17), drafts only, under docs/launch/: the benchmark
    write-up, "What your coding agent remembers" (tools/genremembers, generated from
    the surface registry: files per OS, format, fields that can hold keys and the
    registry note of every agent surface), the launch video shot list and recording
    checklist, and post drafts for Show HN, X, LinkedIn, dev.to, emails to TLDR Sec,
    TLDR AI, Latent Space and Changelog, and pull request texts for awesome-security,
    awesome-devsecops, awesome-claude-code and MCP server lists. make launch-render
    (tools/launchrender) renders them from docs/launch/templates/, where every
    number is a placeholder read from docs/benchmark/results.json, the registry or
    the share card (the video recording parameters in templates/video.yaml are
    readable only by the video script, and that file accepts only those keys), and
    renders the share card docs/launch/share-card.png (totals only, no repository
    name, labelled "Demo scan, generated test keys"; its alt text, starting "Demo:",
    is in every draft) from the demo fixture scan: the README demo sandbox seeded with
    generated test keys and scanned by a benchmark build. Rendering exits 2 naming the
    template when results.json no longer supports a comparison its prose states
    (TokenHound's precision below TruffleHog's, more false alarms, recall at or above
    the combined recall, an identical gitleaks tuned row). make launch-check, part
    of make ci and the CI workflow lint job, fails on drift, on a literal number
    in launch prose no placeholder produced (dates, versions, list numbering, code and
    URLs excepted, except that a percentage, dollar amount or multiplier in code in a
    post or the write-up still fails), on a block, prevent, stop, deny or protect
    claim without the policy's "live and high-confidence keys" or an absolute claim
    such as "stops every leak" (a negation counts only when it governs the verb), on a
    key-shaped string, a dash, an emoji or other non-ASCII text, and on a draft that
    does not lead with numbers, does not state the benchmark's bias in the paragraph
    of its first cited result or the next one, lacks the share card alt text, or
    names an event or a launch date. The README hook-claims and leak checks moved to
    tools/mdcheck, shared by tools/readmegen and tools/launchrender, with a
    stricter split: a numbered list item is now its own unit, as bulleted items were,
    so a claim in one is reported on its own line.

  • Benchmark republished at a new seed (Story 4.21): the agent leak benchmark ran
    again on 2026-11-19 at seed 20261119, which the generic rules were never tested
    against, with TokenHound pinned to the commit carrying them. TokenHound
    precision rose from 93.15% to 96.41% (false alarms 77 to 39) with recall still
    100%; the README block and docs/benchmark/results.json are synced, METHOD.md
    records both seeds, and the 2026-11-18 run stays published.

  • v1.0 adoption suite and the v1.0.0 cut (Story 4.19). e2e/adoption/ (build tag
    e2e, make e2e-adoption, the new CI e2e-adoption job on ubuntu and Windows,
    plus macOS once the repository is public) has one end-to-end test per v1.0
    adoption-blocker promise of the PRD: verification by default, confidence,
    .tokenhound-ignore, inline tokenhound:allow, baseline and --new-only; staged
    files, full history on all branches, --since, notebooks and agent surfaces;
    verification only to registry verify hosts with read-only requests, rate limits,
    zero network calls with --no-verify and no full key in any output; the fix plan;
    SARIF, JSON and GitHub annotations; the Claude Code pre-tool and session-end hooks,
    the MCP server and the agent skill; the GitHub Action, pre-commit, Husky and
    lefthook; the badge and share card; and an egress recorder (a strict CONNECT proxy)
    that sees only the issuing provider's verify host and nothing from offline commands
    or the hook with verification off. The tests drive the built binary (a benchmark
    build answers live keys from ground truth) or the public library, on generated
    keys, and a failure names its row and promise. The release gates' e2e jobs run the
    suite on the release commit on all three operating systems.
    docs/release/v1-checklist.md links every PRD adoption blocker and NFR1 to NFR10
    to its test, gate job or file and its latest passing run, with the Epic 5 rows
    marked v1.x and their closing story; tools/checklistcheck (make checklist-check, in make ci and the CI workflow lint job) fails when a row has
    no evidence, a cited test, job or file does not exist (a test counts only with the
    go test signature in a file some build compiles), a blocker row cites an adoption
    test of another blocker, or an adoption test is cited by no row. Release notes now hold the CHANGELOG section, the benchmark table from
    docs/benchmark/results.json (benchsync -notes), the cosign verify-blob,
    sha256sum and cosign verify commands, the install matrix
    (readmegen -install-table -version X.Y.Z, which pins the Action row to the release being cut) and the registry contributor credits
    (changelogrelease notes -repo), and the release job fails before publishing notes
    when any of them is missing. docs/releasing.md gains "Cutting v1.0.0" and
    "Rollback". The evidence reference resolver of tools/threatmodelcheck moved to
    tools/internal/evidence, shared with the checklist check.

  • Agent and account token patterns (Story 4.25), registry snapshot 2026.11.26:
    Anthropic oauth-token (Claude Code sk-ant-oat01- tokens from claude setup-token,
    usually in CLAUDE_CODE_OAUTH_TOKEN) and session-key (claude.ai sk-ant-sid01-
    session keys), and OpenAI none-key (sk-None- keys with the T3BlbkFJ marker).
    All three are high confidence provider findings with a provider fix plan, so the
    Claude Code hook blocks them with verification off; before, only the generic
    detector found them. Their lengths are not documented, so the Anthropic patterns
    take a wide length range and match a longer token whole. The OpenAI key is verified
    and priced like every OpenAI key; the two Anthropic patterns are detect only (no
    documented read-only endpoint accepts the OAuth token, and a session key is never
    replayed) and unpriced (no metered API billing). Their fix plans point to claude.ai
    Settings: revoke the OAuth token under Claude Code (or in the Claude Console
    organization that created it), and log out of all devices under Account for a
    session key. The hook message suggests $CLAUDE_CODE_OAUTH_TOKEN for an OAuth token
    and no variable for a session key. The provider schema gains pattern detect_only
    (which excludes a pattern verify block), unpriced and a pattern fix block
    (revoke_url, revoke_note, replace_note, usage_url, env_vars); the Report
    gains detectors.<id>.revoke_url, env_var and no_env_var, used by the SARIF
    rule help. See docs/detection.md and docs/spend.md.

  • --verify turns verification on for one run, over verify: false in a config file
    and TOKENHOUND_VERIFY=false (Story 4.26). With --no-verify it is a usage error.

  • TOKENHOUND_HOOK_MISSING=allow lets a git hook whose tokenhound is not on PATH
    through with a warning (see below).

Fixed

  • CLAUDE_CONFIG_DIR is honoured wherever TokenHound looks for Claude Code's user
    configuration (Story 4.26), as Claude Code resolves it: ~/.claude/<rest> becomes
    $CLAUDE_CONFIG_DIR/<rest> and ~/.claude.json becomes
    $CLAUDE_CONFIG_DIR/.claude.json. hook install --claude-code and
    hook uninstall --claude-code change $CLAUDE_CONFIG_DIR/settings.json and name
    that path in their output; the session-end scan reads the moved settings,
    .claude.json and transcripts; tokenhound, scan, agents and the other
    machine scans read the moved files too, located as $CLAUDE_CONFIG_DIR/... when the
    directory is outside home (~/... when it is inside). A relative
    CLAUDE_CONFIG_DIR, or one that exists but is not a readable directory, makes
    hook install and hook uninstall exit 2 naming it; scans read ~/.claude then
    and warn (surface_parse_failed, location CLAUDE_CONFIG_DIR, detail
    config_dir_relative; the session-end scan prints and records
    config_dir_relative). Before, the hook went to ~/.claude/settings.json, which
    Claude Code never read.

Changed

  • The tap-publish job pushes the Homebrew cask and the Scoop manifest over SSH with
    one write deploy key per repository (HOMEBREW_TAP_DEPLOY_KEY,
    SCOOP_BUCKET_DEPLOY_KEY in the tap-publish environment) instead of fine-grained
    personal access tokens (Story 4.28). scripts/tap-publish.sh push writes the key
    with umask 077 to the job's temp directory, removes it on exit, masks it in git's
    output, and runs ssh with only that key, no agent and strict host key checking
    against GitHub's host keys pinned in scripts/github-known-hosts; a changed host
    key fails with a message to update that file. The HTTPS token path stays as the
    fallback when no deploy key is set. tools/workflowcheck confines the deploy key
    names to the tap-publish job like the token names, and docs/releasing.md
    explains creating the keys with gh repo deploy-key add --allow-write and
    gh secret set --env tap-publish, and rotating them.

  • Each translated README says the English README may be more up to date, for
    example in the benchmark results and install commands.

  • The six npm platform packages move to the @tokenhound organization scope
    (Story 4.27): @tokenhound/darwin-arm64, @tokenhound/darwin-x64,
    @tokenhound/linux-arm64, @tokenhound/linux-x64, @tokenhound/win32-arm64 and
    @tokenhound/win32-x64, the esbuild layout. Claiming six unscoped
    tokenhound-<os>-<arch> names in a minute tripped npm's spam detection. The main
    package is still tokenhound and the command is still npx tokenhound; the
    launcher resolves only the scoped names, and build.mjs, publish.mjs (including
    bootstrap, which publishes each missing name once with --access public), the
    npm install e2e and docs/releasing.md use them. docs/releasing.md adds creating
    the free npm organization tokenhound first, lists the seven packages to configure
    for trusted publishing, and gives the npm deprecate commands for the four unscoped
    0.0.0 placeholders published before the stop.

  • The managed git pre-commit and pre-push hooks fail closed (Story 4.26). The script
    runs tokenhound from PATH, else the binary that ran hook install (its absolute
    path is recorded, so GUI git clients with a short PATH keep working); when neither
    is found it blocks the commit or push with two lines naming the fix (install
    TokenHound, or git commit --no-verify / git push --no-verify to skip once)
    instead of printing "scan skipped" and letting it through.
    TOKENHOUND_HOOK_MISSING=allow lets it through with a warning instead. The marker
    is now # tokenhound-managed v2; a v1 hook from an earlier release is still
    recognised, and tokenhound hook install --pre-commit (or --pre-push) replaces it
    in place and says the earlier hook let commits through.

  • After a scan with verification off, the Next: line says why and ends with the
    scan again with --verify, so the pasted command runs in any shell:
    Next: verification was off; to check which keys are live run: tokenhound scan . --verify.
    report --from names tokenhound scan --verify.

  • The headline of a scan whose keys are all dead says where they are, by the source:
    still in history (a commit), staged (only staged changes, as with
    scan --staged), in the working tree (a repository's files), else found. It
    said still in history for every dead key.

  • Dependabot opens one pull request a week for every ecosystem (Go modules, GitHub
    Actions, npm, pip and the Docker base image) through a multi-ecosystem group,
    instead of one per ecosystem.

  • scripts/repo-settings.sh also allows GitHub Actions to create pull requests (the
    default token stays read): release-please needs it to open the release pull
    request, and the first Release run on main failed without it.

  • The README is rewritten for a first-time visitor (Story 4.24), in the order: the
    one-line value, the demo, Quickstart, what you get (Find, Prove, Prevent, Fix), why
    not just ask your agent, the benchmark, what it scans, install, CI and hooks,
    privacy and safety, contributing. Pipeline stages and package boundaries move to
    the docs linked from Contributing; readme-order encodes the new order.

  • The README benchmark block (tools/benchsync, also the release notes -notes) is
    in plain language: a headline of how many of the planted keys each tool found, one
    row per tool at its default config with keys found (as "N of M (P%)"), keys missed
    and false alarms (no precision, recall or F1 column, so a quiet tool that misses
    most keys does not look best; no repeated tuned rows, no row or internal id for a
    tool not run yet), what the numbers mean, a "Where others do better" line
    generated from the data that puts a fewer-alarms win next to the keys that tool
    found, and the by-construction bias. The technical table stays in
    the benchmark's RESULTS.md. The coding-agent baseline table uses the same columns.

  • Prevention claims match their mechanism: only the Claude Code hook blocks live and
    high-confidence keys; git hooks and the GitHub Action fail on fail_on, live keys
    by default (add not-verified, unknown and rate-limited to fail_on.status
    for unverified keys). The hook-claims check (tools/mdcheck, used by
    readme-check and launch-check) is now an allowlist checked clause by clause
    (code spans left out, table rows split into cells, a ", and" clause split off only
    when it names another mechanism): a blocking claim must say "live and
    high-confidence keys" and name the Claude Code hook. A claim for git hooks,
    commits, pushes, pull requests, husky, lefthook, the Action, CI or generic "hooks"
    fails, and the message says to use fail wording.

  • The README and translated Quickstarts install the Claude Code hook with
    --command "npx tokenhound", so the hook works for an npx user with no
    tokenhound on PATH. readme-check also checks every hand-written "N providers
    that support it" against the registry's verified provider count.

  • The agent leak benchmark moved into this repository (Story 4.22): benchmark/,
    imported with its history (git subtree), is its own Go module
    (github.com/aiagentpro/tokenhound/benchmark), so the product module gains no
    dependency. It builds TokenHound and tools/testkeys from the same checkout: the
    commit pinned in benchmark/tools.lock (tokenhound.commit, in the history of
    HEAD) is exported with git archive and built there, so the private-module setup
    (GOPRIVATE, the TOKENHOUND_READ_TOKEN CI secret, the module checksum rule in
    tools.lock) is gone. The published 2026-11-18 results are unchanged and
    make -C benchmark reproduce still matches them exactly. Its CI runs as the
    benchmark-* jobs of ci.yml (unit tests and self-scan, the small-seed bench, the
    fake-agent baseline pipeline, reproduce, the corpus hash on every OS), which
    tools/workflowcheck requires to check out the full history; it also rejects the
    old token, GOPRIVATE and model provider keys in any workflow. make bench-sync
    reads benchmark/results/ by default, the README benchmark links are relative
    (benchmark/results/<date>/RESULTS.md, benchmark/METHOD.md), make bench-test
    (in make ci) and make bench-reproduce delegate to benchmark/, and
    benchmark/build/ is gitignored at the root. See
    docs/adr/0007-benchmark-in-repo.md.

  • README: the install table moved into the generated install-matrix block,
    "What it prevents and what it does not" now lists the hook's limits as the policy
    does, and every other block or prevent claim says "live and high-confidence keys".

  • The distribution channel sources moved from packaging/ to dist/ (npm, PyPI, Scoop,
    the GitHub Action). GoReleaser now writes its build output to bin/release/.

  • The GitHub Action is used by path from this repository,
    uses: aiagentpro/tokenhound/dist/github-action@vX.Y.Z (or a commit SHA), instead of
    a separate aiagentpro/tokenhound-action repository. There is no moving @v1 tag
    and no Marketplace listing. Its self-test moved from the nested
    dist/github-action/.github/workflows/test.yml to the action-selftest job of
    .github/workflows/ci.yml (uses: ./dist/github-action), and communitycheck
    requires the example workflow to pin the path to a release tag or a commit SHA.

  • The public Go packages moved under pkg/: the library is now imported as
    github.com/aiagentpro/tokenhound/pkg/tokenhound (still package tokenhound), and
    model, report and config as pkg/model, pkg/report and pkg/config. No Go
    file sits at the module root. The CLI, the JSON Report and exit codes are unchanged.
    See docs/adr/0006-repository-layout.md.

  • The GitHub Action source moved to packaging/github-action/, the release-please
    files to .github/, and RELEASING.md to docs/releasing.md.

  • The README is a landing page with install, Action, hooks, MCP and skill setup; the
    full CLI reference moved to docs/cli.md and the configuration reference to
    docs/configuration.md. README translations in Simplified Chinese, Japanese,
    Korean, Spanish, Brazilian Portuguese, German and French are in docs/i18n/, with a
    docs index (docs/README.md) and .github/SUPPORT.md.

  • The gha format writes at most 10 annotations per level (GitHub's per-step limit)
    in Report order; when it leaves lines out, it ends with one
    ::notice title=TokenHound::<N> more annotations not shown ... notice. Every
    finding stays in SARIF and JSON.

  • tokenhound hook install|uninstall --pre-commit|--pre-push installs git hooks that
    run tokenhound scan --staged before each commit and tokenhound scan --pre-push
    before each push. Single owner: the hook is written to the repository's hooks
    directory (the common dir in a linked worktree) only when no manager owns the hooks;
    with Husky, lefthook, the pre-commit framework or any core.hooksPath, nothing is
    written and the manager's snippet is printed. An existing hook is chained through
    <hook>.tokenhound-chained and restored byte for byte on uninstall. Without
    tokenhound on PATH the hook prints one line and exits 0. See docs/hooks/.

  • scan --pre-push scans only the commits being pushed, from git's pre-push lines on
    standard input or PRE_COMMIT_FROM_REF/PRE_COMMIT_TO_REF; invalid input exits 2.

  • .pre-commit-hooks.yaml with the tokenhound and tokenhound-pre-push hooks.

  • Library (additive): HistoryOptions.Until (the tip commit) and
    HistoryOptions.ExcludeRemotes (leave out commits reachable from refs/remotes/*).

Changed

  • --staged on scan, baseline, fix and report now scans only the staged changes (plus
    history with --history or --since), not the working tree, and reads the index in
    GIT_INDEX_FILE when git sets it for a hook. The bare tokenhound command is
    unchanged.

  • The terminal summary follows the EXPERIENCE.md layout: meta line, blank line, the
    headline, rows and Why/Next sections indented two spaces and separated by blank
    lines, dollars right-aligned, the partial-results banner first, and thousands
    separators on every count and dollar figure. The clean headline names commits only
    when history was scanned (No AI keys found in 4,812 files. Grade A.). Not-verified
    rows always print UNVER (no more NOT VERIFIED in the summary). Next: is now one
    runnable command from an ordered table: tokenhound fix <id> for the first live key,
    the same scan rerun without --no-verify for unverified keys, tokenhound fix <id>
    for a dead key (preferring one in commit history), else tokenhound hook install.
    The width comes from COLUMNS, else the terminal size. git_not_found now reads
    git not found: .gitignore not applied. report.TerminalOptions adds Rerun.
    The tokenhound fix header uses the same status words (LIVE, DEAD, UNKNOWN,
    RATE-LTD, UNVER), so NOT VERIFIED is gone there too. A summary re-rendered by
    tokenhound report --from names a plain tokenhound scan as its rerun, since
    rerunning report --from would verify nothing.

  • The FixStep shape changed from {kind, text, url, command} to the fix plan shape
    above, and the library type alias tokenhound.FixPlan was renamed
    tokenhound.FixPlanResult (the name FixPlan is now the function).

  • dollars_method in the Report now lists formula, tier, tier_source, assumed,
    limit_per_min, limit_source, limit_unit, unit_price_usd, price_unit_size,
    model, cap_usd_per_day and spend_as_of.

  • The detect winner rule now ranks provider detectors before the generic detector,
    then keyword context, computed confidence and id. Keyword context also counts on
    the line before and after a match.

  • The registry's YAML parsing, schema validation and file:line: field: message
    issues moved to internal/yamlschema, shared with the config loader; registry
    output is unchanged.

  • The Finding and Report model moved to the public model package; the root
    package re-exports every identifier with type aliases, so existing code compiles
    unchanged. New lint rules keep model a leaf and keep internal packages off the
    root package.

  • Grading (internal/grade, adapter default, replacing minimal): per target, first
    match wins, F for a live key when the summed live dollars_at_risk_per_day (integer
    cents) reaches grade.f_threshold_usd_per_day (default 500, from config through
    GradeOptions) or the target is public, D for any live key, C for an unverified
    high-confidence key, B for any other finding, A for none; suppressed findings and
    unknown visibility never count as live or public. Every target grade and the
    overall grade_reasons carry strings of the form code: ASCII sentence with the
    codes live_over_threshold, live_public, live_key,
    unverified_high_confidence, other_finding and clean.

  • Terminal summary rewritten as a pure function of the Report and
    report.TerminalOptions: meta line, headline sentence (2 live keys, $3,100 a day at risk, grade D), ranked rows with dollars, Why <G>: reasons, one Next: line from an
    ordered rule table, and the clean, only-dead, offline, rate-limited, partial-results,
    git-not-found and skipped-files wording. scan gains --all; --plain and --quiet
    now shape the summary; colour, width and the stderr scanning... progress line are
    decided in the CLI from the TTY, NO_COLOR, TERM, COLUMNS, --no-color and CI.

  • Report meta gains the optional verification (on or off), history_scanned
    and commits_scanned fields (additive, in docs/schema/report.v1.json);
    Results.Progress() returns the files and commits scanned so far.

  • Surface registry and source (snapshot 2026.11.13.4): registry/schema/surface.json,
    registry/surfaces/ with claude-code and claude-code-transcripts,
    Registry.Surfaces() and Registry.Surface(id), structure-aware parsers for json,
    jsonc, jsonl, toml, yaml, ini and dotenv with field selectors
    (permissions.allow[], env.*, mcpServers.*.env.*, ** leaves) and real line
    numbers, and the surface source adapter (engine.SourceSurface, scopes machine
    and project): per-OS path resolution, root-confined project files, streamed jsonl
    transcripts and one chunk per entry with a surface Location (surface_id, path,
    line, field) so two-part credentials in one MCP env block pair. New warning code
    surface_parse_failed (details parse_error, unsupported_format). No CLI flag or
    command uses it yet; see docs/surfaces.md. make leak-test now also covers a surface
    scan.

  • The CI and make self-scan self-scan now reads the full git history
    (--history), not only the working tree.

  • tokenhound version from a go install build prints the module version without
    the leading v (1.2.3, not v1.2.3), like every other channel.

Added

  • Git scanning: tokenhound scan --history, --since <ref> and --staged through
    internal/gitx, the only package that runs git (hardened flags and environment,
    validated refs, streamed git log -p with post-image line numbers). Findings get
    commit or staged locations, and first_seen (earliest commit, author, date) and
    age_days relative to meta.generated_at. Library: tokenhound.History,
    tokenhound.Staged, Options.IncludeIgnored, Options.Now. See docs/git.md.
  • Inside a git work tree a plain scan now reads what git would commit (tracked plus
    untracked files that are not ignored) and skips ignored trees; --include-ignored
    restores the full walk. New warning code git_not_found when a repository is walked
    without git. A new lint rule keeps exec.Command out of everything but internal/gitx
    and scripts.
  • Core agent surfaces and the agents command: surface entries codex, codex-auth,
    codex-transcripts, cursor, cursor-settings, shell-history-bash, -zsh, -fish,
    -powershell, dotenv and npmrc; a tolerant shell-history parser for bash, zsh
    (extended), fish and PowerShell files; tokenhound agents (an "Agents checked" table of
    every machine surface as found, not installed or unreadable, then the usual summary);
    bare tokenhound now scans the machine surfaces plus, inside a git repo, the project
    surfaces and the working tree (history only with --history), and outside a repo prints
    Not in a git repo: scanned this machine's agent surfaces only.;
    tokenhound providers --surfaces. The Report gains the optional surfaces_checked[] {surface_id, status} (additive, schema version 1). Library: tokenhound.MachineSurfaces()
    and tokenhound.ProjectSurfaces(root), Report.SurfacesChecked,
    report.TerminalOptions.NotScanned. Behaviour changes: a dotenv file skips lines that are
    not KEY=value and gives one surface_parse_failed warning with the new detail
    partial_parse instead of being rejected whole; the project walk skips node_modules,
    stops after 200000 entries (walk_limit) and a project scan rooted at the home directory
    is skipped; a surface path that is a symlink or other non-regular file is reported
    unreadable with a file_unreadable warning (not_regular_file); a .env read by both
    the working tree and the dotenv surface is one location of kind surface. tested_version
    values are from vendor docs and unconfirmed. See docs/surfaces.md.
  • Claude Desktop, VS Code MCP, Gemini CLI (settings and .env), Windsurf and Jupyter surfaces
    (claude-desktop, vscode-mcp, gemini-cli, gemini-cli-env, windsurf, jupyter,
    jupyter-config) and the ipynb parse format: surface entries using it are no longer skipped
    with unsupported_format. A notebook checkpoint (**/.ipynb_checkpoints/*.ipynb) is read one
    line per value with the cell source and text outputs, and each Location carries the 1-based
    cell and the line within the cell (kind stays surface). A corrupt notebook gives one
    surface_parse_failed warning. New fuzz target FuzzParseIPYNB. tested_version values are
    from vendor docs and unconfirmed. See docs/surfaces.md.
  • Notebook source: a .ipynb file reached by the working tree walk is read with one shared
    nbformat reader and emitted as one chunk per cell source and per cell outputs, each with a
    notebook Location (path, 1-based cell, line within the cell source or the cell
    outputs). A key split across lines inside one cell behaves as in a plain text file. A corrupt
    notebook falls back to a raw text scan with one new notebook_parse_failed warning (detail
    parse_error). The reader is streaming: image and other non-text data payloads, metadata
    and attachments are never retained, limits.max_file_bytes applies to the retained text
    (the raw .ipynb may be up to 8 times larger; beyond that, or beyond the text limit, one
    file_too_large warning), and ANSI escape sequences are stripped from outputs, in the
    jupyter surface too. A notebook location and a surface location at the same cell and line
    collapse into the surface one. New fuzz target FuzzReadNotebook. A notebook with several
    non-empty cells counts as several files in meta.files_scanned. See docs/surfaces.md.
  • Binary, oversize, partial and deterministic scans (Story 1.23). Files with a NUL byte in
    their first 8 KiB (working tree and surface files; not stdin, git history or staged lines, and
    not .ipynb) are skipped without a warning and counted in the new optional Report field
    meta.binary_skipped (additive, schema version 1; also shown in the terminal meta line). The
    binary check runs before the size check, so a huge image is a quiet skip. Decision: a file over
    limits.max_file_bytes is still skipped with file_too_large (no scan of a prefix, because a
    key cut at the boundary would be wrong or missed silently); with CI=true, fail_on.warnings
    now defaults to [timeout, file_too_large] and a project tokenhound.yaml cannot drop either
    (ADR 0002). Surface statuses gain not_visited: a scan stopped by a timeout or cancel no longer
    reports unvisited agents as not_installed (agents prints "not visited"). Surface walks of
    one run share one 200000-entry budget, one source reads at most 64 times
    limits.max_file_bytes of surface files (new surface_parse_failed detail budget), and each
    surface file is read once per run, deduped by resolved path. A corpus test over a generated
    repository (working tree, stdin, history, staged, machine and project surfaces, notebooks)
    proves the --deterministic JSON Report is byte-identical across runs, worker counts, source
    order and OSes, against internal/engine/testdata/determinism/report.golden.json
    (.gitattributes never converts it). New make cover-core (tools/covercore, COVER_MIN,
    default 85) and a CI coverage job fail when a core package is below 85% statement coverage.
    Library: tokenhound.SurfaceNotVisited, Meta.BinarySkipped. See docs/adr/0002, README.md
    and docs/surfaces.md.
  • Suppression with .tokenhound-ignore and inline tokenhound:allow (grammar in
    docs/schema/ignore.v1.md). Ignore rules path:<glob> (with **), loc:<path>:<line>,
    id:th_<16 hex> and detector:<id>, # comments, CRLF and a BOM accepted; paths are
    relative to the ignore file and matched case-sensitively against Location paths. The
    project file is <root>/.tokenhound-ignore or ignore_file (a configured file that is
    missing exits 2; the default being absent is silent; a project file resolving outside the
    root through a symlink exits 2); <user config dir>/tokenhound/ignore holds rules for
    machine locations. A malformed line exits 2 with <file>:<line>: <message>, never
    echoing the rule. tokenhound:allow (any finding) or tokenhound:allow th_<id> on the
    match line or the line above suppresses that location, in working tree files, stdin,
    staged and history diffs, notebook cells and surfaces. id:, detector: and the test
    marker suppress the whole finding; path:, loc: and inline markers only when every
    location is covered, so a key also in an unignored file stays active and is verified.
    Candidates whose first location is covered wait for the end of detection before verify,
    so ignored keys are never verified. suppression_reason is the closed enum ignore_id,
    ignore_detector, ignore_path, ignore_loc, inline_allow, test_marker,
    imported_allowlist (first wins), now in report.v1.json. Library:
    Options.Ignore, IgnoreRule, IgnoreKind, IgnoreScope, the Reason* constants,
    SuppressionReasons(), ErrInvalidIgnoreRule; config.Load fills Options.Ignore.
    Breaking: the generated test key reason test_key is now test_marker, and the
    terminal count line is <n> suppressed (see --format json).
  • Baselines: tokenhound baseline [path] (terminal and json formats) scans like
    scan with verification off, never reads an existing baseline and writes the
    unsuppressed findings to .tokenhound-baseline.json at the scan root or the baseline
    config path (docs/schema/baseline.v1.json: schema_version, tool_version,
    registry_snapshot, findings[{id, provider, detector, redacted}] sorted by id; no
    status, locations or timestamps; mode 0600), printing Wrote <n> findings to <path> or
    {"path", "count"}. Scans read the baseline and the suppress stage sets
    new_vs_baseline on every unsuppressed finding from its final id (absent without a
    baseline and on suppressed findings); baselined findings are still verified and graded.
    scan --new-only and the bare command's --new-only, user-tier new_only and
    TOKENHOUND_NEW_ONLY leave baselined findings out of fail_on, with the terminal line
    <n> baselined findings not counted for failure (--new-only); a project-tier
    new_only: true is ignored (untrusted_config_key, gate_loosening). Without a baseline
    file, --new-only adds the new warning code baseline_missing and every finding counts.
    An invalid or newer baseline exits 2 with <file>: <field>: <message>; a project or
    default baseline path that leads outside the root through a symlink exits 2. Library:
    Options.Baseline, Baseline, BaselineFinding, BaselineSchemaVersion,
    FailOn.NewOnly, CodeBaselineMissing, ErrInvalidBaseline; config.Load fills
    Options.Baseline (skip with Input.SkipBaseline), config.BaselinePath and
    config.Flags.NewOnly; report.TerminalOptions.NewOnly.
  • tokenhound report [path|-] [--from <report.json>]: re-renders a saved Report
    (--from <file|->, validated against docs/schema/report.v1.json; no scan and no
    network call) or a new scan of path with the scan flags and --new-only, in any
    registered format, and exits by fail_on on the Report (0 or 1; 2 for usage and
    input errors). Without --format it writes the JSON Report to -o (default
    ./tokenhound.json, mode 0600) and prints Wrote <file>. Output routing is shared
    with scan, agents and the bare command: one format goes to stdout or -o <file>,
    several need -o <dir> and are written under each format's file name
    (tokenhound.json; terminal goes to stdout), and the summary goes to stderr when
    stdout carries no terminal output, unless --quiet. A binary format alone with no
    -o and a terminal stdout exits 2. The report package gains a format registry:
    report.Lookup and report.FormatInfo (name, -o <dir> file name, binary), and
    report.Formats() and Render read it. sarif (tokenhound.sarif), gha
    (tokenhound.gha.txt, with --new-only passed through), card
    (tokenhound.png, binary) and badge (tokenhound.svg) are registered, so they now
    work on scan, agents, report and the bare command; report also takes
    --card-label, and a card bound for a terminal exits 2 with
    PNG output needs -o <dir> or a redirect. Every JSON golden in the repository is validated
    against report.v1.json or baseline.v1.json (tests/schema).

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.0/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.0 --certificate-identity https://github.com/aiagentpro/tokenhound/.github/workflows/release.yml@refs/heads/main --certificate-oidc-issuer https://token.actions.githubusercontent.com

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.0 macOS, Linux and Windows; amd64 and arm64
Binaries Releases, with checksums.txt and its cosign bundle macOS, Linux and Windows; amd64 and arm64

Contributors

Registry contributors

Thanks to everyone who improved the provider registry in this release: