Asset 20 8 2
Does AI recommend your business? Run the free check →

Join 15,000 business owners, marketers and entrepreneurs. The Sunday newsletter you'll be annoyed only arrives once a week.

Article

Best Secret Scanning Tools: 10 Ways to Catch Leaked Keys

Secret scanning tools search code and git history for API keys, tokens and passwords that shouldn't be there. For one repository or a small team, start with a command line scanner you run yourself; for many repositories and a team that wants alerts without remembering to run anything, look at a hosted monitoring platform.

Deleting a leaked key from your code doesn't remove it. Git keeps every commit, so the key still sits in the repository's history for anyone who clones it, and the first job after a leak is to revoke and replace the key at the service that issued it. A scanner's job comes next: find every other secret hiding in the same history, then stop the next one getting committed.

The tools that do this split into a few clear kinds, and the kind matters more than the brand.

Four kinds of secret scanner, side by side

Type of toolHow it worksCheck before you commit to it
Command line scanner you run yourselfPoint it at a git repository, files or directories from your machine or a pipelineWhether it scans full history by default or only the files as they stand
Scanner project hosted on GitHubCode you install from its repository and wire up yourselfHow recently it's been updated and who answers issues
Hosted monitoring platformConnects to your repositories and watches them for leaked credentialsWhat it can see in your account and where alerts go
Secrets detection inside a security suiteOne feature in a wider code or supply chain security platformWhether you can switch on secrets detection without the rest
Protection built into your code hostTurned on inside the platform where your repositories already liveWhich repositories it covers and what it costs to enable

I'd decide which row you're in before opening a single vendor page. A solo developer with one leaked key and a security lead looking after hundreds of repositories need different things, and the table sorts them in a minute.

A scanner isn't a secrets manager

It's easy to mix the two up. A scanner finds secrets that have ended up somewhere they shouldn't. A secrets manager stores keys safely so your code reads them at run time and nobody needs to paste one into a file. You'll likely want both in the end: the manager to stop keys being written down, the scanner to catch the times someone does it anyway.

Run it yourself or let a platform watch

The first fork is who presses the button. An open-source command line scanner costs you nothing but setup time, runs wherever you can run a binary, and keeps your code on your own machines. Gitleaks, for example, describes itself as an open-source secret scanner for git repositories, files and directories. The trade-off is that someone has to wire it into a pre-commit hook or a pipeline and read what it reports.

A hosted platform connects to your repositories and keeps watching them. That suits a team with many repositories and no appetite for maintaining scanner config in each one. The questions to ask are about access: what the integration can read, whether it copies code to the vendor, and who sees the alerts.

There's a middle path in the scanner projects hosted on GitHub, where the code is free to read and install but support comes from whoever maintains it. Check the commit history and the open issues before you build a pipeline on one.

Secrets only, or one feature in a wider suite

Some platforms on this list put secrets detection inside a broader security product: code scanning, supply chain checks, posture management or AI remediation. If you're already shopping for wider code security suites, secrets detection might come in the same box and save you a second tool.

If secrets are the only problem you've got, a suite is a lot of product to adopt for one feature. Ask whether secrets scanning can run on its own, whether its alerts can be routed separately, and whether turning it on means onboarding every other module too.

Your own repositories, or leaks beyond them

Scanning the code you own is the baseline. The harder question is whether a key has already escaped: into a public fork, a pasted log or a repository a contractor made. Some products talk about finding leaked credentials or leaked secrets everywhere, and that wording deserves a direct question. Ask exactly where they look, what they need from you to do it and how they'll tell you when they find something.

Don't assume your own repositories are clean because the main branch is. Old branches and tags carry history too, so check whether the tool scans them by default.

What the bill depends on

Plans vary a lot. GitGuardian, Spectral and Aikido each name a free plan on their pricing pages, Spectral and Aikido with caps on contributors or users, and the open-source scanners are free to download and run. Paid prices depend on your team, so the place to look is each vendor's pricing page, with your real count of repositories and developers in hand.

Watch for the cost you won't see on a pricing page: the hours someone spends triaging alerts. A cheap scanner that floods a channel with false alarms can cost more than a paid one that's tuned well.

Scanners you run yourself

Gitleaks

A command line scanner you point at git repositories, files and directories, which makes it easy to drop into a pre-commit hook or pipeline.

Truffle Security (TruffleHog)

The company behind TruffleHog, which offers an enterprise edition too and advertises more than 800 secret detectors.

Betterleaks

A scanner project hosted on GitHub whose page promises to find leaked secrets everywhere; read its README before trusting it with a pipeline.

detect-secrets

Yelp's project for detecting and preventing secrets in code, described on its GitHub page as enterprise friendly.

Hosted platforms and security suites

GitGuardian

A hosted platform that hunts for leaked credentials and monitors internal secrets, so detection runs without anyone remembering to start it.

Spectral

Developer-first code security that now presents itself as part of Check Point CloudGuard.

Work with me

Want AI doing the heavy lifting in your marketing?

I build the systems that handle the boring 80 percent, so you get your week back. Done properly, with the human kept in.

Aikido

An all-in-one security suite with code scanning among its features, pitched at securing everything developers build, ship and run.

Cycode

An agentic development security platform; secrets detection is one item on its menu, inside wider code and supply chain security.

Legit Security

Application security posture management with secrets scanning named in its page title, next to AI remediation.

GitHub Secret Protection

GitHub's own built-in protection for repositories, listed under its advanced security pages, and the obvious comparison if your code already lives there.

An hour with a planted fake key

You don't need to trust anyone's detection claims. Make a throwaway private repository and give each shortlisted tool the same small mess to find:

  • Commit a file with a made-up key in the format your real provider uses, then delete it in the next commit.
  • Add a config file with a fake password and an obvious test value such as a placeholder string.
  • Put a fake token in a branch you never merge.
  • Run or connect the tool and note which of the three it finds, and how long it takes to tell you.

The deleted key is the one that matters. If a tool only reads the current files, it'll miss the exact case you're worried about. The placeholder tells you how noisy it'll be, and the unmerged branch tells you how far it looks.

Then try to silence one false alarm. If marking a result as safe takes more than a minute, multiply that by every developer and every week.

Where secret scanning goes sideways

Treating a scan result as the fix is the big one. A found key needs revoking and replacing at the service that issued it; scrubbing history is tidy-up, not a cure.

Running the scanner once is another. A clean result today says nothing about tomorrow's commit, so put it where it runs on its own, in a hook, a pipeline or a hosted watch.

Letting alerts land in a channel nobody reads finishes the job off. Name who gets the alert and what they're expected to do within the hour, before you switch anything on.

Do you make secret scanning tools? Tool makers can ask to be considered for a featured place on this list.

Scanning code is only one side of keeping keys safe. If your keys guard public APIs, it's worth reading about API security tools too.

Where I'd send each kind of team

One developer who's just found a key in git: revoke it first, then run a command line scanner over the whole history this afternoon and add it as a pre-commit hook.

A small team on one code host: check what the host's built-in protection covers, then compare it with a hosted monitoring platform that has a free plan for small teams,.

A security lead with many repositories and contractors: a hosted monitoring platform, chosen on how it routes alerts and how it handles leaks outside your own repositories.

A team already buying code security: ask the suite you're buying whether secrets detection is in it before adding a separate tool.

Want your tool on this list? Featured spots and reviews here are paid partnerships. Here's how to partner with me.

Published and maintained by the Lilach Bullock team, covering marketing, AI and business growth.
Your buyers are asking AI who to use. Does it say you?

See for free whether ChatGPT, Claude, Perplexity, Gemini and Google name you, and get the plan to become the answer.

Check my AI visibility →
Sundays only

Get the Sunday newsletter.

One email a week. AI experiments, marketing tactics, and the workflows Lilach is building right now in her own business.

Subscribe free

Let’s get your marketing running on AI.

Book a free 30-minute call

We figure out what you need, where AI fits in, and what working together would look like.

Book the call →

Or take the 30-second calculator

You’ll see the hours and the money quietly leaking out of your week, and the three workflows worth building first.

Take the calculator →

Or grab the free AI resource library

Prompt packs, templates, checklists, and swipe files. The exact tools I build for paying clients. Yours, free.

Get the library →
Keep reading

More from the blog.