examples/

directory
v1.0.0 Latest Latest
Warning

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

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

README

Examples

Copy-paste starting points. Each one is checked in CI (the examples job of .github/workflows/ci.yml, make examples-test locally).

Example What it does
github-actions/tokenhound.yml Scans pull requests with the TokenHound GitHub Action: one PR comment, annotations and SARIF
pre-commit/.pre-commit-config.yaml Blocks commits and pushes that add a leaked AI key, with the pre-commit framework
claude-code/ Blocks keys in Claude Code tool calls before they run, and scans the session when it ends
library/ Scans a directory from Go with pkg/tokenhound and prints each finding's redacted key and first fix step

Run the Go example:

go run ./examples/library            # scan the current directory, verifying keys
go run ./examples/library -offline . # no network call

CI runs it on generated fixtures (synthetic keys with the TOKENHOUNDTEST marker, AD-16), which is what -include-test-keys is for. Real keys never appear in this repository.

Directories

Path Synopsis
Command library is the Go library example (examples/README.md): it scans a directory with github.com/aiagentpro/tokenhound/pkg/tokenhound, prints one line per finding with the redacted key and the first fix step, then the grade, and exits 1 when it found a key.
Command library is the Go library example (examples/README.md): it scans a directory with github.com/aiagentpro/tokenhound/pkg/tokenhound, prints one line per finding with the redacted key and the first fix step, then the grade, and exits 1 when it found a key.

Jump to

Keyboard shortcuts

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