Developer & Productivity Tools · Freemium
TruffleHog
TruffleHog is an open-source secret scanner from Truffle Security Co. It looks for credentials such as cloud keys, API tokens, database connection strings and private keys in Git history, working folders and many other places, and then tries to prove whether each one is live. The command-line tool is written in Go and licensed under AGPL-3.0 (since v3.0). Version 3.100.1 was released on November 23, 2026.
Who it is for: developers and security teams who want to know which leaked credentials are dangerous right now, not only which strings look like secrets. It is commonly run in CI on pull requests, as a scheduled audit of a whole organization, and as a pre-commit hook.
How it works. TruffleHog uses detectors, one per credential type; the project says it classifies more than 800 secret types. For most detectors it then performs verification: it sends the candidate to the provider's API (for example an AWS GetCallerIdentity call) and labels the result verified (confirmed live), unverified (detected but not confirmed) or unknown (the check failed because of a network or API error). By default all three are reported. The --results flag filters them, --no-verification turns the API calls off, and --fail returns exit code 183 when results are found. A separate analyze command maps what a live credential can access for the most common credential types.
Sources it can scan include local and remote Git repositories (including staged changes), GitHub and GitLab organizations, filesystems, Docker images, S3 and GCS buckets, and CI systems. Filesystem mode reads files on disk, including Git object files, so it can surface a key that was deleted from the current tree but still sits in .git.
Pre-commit use: the project documents two hook setups. The recommended one sets TRUFFLEHOG_PRE_COMMIT=1 (the pre-commit framework's PRE_COMMIT=1 and Husky are also detected) and lets TruffleHog choose hook settings; the manual one runs git file://. --since-commit HEAD --results=verified,unknown --fail. In a Metarix check on November 28, 2026, the two behaved differently: the automatic mode blocked a commit containing unverified fake keys, while the manual line let it through.
What it does not do well: it has no generic password rule, so a plain password string assigned to a variable is not reported unless a detector matches it. Verification sends candidates to third-party APIs and needs network access.
Pricing type: freemium. The open-source CLI is free. TruffleHog Enterprise adds continuous monitoring of tools such as Slack, Jira and Confluence, a dashboard, SSO and support; pricing is by quote.
Alternatives: Gitleaks and its successor Betterleaks (regex-first, MIT-licensed, validation optional), GitHub Secret Protection for server-side push protection, and commercial platforms such as GitGuardian.
Official URL: https://github.com/trufflesecurity/trufflehog
