Code and secret leaks
TruffleHog
Secrets scanner for auditing your own repositories, buckets and images, with checks that confirm whether a found credential is still live.
29k stars · last push November 10, 2026 · v3.99.8 · AGPL-3.0
What it finds
TruffleHog scans your git history, GitHub and GitLab organisations, filesystems, S3 and GCS buckets, Docker images and other sources for leaked credentials. It classifies over 800 secret types. For each it can call the provider's API to report the result as verified, unverified or unknown.
- secrets
- API keys
- database passwords
- private keys
- cloud credentials
Does it touch the target?
Has a passive mode and active modes. The active modes need the owner's permission.
Scanning a local repo or directory (trufflehog git file://..., trufflehog filesystem) reads local data. Verification is on by default and calls each credential provider's API; README: "the AWS credential detector performs a GetCallerIdentity API call against the AWS API". --no-verification turns that off. Remote sources (github, gitlab, s3, gcs) query those platforms' APIs.
API keys: Local scans need no key; the README says unauthenticated GitHub scans are rate limited and suggests --token, and some sources (gitlab, circleci, travisci, postman) take a --token.
Install
brew install trufflehogFrom the project's documentation
git clone https://github.com/trufflesecurity/trufflehog.git
cd trufflehog; go installFrom the project's documentation
curl -sSfL https://raw.githubusercontent.com/trufflesecurity/trufflehog/main/scripts/install.sh | sh -s -- -b /usr/local/binFrom the project's documentation
How to run it
Examples use reserved documentation hosts such as example.com. Replace them with a domain you own or are authorised to test.
trufflehog git https://github.com/example-org/example-repo --results=verifiedFrom the project's documentation
trufflehog github --org=example-org --results=verifiedFrom the project's documentation
trufflehog filesystem path/to/file1.txt path/to/file2.txt path/to/dirFrom the project's documentation
trufflehog git file://. --since-commit main --branch feature-1 --results=verified,unknown --failFrom the project's documentation
Output formats: text (stdout), JSON (--json), legacy JSON (--json-legacy), GitHub Actions (--github-actions), SARIF (--sarif)
Limits the project documents
- Unauthenticated GitHub organisation scans are rate limited; pass --token to raise limits.
- Unverified results may be invalid, expired, or unchecked because verification was disabled.
- SARIF output is buffered in memory for the whole scan, so very large result sets use proportionally more memory.
- Deep analysis of a credential's permissions covers only about 20 of the most commonly leaked types.
Deepak's take
Analysis, not documentation
- Use it when
- Use it to audit your own organisation's repositories, buckets and images when you need to know which leaked credentials still work and should be rotated first.
- Skip it when
- Skip default verification when policy forbids any outbound call with a found credential; pass --no-verification or use Gitleaks, which documents no verification step.
- What it will miss
- It finds only secrets matching its detectors or your custom regex, and it cannot see repositories or stores you do not give it access to.
Facts read from the project's README and docs on November 10, 2026. Repository data as of November 11, 2026. Licence: AGPL-3.0. TruffleHog is a trademark or project name of its owners; this library is not affiliated with it.