The best secret scanning tools in 2026 are GitGuardian for a full secrets platform with honeytokens and remediation workflow, TruffleHog for open-source scanning that verifies which secrets are actually live, Gitleaks for a fast free scanner in pre-commit hooks, and GitHub Secret Protection for teams already on GitHub. Semgrep Secrets, detect-secrets, Spectral and Nightfall AI cover the rest: cheap secrets scanning in a wider platform, lightweight Python scanning, enterprise code security, and secrets beyond code.
Key takeaways
- 28.65 million new hardcoded secrets appeared in public GitHub commits in 2025, up 34% on 2024 — scan before you push, not after.
- TruffleHog is the only open-source scanner here that verifies secrets against live services, which turns a long backlog into a revocation list.
- Start free everywhere: Gitleaks, TruffleHog and GitHub scanning on public repos cost nothing, and GitGuardian is free for up to 25 developers.
GitGuardian counted 28.65 million new hardcoded secrets in public GitHub commits in 2025 — a 34% increase on 2024, and the largest single-year jump ever recorded. When GitGuardian retested a 2022 dataset in January 2026, more than 64% of the secrets confirmed valid in 2022 were still valid. Leaked credentials do not expire on their own; attackers use them for years.
We chose these 8 tools because they are the ones teams actually run in 2026: free open-source scanners, the dedicated commercial platform, the native GitHub option, and tools that look beyond code. We did not lab-test every tool; features and prices come from vendor documentation and independent comparisons checked in November 2026. Prices are starting prices as of November 2026.
The best secret scanning tools at a glance
Start with the free floor — GitHub push protection plus Gitleaks in a pre-commit hook — then add verification and workflow where you need them.
| Tool | Best for | Free plan | Starting price | Key feature |
|---|---|---|---|---|
| GitGuardian | Full secrets platform | Yes, up to 25 developers | Paid plans by quote | Honeytokens, validity checks, remediation workflow |
| TruffleHog | Verification-first scanning | Yes, open source | Free; Enterprise by quote | 800+ verifiers prove which secrets are live |
| Gitleaks | Fast free pre-commit scanning | Yes, open source | Free | Single Go binary, 222 default rules |
| GitHub Secret Protection | Teams already on GitHub | Free on public repos | $19 per active committer/month | Push protection blocks secrets before they land |
| Semgrep Secrets | Secrets inside a wider SAST platform | Yes, in Free Edition | $15 per contributor/month | Secrets plus SAST and SCA in one platform |
| detect-secrets | Lightweight Python scanning | Yes, open source | Free | Baseline file for known false positives |
| Spectral (Check Point) | Enterprise code security | No free plan | Quote-based | Multi-source scanning inside CloudGuard |
| Nightfall AI | Secrets beyond code | Free tier available | Tiered, by quote | SaaS, chat and ticket scanning |
What is secret scanning, and where do secrets leak?
Secret scanning finds credentials that were accidentally saved where they do not belong: API keys in source code, passwords in config files, tokens in CI logs, keys pasted into Slack, and private keys committed to git history. The scanner's job is to find them; the best scanners then check whether each one still works.
GitGuardian's 2026 report found 28% of secrets incidents entirely outside code, and AI-service leaks surged 81% in the same report — coding assistants and MCP configuration files are a new leak path. See the full findings in GitGuardian's State of Secrets Sprawl 2026.
How to choose a secret scanning tool
Choose by where your secrets actually leak, then by whether you need verification, then by price. Three questions decide it:
- Do you need verification? A regex scanner reports every string that looks like a key. A verifier logs in to the provider and tells you which ones work. On a large backlog, verification is the difference between a revocation list and a thousand tickets nobody trusts.
- Where must it run? Pre-commit hooks stop secrets before they are committed; push protection stops them before they land on the server; CI scanning finds what is already in history. You want at least two of the three.
- Does it run locally? Some CLIs send content to a vendor API for detection; others scan locally. If your code cannot leave your network, that decides the tool for you.
1. GitGuardian — best full secrets platform
GitGuardian is the dedicated commercial platform built around this problem. Its ggshield CLI detects more than 500 secret types in pre-commit, pre-push and CI, and the platform extends scanning to Slack, Jira, Confluence and developer laptops, with honeytokens that alert you when a planted credential is used.
- Key features: validity checks, remediation playbooks, Slack and Jira integrations, public GitHub monitoring for developers' personal repos, honeytokens, non-human identity governance.
- Pros: the broadest coverage in the category; a real free tier; the only vendor here with honeytokens as a first-class feature.
- Cons: ggshield sends content to GitGuardian's API for detection, so scans do not run locally; paid plans are quote-based.
- Pricing: Starter is free for up to 25 contributing developers, with unlimited real-time scanning, up to 500 historical detections and 10,000 API calls a month. Growth and Enterprise are by quote.
- Who should pick it: AppSec teams treating leaked credentials as their top vector.
2. TruffleHog — best verification-first scanning
TruffleHog from Truffle Security is the open-source scanner that proves which secrets are live. It classifies more than 800 secret types and verifies candidates against live services, pairing related values — the AWS key ID and secret come back as one finding, because TruffleHog needs both to test the credential.
- Key features: 800+ verifiers, git history scanning, filesystem and S3 scanning, CI and Jenkins sources, SARIF output.
- Pros: the only open-source scanner here with live verification; in independent testing in September 2026 it was the only scanner to catch all ten planted secrets.
- Cons: the dashboard, Slack and Jira sources and continuous monitoring are in the Enterprise tier, which has no public price.
- Pricing: open source is free (AGPL-3.0); Enterprise is by quote.
- Who should pick it: teams with a large backlog of findings who need to know which secrets actually work.
3. Gitleaks — best fast free pre-commit scanning
Gitleaks is the regex scanner almost everyone starts with: a single Go binary with 222 rules in its default config, custom rules in a TOML file, and SARIF output for CI. It scans git history faster than almost anything else in the category, which is why it is the standard pre-commit hook.
- Key features: 222 default rules, custom regex rules, pre-commit and CI support, SARIF and JSON output, baseline support.
- Pros: free and MIT licensed; fast enough to run on every commit; no account or API needed.
- Cons: no live verification in the open-source version; pattern matching alone produces more noise than a verifier.
- Pricing: free, open source.
- Who should pick it: every team, as the free floor — install it in pre-commit hooks today.
4. GitHub Secret Protection — best for teams already on GitHub
GitHub Secret Protection is the scanner built into GitHub itself. Secret scanning looks for known key formats across the full git history on all branches, plus issues, pull requests, discussions and wikis. Push protection blocks a push that contains a secret before it lands — the only tool here that prevents the leak at the server rather than warning about it afterwards.
- Key features: push protection, validity checks for partner patterns, secret scanning across the whole repository, delegate bypass controls.
- Pros: no new tool to install if you already live on GitHub; push protection is the strongest prevention in the category.
- Cons: only covers GitHub; push protection on private repos has to be switched on, and by default anyone with write access can bypass it by giving a reason.
- Pricing: free on public repositories; $19 per active committer per month for private repositories, sold separately from GitHub Advanced Security since April 1, 2025.
- Who should pick it: organizations already on GitHub Team or Enterprise Cloud.
5. Semgrep Secrets — best secrets inside a wider SAST platform
Semgrep Secrets is the secrets module on Semgrep's AppSec platform, alongside Code (SAST) and Supply Chain (SCA). If you already run Semgrep for code scanning, adding secrets costs one more line in the same platform instead of a second vendor, a second dashboard and a second triage queue.
- Key features: secrets detection alongside SAST and SCA, cross-file analysis, AI triage, CI and pre-commit support.
- Pros: one platform for code, dependencies and secrets; published pricing; free in the Free Edition.
- Cons: narrower secrets coverage than GitGuardian; no honeytokens or chat scanning.
- Pricing: included in the Free Edition for up to 10 contributors; $15 per contributor per month on the Teams plan, from Semgrep's pricing page. See our guide to the best security linters for the SAST side of Semgrep.
- Who should pick it: teams already running Semgrep who want secrets in the same workflow.
6. detect-secrets — best lightweight Python scanning
detect-secrets, from Yelp, is a lightweight open-source scanner that plugs into pre-commit hooks and builds a baseline file of known findings, so new secrets stand out and old false positives stay silenced. It is the smallest tool on this list, and for a Python-heavy team that is a feature.
- Key features: baseline files, pre-commit hook support, plugin architecture for custom detectors, JSON output.
- Pros: free and Apache 2.0 licensed; the baseline workflow keeps noise down over time; easy to add to an existing pre-commit setup.
- Cons: no live verification; narrower detector set than Gitleaks or TruffleHog; no dashboard or team workflow.
- Pricing: free, open source.
- Who should pick it: Python teams that want a minimal pre-commit scanner with a baseline.
7. Spectral (Check Point) — best enterprise code security
Spectral, now part of Check Point CloudGuard Code Security, is a multi-source secrets scanner that covers code, infrastructure as code and configuration, inside a wider enterprise cloud security platform. It suits organizations that already buy Check Point and want secrets scanning as a module rather than a standalone product.
- Key features: multi-source scanning, infrastructure-as-code coverage, integration with CloudGuard, policy enforcement.
- Pros: fits an existing Check Point estate; covers config and IaC as well as code.
- Cons: no standalone free tier; quote-based pricing; the standalone Spectral product no longer exists as an independent purchase.
- Pricing: quote-based, as a CloudGuard module.
- Who should pick it: Check Point CloudGuard customers who want secrets scanning inside that platform.
8. Nightfall AI — best secrets beyond code
Nightfall AI is the tool on this list that looks where code scanners do not: SaaS apps, chat, tickets and files. It scans Slack, Google Drive, Jira and similar surfaces for secrets and sensitive data, with DLP-style policies for what happens after detection.
- Key features: SaaS and chat scanning, DLP policies, automated remediation workflows, API-based deployment with no agents.
- Pros: the only tool here built for secrets outside code; useful once your code scanning is already in place and leaks keep happening in chat.
- Cons: not a code scanner — it does not replace Gitleaks or TruffleHog; pricing is tiered and by quote.
- Pricing: free tier available; paid plans are tiered and by quote.
- Who should pick it: teams whose secrets keep leaking in Slack, Drive and tickets rather than in code.
What to do when a scanner finds a secret
Finding a secret is the start, not the end. The order matters, and the first step is the one teams most often get wrong: they delete the file and think the secret is gone. It is not — git history keeps it, and attackers scan public history continuously.
If the secret is in a public repository, assume it has been copied. GitGuardian's data shows leaked secrets are tried quickly — in one reported case, canary AWS keys saved to an online formatter were tried within 48 hours. Speed is the whole game.
Free vs paid: what do you actually get for paying?
The free floor is strong: Gitleaks in pre-commit, TruffleHog for verification, GitHub scanning on public repos, and GitGuardian free for up to 25 developers. That combination catches most leaks in most teams for $0.
Paying buys workflow and coverage beyond code: deduplication across branches, ownership routing, remediation playbooks, Slack and Jira integrations, honeytokens, laptop scanning and public GitHub monitoring for your developers' personal repos. If leaked credentials are your top risk — and for most teams they are — that workflow is worth paying for once the free tier's limits bite.
What to avoid
Do not run a scanner only in CI and never in pre-commit. A finding in CI means the secret is already in history; a finding in pre-commit means it never was. Both matter, but prevention is worth far more than detection.
Do not treat an unverified finding as an incident, and do not treat a verified live credential as a low-priority ticket. The first wastes your team's time; the second wastes your window to revoke before an attacker uses it.
Finally, do not scan code and ignore everything else. If your team pastes keys into Slack, shares them in tickets, or leaves them in AI coding-assistant caches, a code-only scanner will give you a clean report while the leak continues elsewhere.
The bottom line
Install Gitleaks in a pre-commit hook, turn on GitHub push protection, and run TruffleHog over your history to find what is already there — that is the free floor, and it takes an afternoon. Then add GitGuardian if you want a platform with workflow and honeytokens, or Semgrep Secrets if you already run Semgrep.
And remember the order when something is found: revoke first, investigate second, clean history third.
Check whether any password tied to a leaked credential already appears in known breaches with our free pwned password checker.
For the code-quality side of the same workflow, see our best security linters guide.
Frequently asked questions
What is secret scanning?
Secret scanning is automated detection of credentials — API keys, passwords, tokens and private keys — that have been accidentally committed to code, config files, chat or other places they do not belong. A scanner finds the secret, and the best ones check whether it still works.
What is the best free secret scanning tool?
Gitleaks is the best free starting point: a single fast binary with 222 rules in its default config, MIT licensed, that runs as a pre-commit hook or in CI. TruffleHog is also free and open source, and it adds live verification of the secrets it finds.
How do I remove a secret from git history?
Revoking the secret comes first — a secret in git history is compromised even if you delete the file, because history keeps it. Rotate the credential, then rewrite history with a tool such as git filter-repo or BFG Repo-Cleaner, and force-push. Tell collaborators to re-clone, because old clones still hold the secret.
Does GitHub secret scanning cost money?
Secret scanning is free on public repositories. On private or internal repositories owned by an organization, it requires GitHub Secret Protection, a paid add-on listed at $19 per active committer per month.
What is the difference between TruffleHog and Gitleaks?
Both are free open-source scanners. Gitleaks is a fast regex-based scanner with 222 default rules, ideal for pre-commit hooks. TruffleHog classifies more than 800 secret types and verifies candidates against live services, so it tells you which secrets actually work.
Can secret scanning find secrets outside code?
Some tools can. GitGuardian scans Slack, Jira, Confluence and developer laptops on paid plans, and Nightfall AI scans SaaS apps, chat and tickets. Gitleaks and TruffleHog focus on code and git history, so pair them with a broader tool if your leaks happen in chat.
What should I do when a secret scanner finds a live credential?
Revoke it immediately, then investigate: check access logs for use of that credential, rotate any related credentials, remove the secret from history, and add a pre-commit hook so it cannot happen again. A verified live secret is an incident, not a ticket for next sprint.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against GitGuardian's State of Secrets Sprawl 2026, GitHub's secret scanning documentation, and vendor pricing pages.
How we write and fact-check →