The old answer to TruffleHog vs Gitleaks (Gitleaks in pre-commit, TruffleHog in CI) no longer holds: the Gitleaks README now says it is feature complete, future releases are security patches only, and its author has moved to Betterleaks. The pinned versions on 17 November 2026 are Gitleaks v8.30.1 (March 2026), Betterleaks v1.10.1 stable and v2.0.0-rc.8, and TruffleHog v3.99.9. The row that decides it for a regulated team is what leaves the build runner by default: Gitleaks has no live validation, Betterleaks validates only when you pass --validation (v1) or -v (v2), and TruffleHog verifies against provider APIs unless you pass --no-verification and checks for updates at oss.trufflehog.org unless you pass --no-update. On a runner without egress, TruffleHog's own pre-commit hook (--results=verified) passes silently, because failed verifications are classed as unknown and filtered out. Betterleaks v1.10.1 is close to drop-in for Gitleaks users, with 466 default rules against 222 and one config-loading change; v2 is a real migration that removes SARIF and baselines and turns -v into validate. Our default for egress-restricted teams: Betterleaks v1.10.1 pinned for pre-commit and PR gates, TruffleHog for scheduled sweeps and Hugging Face or container inventory from a runner whose egress you control. This week, grep your CI and hook configs for trufflehog without --no-update and for any Betterleaks or Gitleaks step that uses -v or a latest tag.
The usual answer to TruffleHog vs Gitleaks splits the work: Gitleaks in the pre-commit hook because it is fast and quiet, TruffleHog in CI because it verifies what it finds. That answer expired this year. The Gitleaks README now opens with a notice that reads, verbatim: "Gitleaks is feature complete. I'm not merging new features into Gitleaks. Future releases will be security patches only. I'm shifting my focus to Betterleaks". The notice landed in May 2026. The last Gitleaks release, v8.30.1, shipped on 21 March 2026 and nothing has been tagged since.
So the decision is now three-way, and Betterleaks itself is split between a stable v1 line and a v2 release candidate that changes enough to count as a fourth option. Detector counts are where the usual comparison spends its time, and for a bank, insurer, hospital group or defence supplier they are not the deciding row. The deciding row is what each scanner sends off the build runner by default, because the scanner runs with your repository's full history in hand.
Everything below is read from source, release notes and documentation at four pinned tags: Gitleaks v8.30.1, Betterleaks v1.10.1 and v2.0.0-rc.8, and TruffleHog v3.99.9. None of the tools were executed for this post; the behaviour described is what the code and docs at those tags say.
Gitleaks, Betterleaks and TruffleHog versions and licences
TruffleHog v3.99.9 was published on 12 November 2026, ten days after v3.99.8. It is licensed AGPL-3.0, and its README says it "classifies over 800 secret types" and that "over 700 credential detectors" support active verification against their respective APIs.
Gitleaks v8.30.1 is MIT licensed and the repository is not archived. Commits on the default branch since March are dependency bumps and a supply-chain hardening change, which is what security-patch-only looks like. Its default config has 222 rules.
Betterleaks is MIT licensed, created in February 2026, and its README says it "is maintained by the folks who made Gitleaks, including the original author", with development funded by a commercial security vendor. The stable line is v1.10.1, published 12 November 2026, whose only change is a dependency security update. The default branch carries v2, at v2.0.0-rc.8 since 13 November 2026. The v2 README warns that "until the first stable v2 release, package managers and the Docker latest tag may still provide v1", and the migration guide confirms the candidate does not move the Docker latest tag, the Homebrew cask or GitHub's latest release.
Neither Gitleaks nor Betterleaks has a published repository security advisory. TruffleHog has published advisories, and one matters for pinning: GHSA-fg8w-m62h-jvvw, published in October 2026, a workflow command injection through filenames in --github-actions output that let a pull request author forge annotations and hide real findings. It affects versions from 3.31.0 up to the fix in 3.98.0, and the official Action always passes that flag. Pin TruffleHog at 3.98.0 or later: reference the Action by release tag rather than main, and set its version input, which defaults to the latest image.
TruffleHog vs Gitleaks vs Betterleaks comparison table
Three rows change decisions. The verification row is the one an egress review cares about, and it splits TruffleHog from the other three. The CI reports row is the one that bites teams uploading SARIF to GitHub code scanning or carrying a baseline of accepted findings: Betterleaks v1 keeps both, v2 removes both, and the migration guide says there is no automatic baseline conversion. The licence row only matters if you embed or modify the scanner, and then it matters a lot.
| Gitleaks v8.30.1 | Betterleaks v1.10.1 | Betterleaks v2.0.0-rc.8 | TruffleHog v3.99.9 | |
|---|---|---|---|---|
| Released | 2026-03-21 | 2026-11-12 | 2026-11-13 (release candidate) | 2026-11-12 |
| Licence | MIT | MIT | MIT | AGPL-3.0 |
| Maintenance status | Feature complete, security patches only | Stable maintenance branch (v1.x) | Active development, not yet stable | Active, frequent releases |
| Default rules or detectors | 222 rules | 466 rules (229 with a validate expression) | 476 rules | Over 800 secret types, over 700 verifying detectors |
| Live verification default | None (no validation code) | Off; enable with --validation | Off; enable with -v / --validate or -a / --analyze | On; disable with --no-verification |
| What leaves the runner by default | Nothing | Nothing | Nothing from detection (remote sources still download) | Provider API calls, private-key fingerprint lookups, SSH attempts to github.com and gitlab.com, update check to oss.trufflehog.org |
| Update check | None | None found | None found | On unless --no-update (the official Action passes it) |
| Sources | git, dir, stdin | git, dir, stdin, GitHub, GitLab, Hugging Face, S3 | filesystem, stdin, git, GitHub, GitLab, Hugging Face, S3, container images | git, filesystem, GitHub, GitLab, Hugging Face, Docker, S3, GCS, CI systems, Postman, Jenkins and more |
| Hugging Face | Token rules only, no Hub source | Models, datasets, Spaces, buckets | Same, base URL fixed to huggingface.co | Models, datasets, Spaces, buckets, orgs, users, --endpoint |
| Container images | No | No | Registry, daemon, docker save archive, with layer provenance | Registry, docker://, file:// tarball |
| Pre-commit fit | git --pre-commit --staged hook | Same shape, same flags | stdin --git-diff piped from git diff --cached | Hook gates on --results=verified only |
| CI reports | JSON, CSV, JUnit, SARIF, template, baselines | JSON, CSV, JUnit, SARIF, template, baselines | JSON and JSONL only, no baselines | JSON, SARIF, GitHub Actions annotations, exit code 183 with --fail |
| Migration cost from Gitleaks | None | Low: pass repo config explicitly, triage new findings | High: config, flags, ignore files and reporters change | Medium: different rule model, ignore comment and gate semantics |
Secret scanner verification: what leaves your build runner
# Egress-restricted PR gate: no provider calls, no update check, # every finding (all unverified) fails the build with exit code 183 trufflehog git file://. \ --since-commit main \ --branch HEAD \ --no-verification \ --no-update \ --fail # Runner with a sanctioned proxy: verify through it, keep unknowns in the gate HTTPS_PROXY=http://proxy.internal.example:3128 \ trufflehog git file://. \ --since-commit main \ --branch HEAD \ --no-update \ --results=verified,unknown \ --fail
TruffleHog verifies by default
In TruffleHog v3.99.9, --no-verification is a boolean that defaults to false, so every scan verifies unless you say otherwise. Results come in three statuses. Verified means confirmed valid and active by API testing. Unverified means detected but not confirmed, which includes the case where verification was disabled. Unknown means verification was attempted and failed because of an error, such as a network or API failure. Verification does not mean the secret is posted verbatim to a third party. The AWS detector signs a GetCallerIdentity call, so the secret key signs the request rather than travelling in it. Bearer-token detectors send the token to the issuing provider, which already holds it. Private keys are the case an egress review will flag: the detector looks up the key's public fingerprint at keychecker.trufflesecurity.com, a Truffle Security service, and attempts an SSH handshake with the found key against github.com and gitlab.com on port 22. The private key never leaves, but those hosts are not your providers. The second outbound call has nothing to do with secrets. Unless --no-update is set, TruffleHog posts a JSON body with OS, architecture, current version, command and timezone to oss.trufflehog.org, and the updater can replace the running binary. The official GitHub Action passes --no-update. A hand-written job or a pre-commit hook does not, the same class of quiet call-home as what the OpenAI Agents SDK still sends to OpenAI under Ollama. --verifier looks like an egress control and is narrower than it appears. It takes detector=URL pairs, but at v3.99.9 only 24 detector implementations accept a custom endpoint: self-managed GitLab, Jira, Confluence and Bitbucket Data Center, HashiCorp Vault, Artifactory, Datadog and a handful more. Its purpose is verifying secrets for your own self-hosted instances, not redirecting all verification into an air gap, and the engine rejects an entry for a detector that does not support it. Those same detectors also verify against endpoints found in the scanned data by default, which is the behaviour behind CVE-2024-43379, a blind SSRF fixed in 3.81.9; --custom-verifiers-only switches that off for detectors you configured. The lever that does work for partial egress is environmental: TruffleHog's verification HTTP clients honour HTTPS_PROXY, so partial egress through a corporate proxy is possible.
Why --results=verified fails open on an offline runner
This follows from the documented semantics rather than from anything we executed. On a runner with no egress and verification left on, every verification attempt fails with a network error, and the README classes those as unknown. A job filtered with --results=verified drops unknown results, reports nothing, and passes. TruffleHog's own pre-commit hook entry at v3.99.9 is trufflehog git file://. --since-commit HEAD --results=verified --fail --trust-local-git-config. On a developer laptop on a train, or a hook running inside an egress-blocked build container, that hook blocks nothing. The README's CI recipe uses --results=verified,unknown, which at least fails when verification errors out. For an egress-restricted gate, turn verification off and gate on everything: The first form has no --results flag on purpose. With verification off, a verified-only filter would gate on an empty set.
Betterleaks validates only when asked
In Betterleaks v1.10.1, --validation is a boolean that defaults to false. In v2 the guide puts it plainly: "CLI scans detect secrets without provider requests by default", with -v / --validate or -a / --analyze to opt in. When validation is on, the requests are written in the rule TOML as expressions that call the provider URL with the found secret, so the list of hosts a validating scan can contact is readable from one file, apart from seven AWS, Azure and GCP rules that call built-in helpers. That is a reviewable egress allowlist, which TruffleHog's compiled detectors are not. The same property explains a v1.10.0 change from 4 November 2026: automatic loading of a repository's .betterleaks.toml or .gitleaks.toml now requires --unsafe-auto-load-config. The documented reason is that "a discovered config can change detection rules, suppress findings, and define validation requests". A config planted in a pull request should not get to decide where your runner sends secrets. Local git scans in v1.10.0 also isolate repository git configuration by default, with --trust-local-git-config for trusted repositories, the same guard TruffleHog applies by cloning local repos to a temporary directory.
Gitleaks never validates
Gitleaks v8.30.1 has no live validation. The only HTTP code outside tests serves an optional pprof diagnostics endpoint. For an air-gapped site that is the cleanest egress story of the three, and it is why Gitleaks fits a pre-commit hook so well.
Migrating from Gitleaks to Betterleaks or TruffleHog
# Gitleaks CI step moved to Betterleaks v1.10.1, SARIF upload unchanged betterleaks git . \ --config .gitleaks.toml \ --redact \ --report-format sarif \ --report-path betterleaks.sarif
set -o pipefail git diff --cached --no-ext-diff --no-textconv --no-color --src-prefix=a/ --dst-prefix=b/ | betterleaks stdin --git-diff --redact
To Betterleaks v1.10.1: close to drop-in, one config change
The v1 line was built to absorb Gitleaks users. It reads BETTERLEAKS_CONFIG or GITLEAKS_CONFIG, translates deprecated allowlist, entropy and token-efficiency fields into its filter expressions, reads .betterleaksignore or .gitleaksignore, honours betterleaks:allow and gitleaks:allow comments, and keeps --baseline-path and the json, csv, junit, sarif and template report formats. The pre-commit hook entry is the Gitleaks one with the binary renamed: betterleaks git --pre-commit --redact --staged --verbose. Two things change. A repo-local .gitleaks.toml must now be passed explicitly. And the default rule set has 466 rules against Gitleaks' 222, so the first run on an existing repository will report findings Gitleaks never did. Regenerate your baseline with Betterleaks rather than assuming a Gitleaks report carries over; the formats look shared, but nothing in the docs promises it. Pin the hook's revision to v1.10.1 and, if you use the container hook, replace its ghcr.io/betterleaks/betterleaks:latest image with the :v1 tag the README documents.
To Betterleaks v2: a migration, not an upgrade
The v2 migration guide lists breaking changes across every surface a CI job touches. dir becomes filesystem or fs. --log-opts, --staged and --pre-receive are removed: commit ranges use --revision=A..B, and staged changes or pre-receive hooks pipe a patch into stdin --git-diff. --report-path becomes --output, and the CSV, JUnit, SARIF and template reporters are gone along with --baseline-path. GITLEAKS_CONFIG must be renamed, neither repo config file auto-loads, unknown TOML fields fail loading, allowlists become prefilter and filter expressions, and a Gitleaks minVersion = "8.x.y" now means Betterleaks 8.x.y. .gitleaksignore discovery is unsupported and .betterleaksignore entries become SHA-256 digests of the secret. Allow comments still work. The pre-commit hook changes shape entirely. This is the release-candidate command from the rc.8 guide: The trap is a single letter. The migration table says of --verbose / -v: "Remove: findings print by default. -v now enables validation". The Gitleaks and Betterleaks v1 READMEs both use -v in their examples. A job written that way and upgraded to v2 starts contacting credential providers, with no error. A job using the long --verbose, like the v1 container hook pinned to :latest, fails instead because the flag no longer exists. The loud failure is the better of the two. BETTERLEAKS_VALIDATE=true in a shared runner environment flips validation on the same quiet way.
To TruffleHog: a different model
Moving to TruffleHog is not a config translation. Detection is compiled detectors, not TOML rules, and custom regex detectors are still marked alpha. Inline suppression is trufflehog:ignore, not gitleaks:allow. The gate semantics differ: --fail exits 183 rather than 1, and you have to decide which result statuses gate the build. SARIF output exists, so code scanning uploads survive.
Scanning Hugging Face repos, Docker images and agent commits
All three catch a Hugging Face token committed to your own repository; Gitleaks ships two HF token rules. Only TruffleHog and Betterleaks pull from the Hub itself: models, datasets, Spaces and buckets, plus discussions and pull requests on request. That matters because a token pasted into an HF discussion or PR sits outside any git history your own hooks see. TruffleHog's --endpoint defaults to huggingface.co and can point elsewhere; Betterleaks has the base URL hardcoded at rc.8 with no flag. An air-gapped site cannot reach the Hub from the scanner at all, and the work of running Hugging Face tooling without Hub calls applies to the scan job too.
Model-serving images are the other new surface: weights, tokenizer files and a startup script that once had a token inlined. TruffleHog's stable docker command takes a registry reference, docker:// for the local daemon or file:// for a docker save tarball, and the tarball form works on a disconnected runner:
trufflehog docker --image file://serving-image.tar --no-verification --no-update --fail
Betterleaks' container source exists only in the v2 release candidates. Its design is good: no daemon needed for registry scans, credential helpers disabled unless asked, and each finding labelled visible, overwritten or deleted with the layer that hid it. Deleted-in-a-later-layer is the case that matters, since the secret is still in the image. It is not in a stable release on 17 November 2026, and Gitleaks has no image source.
Agent-written commits raise the stakes on the pre-commit hook and the PR gate. A coding agent with access to a local credential store can write a key into a file as easily as a person can, and our DeepSeek harness security review covers why that store is reachable from tool processes. MCP server configs are another place keys land in repositories; the MCP server hardening checklist covers moving them out. Secret scanners do not inspect what an agent skill does, which is a separate class of tool, and they are a different control from redacting secrets in prompts and logs at runtime with a model like OpenAI's privacy filter. Hosted products such as GitHub Advanced Security secret scanning are out of scope here because the question is what runs on your own runners.
Secret scanning in air-gapped and regulated environments
Egress review is where this comparison gets settled in a regulated shop, so give the reviewer the list. Gitleaks contacts nothing. Betterleaks contacts nothing unless validation is on, and then only the hosts in the validate expressions of your TOML and the AWS, Azure and GCP helpers they call. TruffleHog by default contacts every provider whose detector fires, keychecker.trufflesecurity.com, github.com and gitlab.com over SSH, and oss.trufflehog.org. With --no-verification --no-update it contacts only what its source needs, which for git file://. and a file:// image tarball is nothing beyond the runner.
Licence is the second review. Running unmodified TruffleHog in CI is routine. Forking it, embedding it in an internal developer platform, or exposing it as a service other teams call puts you in AGPL-3.0 territory, and that needs a legal review before you build rather than after. The two MIT tools raise no such question.
Lifecycle is the third. Security-patch-only is fine for a pinned gate over the next few quarters. It is not a basis for a multi-year standard across dozens of repositories, because new credential formats arrive as new rules. For internal registries, TruffleHog's Action has an image input documented as an override "to point at a registry mirror", and Betterleaks publishes a :v1 tag you can mirror. Both fit a no-public-pull build. More on how these controls sit together is on our AI security pillar page.
Which secret scanner to use for pre-commit, PR gates and sweeps
Our default for a regulated or egress-restricted team is Betterleaks v1.10.1, pinned, as the pre-commit hook and PR gate. It is MIT, validates nothing unless asked, keeps Gitleaks' config, flags, SARIF and baselines, and is maintained by the people who wrote the tool you are leaving. Evaluate v2 in a branch, and do not put a release candidate in a blocking gate.
Use TruffleHog where verification earns its egress: the scheduled sweep that tells you which historical findings are live keys to rotate first, and the Hugging Face and image inventory Betterleaks v1 cannot do. Run it with --no-update everywhere, pinned at 3.98.0 or later, and never gate on verified-only on a runner that cannot verify.
Keep Gitleaks only as a pinned stopgap while you move. It still works, and it will keep working for exactly the secret formats it already knows.
| Placement | Open egress | Egress-restricted or air-gapped |
|---|---|---|
| Pre-commit hook | Betterleaks v1.10.1, pinned | Betterleaks v1.10.1, pinned (no validation) |
| PR gate | Betterleaks v1.10.1 with SARIF, or TruffleHog with --results=verified,unknown and --no-update | Betterleaks v1.10.1, or TruffleHog with --no-verification --no-update --fail |
| Scheduled full-history sweep | TruffleHog with verification, to rank live keys for rotation | TruffleHog on a runner with a sanctioned proxy, or --no-verification and triage everything |
| Hugging Face and container inventory | TruffleHog huggingface and docker sources | TruffleHog docker with file:// tarballs; HF only where the Hub or an approved endpoint is reachable |
Secret scanning checks to run in your CI this week
Grep your CI definitions and .pre-commit-config.yaml files for three strings. trufflehog without --no-update is an outbound call you have not reviewed. --results=verified on a runner without egress is a gate that cannot fail. -v or :latest on any Betterleaks or Gitleaks step is the line that changes meaning if a stable v2 moves the tag. Pin all three tools to the versions above.
Then look at what the scanners keep finding. A scanner catches a static key after it is written; it does not remove the reason the key exists. For agents and services, the durable fix is short-lived, scoped credentials instead of API keys, which leaves the scanner with less to find.
FAQ
Quick answers to the questions this post tends to raise.



