Skip to content
Haxset
Back to Blog

Secret Scanning Tools: Gitleaks vs TruffleHog vs GitGuardian

By Haxset Research12 min read

TL;DR: For open-source secret scanning tools, the Gitleaks vs TruffleHog choice depends on verification and maintenance. TruffleHog (AGPL-3.0) verifies each secret it can classify with the provider's API by default, and exits 0 on findings unless you add --fail. Gitleaks (MIT) does not verify findings, and since May 2026 its README says future releases will be security patches only. GitGuardian's ggshield sends everything it scans to the GitGuardian API. Haxset's AI PR Scanner runs secret detection on every pull request.

Key points

  • In our reading of its source, the pre-commit hook in TruffleHog's repository fails only on verified findings. If verification fails, for example on a laptop with no network, the finding is labeled unknown and the commit goes through.
  • ggshield's pre-commit and pre-push scans send the machine's hostname to GitGuardian, unless you turn off endpoint registration.
  • The official TruffleHog GitHub Action runs the latest release unless you set a version. TruffleHog's advisory of 8 October 2026 says that in v3.31.0 to v3.97.9, a pull request could hide real findings in the workflow UI.

Which secret scanning tools are still maintained?

TruffleHog, Betterleaks and ggshield are actively maintained: each published a release in September or October 2026. Gitleaks' README says future releases will be security patches only, and detect-secrets has not published a release since May 2024.

Tool (as of 19 Oct 2026)MaintainerLicenseLatest releaseStatus
Gitleaks1Zachary Rice (author)MITv8.30.1, 21 Mar 2026README: security patches only
Betterleaks2The Gitleaks authorsMITv1.9.0, 29 Sep 2026Active, v2 in release candidates
TruffleHog3Truffle SecurityAGPL-3.0v3.99.3, 19 Oct 2026Active
detect-secrets4YelpApache 2.0v1.5.0, 6 May 2024No release since May 2024
ggshield, GitGuardian's command-line tool5GitGuardianMITv1.56.0, 15 Oct 2026Active

On 21 May 2026, two months after its last release, Gitleaks added this notice to its README:1

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

Betterleaks' README says it "is maintained by the folks who made Gitleaks, including the original author".2

AWS's git-secrets has tagged no release since February 2019. Nosey Parker's README says it is "Officially Retired".

Which tools send your secrets or code off the machine?

TruffleHog, detect-secrets and ggshield send data out by default. In our reading of their source, Gitleaks and Betterleaks send nothing by default.

To verify a finding, a tool uses the secret it found in a live call to the service that issued it. TruffleHog's README gives the AWS example: its detector "performs a GetCallerIdentity API call against the AWS API to verify if an AWS credential is active".3

ToolVerifies findings by default?What leaves the machine by defaultHow to turn it off
Gitleaks1No verification featureNothingNothing to turn off
Betterleaks2No, --validation turns it onNothingNothing to turn off
TruffleHog3YesEach secret it can verify, to its provider. Private-key fingerprints to Truffle Security. An update check--no-verification, --no-update
detect-secrets4Yes, for plugins that can verifyThose secrets, to their providers--no-verify
ggshield5Not stated. The GitGuardian API returns a validity statusScanned files, or each commit's diff, with file names, to GitGuardian. The hostname from hook scans. An update check to GitHubFiles: no switch (--instance sends them to a self-hosted GitGuardian). Hostname: endpoint_registration: false. Updates: --no-check-for-updates

detect-secrets' documentation says it "will attempt to verify all secrets", and its verifying plugins include AWS, Slack and Stripe.4

ggshield needs a GitGuardian account and API key, because detection runs on GitGuardian's API. Its README says "your files and secrets won't be stored", only metadata such as "call time, request size and scan mode".5

In the v8.30.1 source, the only network code in Gitleaks serves the optional --diagnostics http profiler. The official Gitleaks Action's README says it sends a third party only license-validation data: the key, repository name and owner. It also says "Your code never leaves GitHub".1

Which tools scan git history, and which fail the build?

Gitleaks, Betterleaks, TruffleHog and ggshield scan commit history, and detect-secrets reads only current files. Every tool except TruffleHog fails the build on findings by default. For detect-secrets, only detect-secrets-hook fails, and detect-secrets scan exits 0 whether or not it finds secrets.

History matters because a secret deleted in a later commit stays in every full clone.

ToolScans git history?Exit code on findingsBaseline and ignore options
Gitleaks1Yes, all refs1, --exit-code changes itEarlier report as baseline, .gitleaksignore, gitleaks:allow comments
Betterleaks2Yes1, --exit-code changes itEarlier report as baseline, .betterleaksignore or .gitleaksignore, gitleaks:allow and betterleaks:allow comments
TruffleHog3Yes0, or 183 with --failNo baseline file, trufflehog:ignore comments, --exclude-paths
detect-secrets4No, current files onlyHook: 1 for new secrets, 3 when it rewrites the baseline.secrets.baseline, pragma: allowlist secret comments
ggshield5Yes, with secret scan repo1, --exit-zero returns 0ggshield secret ignore writes .gitguardian.yaml

detect-secrets' README says it "avoids the overhead of digging through all git history".4

TruffleHog's pre-commit hook definition passes --results=verified --fail, and its source applies that filter before it counts findings. So that hook fails the commit only on verified findings, and an unknown finding, for example on a laptop with no network, goes through. The manual setups in TruffleHog's PreCommit.md pass --results=verified,unknown instead.3

How do you add a secret scanner to CI and pre-commit?

Each tool runs as one command in continuous integration (CI) and has a pre-commit hook. All except detect-secrets can write SARIF (Static Analysis Results Interchange Format), which GitHub code scanning imports. These commands use the flags in each project's documentation. In CI, check out the full history (for example fetch-depth: 0) before a history scan:

hljs sh
# Gitleaks v8.30.1: full history, SARIF report, exits 1 on findings gitleaks git --report-format sarif --report-path gitleaks.sarif . # TruffleHog v3.99.3: your branch (feature-1) since main, exits 183 on verified or unknown findings trufflehog git file://. --since-commit main --branch feature-1 --results=verified,unknown --fail # detect-secrets v1.5.0: tracked files against the committed baseline git ls-files -z | xargs -0 detect-secrets-hook --baseline .secrets.baseline # ggshield v1.56.0: the commits that triggered the pipeline, needs GITGUARDIAN_API_KEY ggshield secret scan ci

For pre-commit, add the tool's hook to .pre-commit-config.yaml and pin it to a release. For Gitleaks:

hljs yaml
repos: - repo: https://github.com/gitleaks/gitleaks rev: v8.30.1 hooks: - id: gitleaks

The other hook IDs are betterleaks, trufflehog, detect-secrets (with args: ['--baseline', '.secrets.baseline'] in its README) and ggshield.

The official GitHub Actions, by name, are gitleaks/gitleaks-action, trufflesecurity/trufflehog and GitGuardian/ggshield/actions/secret.135 detect-secrets and Betterleaks document none. Unlike the MIT command-line tool, the Gitleaks Action has an end-user license agreement, and organization repositories need a GITLEAKS_LICENSE key to run it. Its migration notes said v2 "will stop working" on GitHub-hosted runners from 16 September 2026, so use v3.1

In your workflow, pin each Action to the full commit SHA of a release, because a tag can be moved. Our comparisons of infrastructure-as-code (IaC) scanners and software composition analysis (SCA) tools describe a March 2026 case of moved Action version tags.

TruffleHog's Action runs the latest TruffleHog release unless you set its version input. Its advisory GHSA-fg8w-m62h-jvvw (8 October 2026) covers the --github-actions output of v3.31.0 to v3.97.9. In those versions, a file path in a pull request could inject workflow commands that hide the annotations for real findings. The official Action "always passes --github-actions", so if your workflow sets a version, use 3.98.0 or later.3

Gitleaks vs TruffleHog: which should you choose?

Choose TruffleHog if you need to know which leaked secrets still work and can allow live calls to each provider. Choose Gitleaks if you want a scanner that sends nothing off the CI runner by default, or a baseline file. It also fits if your legal team prefers the MIT license to AGPL-3.0. Gitleaks' README says future releases will be security patches only, so test Betterleaks next to it.

TruffleHog also scans more than git repositories: its subcommands include GitHub, GitLab, Docker images, S3, Postman, Jenkins and Hugging Face.3

A Gitleaks baseline can be any earlier Gitleaks report, so a team can accept today's findings and fail only on new ones.1

Betterleaks reads .gitleaksignore files, gitleaks:allow comments and a .gitleaks.toml in the scanned path. Its rule filters are written in Expr, an expression language, and "replace legacy allowlists". Run your Gitleaks config through Betterleaks and compare the results before you switch.2

Where do detect-secrets and ggshield fit?

detect-secrets fits a team that starts from a committed baseline file and blocks only new secrets at commit time. ggshield fits a team that already uses GitGuardian and accepts the data flow described above.

detect-secrets uses regex, entropy and keyword detectors, and accepts custom plugins written in Python.4 ggshield also scans Docker images and PyPI packages.5

Is GitHub's built-in secret scanning enough?

Only partly, because GitHub secret scanning covers public repositories at no cost but private organization repositories only with GitHub Secret Protection. GitHub's documentation says it scans the full history of every branch. Push protection for repositories is off by default, and by default anyone with write access can bypass it with a reason.

Method and limits

We compared the tools from each project's documentation and source code at its latest release on or before 19 October 2026. For what each tool sends, we searched its source for network calls, update checks and vendor domains, and did not review every code path. We did not run the tools, so this post reports no detection rates, false-positive rates or finding counts. Haxset offers a product in this category.

How Haxset can help

Haxset's AI PR Scanner runs secret detection, AI SAST, dependency scanning and IaC misconfiguration checks on every pull request in GitHub or GitLab. Secret detection checks the lines each pull request adds, and the current files when Haxset scans the whole repository. Its findings show at most the first four and the last four characters of a key, never the raw value. It does not read git history, so run one history scan with an open-source scanner first.

Haxset does not keep the prompts its AI models process and does not train models on them. It stores only scan metadata and scan results. To try it on your repositories, contact us.

FAQ

Is Gitleaks still maintained?

Only for security patches, according to its README. The repository is not archived, and it has published no release since v8.30.1 of 21 March 2026. Since then, its default branch has had no source-code changes, only README, workflow, dependency and repository-policy updates, the last on 22 July 2026.1

Are Gitleaks and TruffleHog free?

Both command-line tools are free and open source, Gitleaks under MIT and TruffleHog under AGPL-3.0. The Gitleaks Action README calls its license key free, and you get one by giving a name, email and company.1 Truffle Security also offers a separate enterprise product.3

Can you use Gitleaks and TruffleHog together?

Yes, because their defaults cover different gaps. In our reading of its source, the pre-commit hook in TruffleHog's repository fails only on verified findings, while Gitleaks exits 1 on any finding. So where a Gitleaks rule matches a secret that TruffleHog did not verify, a Gitleaks hook still blocks the commit. In CI, TruffleHog's verification shows which findings still work. Both tools write SARIF for GitHub code scanning, TruffleHog since v3.97.0 of 14 August 2026.13

Which secret scanners work without internet access?

Gitleaks and Betterleaks, in our reading of their source, make no network calls in a local scan unless you turn on a feature that does.12 TruffleHog's verification and update calls stop with --no-verification --no-update, including its calls to keychecker.trufflesecurity.com for private keys and to oss.trufflehog.org for updates. Its official Action already passes --no-update.3 detect-secrets makes no verification calls with --no-verify.4 ggshield always needs the GitGuardian API, and by default it checks GitHub for a newer version at most once a day, unless you pass --no-check-for-updates.5

What should you do when a scanner finds a live secret?

Revoke or rotate it first. GitHub's documentation says that "as a first step you need to revoke and/or rotate that secret", and that rewriting history afterward "may not be warranted". Deleting the secret in a new commit is not enough. The Gitleaks Action README warns that the alert in the GitHub Security dashboard then "will show as resolved, even though the secret is still visible in the commit history".1

Related research

References

  1. Gitleaks, Gitleaks repository at release v8.30.1, GitHub, 21 March 2026. Feature-complete notice added on 21 May 2026 in commit 80093b8a, and the Gitleaks-Action repository at release v3.0.0, 30 May 2026. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11 ↩12 ↩13

  2. Betterleaks, Betterleaks repository at release v1.9.0, README and documentation pages "Advanced Scanning Guide" and "Betterleaks config", GitHub, 29 September 2026, and the v2.0.0-rc.1 prerelease, 30 September 2026. ↩ ↩2 ↩3 ↩4 ↩5 ↩6

  3. Truffle Security, TruffleHog repository at release v3.99.3, README, PreCommit.md and source, GitHub, 19 October 2026, and advisory GHSA-fg8w-m62h-jvvw, 8 October 2026. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7 ↩8 ↩9 ↩10 ↩11

  4. Yelp, detect-secrets repository at release v1.5.0, README and docs/plugins.md, GitHub, 6 May 2024. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7

  5. GitGuardian, ggshield repository at release v1.56.0, README, actions/secret/action.yml and source, GitHub, 15 October 2026. ↩ ↩2 ↩3 ↩4 ↩5 ↩6 ↩7

Interested in how this research applies to your organization?

Get in touch