TruffleHog
Finds secrets in git history, files, images and CI logs, and checks each one against its vendor's API.
github.com/trufflesecurity/trufflehog ↗- Stars
- ★ 28,779
- License
- AGPL-3.0
- Language
- Go
- Latest release
- v3.99.7 · 24 Oct 2026
- Last push
- 30 Oct 2026
- OpenSSF Scorecard
- 7.9 / 10
Tells you which leaked secrets still work, which cuts triage, but verification sends each candidate to its vendor.
Note: this page is AI generated. Read the tool's own repository and documentation, linked at the bottom, before you rely on it.
How it works
TruffleHog has a detector per credential type, several hundred in all, each with a regex and keywords. It scans git history, a directory, a container image, S3 buckets, CI logs and more.
For each match the detector makes a harmless API call to the issuing service, for example AWS STS GetCallerIdentity or the GitHub user endpoint, and labels the result verified, unverified or unknown. --results=verified keeps only live ones.
Output is text or JSON. The GitHub Action scans the commit range of a push or pull request and fails on findings.
What it catches
- Live cloud keys, GitHub tokens and SaaS API keys in any commit
- Secrets deleted from HEAD but still in history
- Credentials baked into container image layers
- Which old leaks are still valid and need rotating first
Run it
brew install trufflehog
trufflehog git file://. --results=verified,unknown
# offline, no verification calls:
trufflehog git file://. --no-verificationIn GitHub Actions
- uses: actions/checkout@<sha> # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- uses: trufflesecurity/trufflehog@<sha> # v3.99.7
with:
extra_args: --results=verified,unknownWhat leaves your machine
Verification sends each candidate secret to the API of the service that issued it. --no-verification keeps the scan local.
Limits
- Verification uses the secret, which shows up in the owner's logs and can trip canary tokens.
- Unverified results still need review: a key can be valid but scoped to a network the scanner cannot reach.
- Scanning full history of large repositories is slow with verification on.
Links
Related tools
Related incidents
GitHub stats as of 30 Oct 2026. How ratings work.