6 open source tools compared. Sorted by stars. Scroll down for our analysis.
By Erik Loyd, SaaS CEO and former COO/CFO of an AWS Premier Partner.
| Tool | Stars | Velocity | Score |
|---|---|---|---|
gitleaks Find secrets with Gitleaks 🔑 | 31.1k | +258/wk | 88 |
trufflehog Find, verify, and analyze leaked credentials | 29.4k | +482/wk | 80 |
detect-secrets An enterprise friendly way of detecting and preventing secrets in code. | 4.7k | +8/wk | 54 |
Betterleaks The original Gitleaks author's successor, finding leaked keys in git history, GitHub and GitLab orgs, Hugging Face and S3. Checks whether each key still works, but only when you ask. | 3.0k | +120/wk | 72 |
| 2.0k | +4/wk | 76 | |
gshark Scan for sensitive information easily and effectively. | 1.1k | +1/wk | 68 |
Stay ahead of the category
New tools and momentum shifts, every Wednesday.
Gitleaks catches the API keys, tokens and private keys that should never have been committed, in your working tree or anywhere in git history. It's a single Go binary with 222 built-in rules plus your own in a TOML file, and the CLI is MIT licensed, free, and needs no account.
There's nothing to host. Install via Homebrew or Docker, run gitleaks git on history, or wire it in as a pre-commit hook. The first scan of an old repo lights up on test fixtures, so build a baseline before the team learns to ignore it. The official GitHub Action is not MIT. It runs under an EULA, org repos need a free license key from a Google Form, and gitleaks-action@v2 stopped working when GitHub removed Node 20 on September 16, 2026. Move to v3. Solo, small teams, larger teams: all free.
The catch is who's driving. The original author declared Gitleaks feature complete, security patches only, and moved to Betterleaks, a successor sponsored by Aikido Security that already ships stable releases with live-key validation. gitleaks.io now says Truffle Security, the TruffleHog company, maintains Gitleaks. Run 8.30.1 or later (CVE-2026-63728), and try Betterleaks before standardizing.
TruffleHog finds leaked credentials (API keys, passwords, tokens) then tries each one to see if it still works. That verification is the whole point: instead of a wall of random-looking strings, you get a short list of live secrets to rotate. It classifies 800+ secret types, and the CLI is free under AGPLv3.
It's a single Go binary from brew, Docker or a release download. It scans git history, GitHub and GitLab orgs, S3 and GCS buckets, Docker images, filesystems, Postman, Jenkins and Hugging Face. Add --results=verified --fail in CI to fail the build on a live key.
TruffleHog Enterprise adds continuous monitoring of Slack, Jira, Confluence, Teams and SharePoint, a dashboard, SSO, RBAC and revocation tracking. Pricing is contact-sales only. Solo, small and medium teams: the free CLI plus pre-commit hooks covers code. Large orgs: Enterprise, once secrets leak in chat and tickets.
The catch: verification sends every candidate secret to its provider's API; use --no-verification when that's off-limits. The official GitHub Action also let pull request authors hide real findings until v3.98.0, so pin a patched release. Gitleaks (now also run by Truffle Security) is the lighter MIT option; Betterleaks, MIT too, validates secrets as well.
detect-secrets stops credentials from getting committed to your repo in the first place. It scans code for things that look like passwords, API keys, and tokens, and it's built to run as a pre-commit hook so a leaked secret gets caught before it ever lands in git history. Open source, from Yelp, free. Its trick is a baseline file: it records the secrets it already knows about, including false positives you've marked, so it only alerts on new ones. That keeps it quiet enough to actually leave enabled, which is the whole game with secret scanning. Setup is a pip install and a pre-commit config, and it runs locally with no service. Fully free, no paid tier. It sits in a crowded space: Gitleaks and TruffleHog are the other open source options, and each has a slightly different angle. detect-secrets leans hardest into the pre-commit, baseline-driven workflow, which makes it a strong default for stopping leaks at the source rather than finding them after. The catch: it catches secrets that match its detectors and heuristics, not every possible secret. A credential in an unusual format can slip past, and the baseline approach means a secret already in your history won't get flagged. It's prevention going forward, not a cleanup tool for what already leaked.
Betterleaks hunts for API keys, tokens and passwords that leaked into git history, folders, GitHub and GitLab orgs, Hugging Face repos and S3 buckets, then can check whether each one still works. It comes from the original Gitleaks author, who froze Gitleaks at security patches to build this, and it's free under MIT.
One Go binary, nothing to host. Install 1.9.0, the stable line, from Homebrew core or Docker's :v1 tag. Docker :latest and the tap's main cask still hand you 1.8.1, and the README's :v2 image doesn't exist yet. Version 2 is in release candidates with breaking CLI, config and report changes. Live-key checks are off by default and only call each provider's own API. No telemetry.
There's no paid tier. Solo, small teams, larger teams: free. Aikido Security employs the maintainer and funds the work, and the CLI carries no upsell. The paid comparison is GitHub Secret Protection at $19 per active committer per month.
The catch is the v2 flag swap. In Gitleaks and Betterleaks 1.x, -v means verbose. In v2 it means validate, so an old CI script passing -v sends every key it finds to its provider for testing. Fix your flags before upgrading.
Ggshield catches that before it reaches your remote repository. It scans your commits for secrets (API keys, passwords, certificates, private keys) and blocks the push if it finds any. Picture a pre-commit hook that prevents your worst 'oh no' moments. MIT license, Python CLI. Runs as a Git hook, in CI/CD pipelines, or as a standalone scanner. Uses GitGuardian's detection engine which recognizes 400+ types of secrets. Also scans for infrastructure-as-code misconfigurations (Terraform, CloudFormation, Kubernetes). The free tier covers individual developers: unlimited local scanning, up to 25 developers on GitGuardian's platform with basic features. Paid plans start at $60/developer/month for teams, which adds historical scanning, dashboards, incident management, and remediation workflows. Solo developers: free and you should install it today. There's no reason not to have secret detection in your Git hooks. Small teams (2-25): free tier covers you. Growing teams: $60/dev/mo adds value when you need historical scanning and incident workflows. Large orgs: enterprise pricing for SAML SSO, custom detectors, and API access. The catch: the real power is in GitGuardian's cloud platform, not just the CLI. The free CLI scans current commits, but finding secrets already buried in your Git history requires the paid platform. TruffleHog and Gitleaks are fully free alternatives that scan history locally, less polished, but no per-developer pricing.
gshark watches public code for your secrets before someone else finds them. It scans GitHub, GitLab, Searchcode, and Postman for leaked API keys, tokens, and credentials that match rules you define, then surfaces the hits in a web dashboard. The job it does is the same one GitGuardian charges for: catching the AWS key an employee pasted into a public gist before it turns into a bill or a breach. It is open source under Apache-2.0. This is a real application to run, not a script. There is a Go backend, a Vue frontend, and a database, plus API tokens for each source you want to scan. Budget an afternoon to stand it up and some ongoing care to tune rules so you are not drowning in false positives. Once it is running, it is yours: your data never leaves your infrastructure, which matters when the thing you are searching for is your own leaked credentials. Solo developers and small teams who mostly need to watch their own org: gshark is a solid free option and the self-hosting is manageable. Larger security teams that want managed coverage, validity checking, and a support line will still find GitGuardian or similar worth paying for. If you only need to scan your own repos in CI, lighter tools like gitleaks or trufflehog may be a better fit than standing up a whole platform. The catch: a tool that hunts for exposed secrets across public code is dual-use by nature, and the docs lean heavily Chinese. Nothing wrong with either, but factor in the reading and the responsibility before you point it at the whole internet.