TL;DR

  • Label the union, not one engine’s results: checking whether engine B finds what engine A found only measures B’s recall on A’s findings. It says nothing about what A misses.
  • Valid-only benchmarks miss most of the problem: generic secrets like passwords and custom tokens can’t be validity-checked, and they make up around 70% of what we detect in customer environments.
  • Test at production scale: strong performance on 500 files may not translate to your entire git history. For context, processing approximately 0.5 TB per day for our customers, a pure LLM scan would cost over $10,000 daily, compared to just a few tens of cents for a rule-based engine.
Séverine Bonnechere

Séverine Bonnechere

Séverine is an Engineering Manager at GitGuardian, leading the Secrets Detection team that builds the engine behind GitGuardian's secret scanning.
LinkedIn

Comparing secret detection vendors sounds simple. Run each tool on the same data, count the findings, pick the winner.

In practice, almost every step hides a bias. The dataset, the matching rules, and the labeling method can each flip the result.

We are one of the vendors you may compare. So we won't run the benchmark for you: it wouldn't be credible. Instead, here is what we learned running our own large-scale benchmarks, and the pitfalls to avoid when you build yours.

The method below follows eight steps, from defining the question to looking beyond detection.

1. Decide what you are measuring

A benchmark answers one question. Write it down before you start.

  • Pure detection. Which engine finds more real secrets, with less noise?
  • Operational value. Which tool helps my team fix leaks faster?

These are different questions. A detection benchmark ignores prioritization, validity checks, context enrichment, scope analysis, and revocation. These features often matter more than a few points of recall. If they matter to you, assess them separately (see section 8).

2. Choose the right dataset

There is no perfect dataset. Each option has a trade-off.

Controlled, labeled repositories

You know exactly which items are true and false positives. Great for regression testing. But they are small, and often built by hand. Hand-made credentials look nothing like real ones. Small sets also hide cost and speed. An engine that shines on 500 files may not scale to your full git history.

Synthetic or dummy secrets

Avoid them. Modern engines are tuned for machine-generated secrets. Human-invented values like password123 or sk_test_XXXX are exactly what a good engine is designed to ignore. A benchmark full of them rewards noisy engines.

Public GitHub data

Our usual recommendation. It's real, large, and diverse. Two limits:

  • Public repos differ from internal ones (languages, secret types, internal services).
  • It only covers git. Real leaks also happen in Slack, Jira, Confluence, container images, CI logs, etc.

Your own internal data

The most representative, but handle with care as they contain real secrets 

Sampling tips for public data:

  • Pick several random time windows, not a single day.
  • Keep one file patch per repository. A few huge repos shouldn't dominate the results.
  • Deduplicate secrets. Keep only the first occurrence of each one.
  • Keep the list of scanned commits to ensure your run is reproducible.

A good dataset only helps if every engine sees it the same way, which is the next step.

3. Run every engine fairly

Most bias creeps into a benchmark during the run itself. These conditions keep the comparison fair.

Record versions and configuration

Pin and document engine versions, as they change monthly. Many tools categorize detectors into tiers such as specific, generic, AI-based, and push-protection only. Results can vary significantly depending on the enabled tiers, so compare the configuration you plan to use in production.

Feed identical input

Same commits, same files, same format. Regardless of the vendor running method (one-time command, scan on push), make sure to provide the exact same input 

Account for post-processing and exclusions

Some engines filter findings after detection through validity checks, false-positive removal, or file-type exclusions. Ensure that reported results reflect what the end user actually sees. If you omit a feature, for example, due to performance issues with large scans, clearly state this in the results rather than omitting it without explanation.

Measure speed at production volume, not on a sample 

Our rule-based engine scans about 100 MB/s on a single thread. The fastest LLMs reach about 3 million tokens/s, roughly 9 MB/s at 3 bytes per token, and need dozens of parallel streams to get there. That’s 10x slower against one thread; compare like for like, with both sides parallelized, and the gap is closer to 100x.

Measure cost at production volume

We process about 0.5 TB a day for our customers. Even with the cheapest models, scanning that with an LLM would run upwards of $10,000 a day. A rule-based engine handles the same volume for a few tens of cents, roughly the cost of the machine it runs on. Hybrid engines keep cost under control: rules handle the bulk, and the LLM only sees a small, pre-filtered set of candidates.

Measure latency where it matters

Throughput isn't the whole story. Each use case has its own time budget:

  • Pre-commit hooks must answer in about a second. Any slower, and developers skip them.
  • CI checks add time to every pipeline, on every branch.
  • Push protection and real-time scanning (chat, tickets, wikis) must flag a secret before it spreads.

A single LLM API call can take seconds. Test each use case you plan to cover, not just bulk scans.

Run the same scan twice

Ensure results are stable by running the same scan twice and comparing outcomes. Audits, regression tests, and push protection require a consistent yes or no. In a hybrid engine, the deterministic core provides this stability, while the LLM enhances coverage.

Test failure modes

What if the model API is slow, rate-limited, or down? What if the vendor updates the model? A pure LLM engine stops or silently changes behavior. A hybrid engine degrades gracefully: the rules keep detecting.

Once every engine has run, the harder part starts: deciding which findings refer to the same secret.

4. Match findings across engines

This step is underestimated. Engines don't report secrets the same way.

  • Multi-part secrets. One engine reports a (client_id, client_secret) pair. Another only reports the secret part. Is that a match? Usually yes, if the sensitive part is found.
  • Different boundaries. One engine captures a full connection string. Another captures only the password inside it. Both may be right.
  • Generic vs specific. The same value can be caught by a specific detector in one tool and a generic one in another.

How to match findings fairly

  • Define matching rules before looking at results.
  • Match on location (file, line) plus string overlap, not exact string equality.
  • Normalize values: strip quotes, whitespace, encodings.
  • Check that each reported value exists verbatim in the source. LLM-based engines can truncate, reformat, or even invent strings.
  • When two engines disagree on boundaries, ask which match you could act on. Can you validate it? Revoke it? That's the better match.
  • Spot-check a random sample of matches by hand.

With matches defined, you can ask the question that matters most: which findings are real?

5. Label the results

On real data, nobody knows the ground truth. You must build it.

Don't measure one engine relative to another. A common shortcut: take everything engine A finds, then check if engine B finds it too. This only measures B's recall on A's findings. It says nothing about what A misses. Always label the union of all findings.

Two Venn diagrams comparing benchmark labeling methods. Left, the shortcut: only engine A’s findings are checked, so what engine A misses is never labeled. Right, the fair way: the findings of both engines are labeled, blind to which engine reported them.

Valid secrets are solid, but biased. A secret confirmed valid by a live check is a true positive. No debate. But only specific detectors can be checked. Generic secrets (passwords, custom tokens, internal keys) can't. They represent around 70% of what we detect in customer environments. A valid-only benchmark ignores most of the problem.

Use three labels, not two:

  • Real secret
  • Test, example, or intentionally public credential
  • False positive

The middle category matters. Example keys in docs or public client keys are not noise, but they are not critical leaks either.

Labeling at scale

Manual review doesn't scale past a few hundred items. An LLM classifier is a good option, for two reasons:

  • It scales: It can label thousands of findings in hours, with the same rules applied to each one.
  • It's an impartial judge: It has no stake in which engine wins. Unlike a vendor, or a team that already picked a favorite, it judges each finding on its context alone.

An LLM is a great tool to label benchmark data. But it wouldn't hold up as a pure detection engine. Scanning runs continuously, across terabytes of data. At that scale, an LLM is costly and slow, its findings are hard to explain, and it is weaker than rules on well-defined formats.

If you use one for labeling

An LLM judge is only as fair as the setup around it. These rules keep it impartial and checkable:

  • Give it the same context a human would get: file name, candidate secret, surrounding patch.
  • Write explicit rules with examples (variable vs literal, local test URL, public key).
  • Hide which engine produced each finding.
  • If an engine under test is LLM-based, label it with a different model. Otherwise, they share the same blind spots.
  • Run it twice with different prompts or models. Check that the trends hold.
  • Validate a random sample by hand.

Labels tell you who found what. The disagreements tell you why.

6. Investigate disagreements

The most useful insights live in findings that only one engine reports.

  • Look at what each engine misses. Then ask why.
  • Some misses are deliberate. For example, Google API keys in HTML files are often Maps keys, meant to be public. Skipping them is a design choice, not a gap.
  • Some "finds" are noise. A detector matching commit SHAs in URLs, or connection strings with no credentials, inflates counts without adding value.
  • Check near-misses. Right prefix, wrong length. Often a false positive.
  • Check well-known formats. AWS, GitHub, or Stripe keys follow strict formats. Rules catch them with near-perfect precision. Pure LLM engines can still miss, truncate or misclassify them. These misses hurt most: they are often valid, critical keys.
  • Ask each engine why. For any finding, can you tell what triggered it? A rule names its pattern. A pure LLM engine can only say "the model thought so". That makes findings hard to audit, tune, or justify to a developer whose push was blocked.

Once you know why engines disagree, you can turn the labels into numbers that hold up.

7. Report metrics that mean something

Metrics turn a benchmark into a decision, and they are also where it is easiest to mislead. Report each one with its frame.

  • Report precision and recall together. One without the other is meaningless. Since true recall is unknown, compute it against the union of labeled true positives, and say so.
  • Split generic and specific secrets. They behave very differently. Pure LLM engines may look strong on generic secrets and less reliable on specific ones. Rule-only engines often show the opposite. Hybrid engines aim to cover both. You need both views to see it.
  • Report cost and scan time next to accuracy. A slightly better recall at 100x the cost is rarely a good deal.
  • Weight by impact. A missed cloud provider key matters more than a missed weather API key. Break results down by category.
  • Don't compare detector counts. Having twice as many detectors means little if most cover low-value services.
  • Watch sample sizes. Below about 100 secrets in a category, flag the figure as low confidence.
  • State the frame of every number. "X% of secrets found by A" is not "X% of all secrets".

Even the best metrics only cover detection, and detection is only part of the job.

8. Look beyond detection

Finding a secret is step one. In real life, teams drown in alerts. Also evaluate:

  • Validity checks. Which findings are live right now?
  • Prioritization. Can the tool rank incidents by risk? Does it add context?
  • Scope and permissions analysis. What can an attacker actually do with the key?
  • Remediation. Can you revoke or rotate from the tool? How long does fixing one incident take?
  • Coverage. Which sources are scanned beyond git?

The most effective tool detects all secrets with minimal false positives. Missing high-risk secrets increases your exposure to potential threats. Prioritize effective triage and key insights at the top of the engine. This approach will help you mitigate risks faster.

Secrets detection benchmark checklist

Before you share any benchmark result, internally or with a vendor, run through this list. Each item maps to one of the steps above.

Checklist: 19 checks for a fair secrets detection benchmark, from writing down the benchmark question and using real machine-generated secrets to labeling the union of all findings, reporting precision and recall, and assessing non-detection features separately.

A fair benchmark won’t name a universal winner. It tells you which engine fits your data, your workflows, and your risk, and it shows its work so others can trust the result. Most of that comes from decisions made before any engine runs: the question, the dataset, and the matching and labeling rules. Bias also creeps in during the run itself.

See how it works

FAQ

What are the best secret detection tools?

The best tool depends on your data and workflow, so benchmark candidates on your own data sources. Use real, machine-generated secrets. Label every finding blind to which engine produced it. Report precision and recall split by generic and specific secrets, and compare cost, speed, and remediation features alongside accuracy.

How do you compare secrets detection vendors fairly?

Write down the question the benchmark should answer, then give every engine identical input, with versions and configuration recorded. Define matching rules before looking at results, label the union of all findings, and investigate the findings only one engine reports.

Can an LLM replace a secret detection engine?

A pure LLM approach is not suitable for production scale, as it is slower, more expensive at high volumes, and less effective than rule-based methods for well-defined key formats. LLMs are best used as impartial judges for labeling benchmark data or as part of a hybrid engine alongside rules.

What metrics should a secrets detection benchmark report?

Precision and recall together, computed against the union of labeled true positives. Split them by generic and specific secrets and by category, flag categories with fewer than about 100 secrets, and report cost and scan time next to accuracy.

Secret Scanning Tools 2026: Protect Code and Prevent Credential Leaks
Leaked credentials are one of the fastest paths to a breach. This guide compares the 18 best secrets detection tools for 2026 that help security teams find exposed API keys, database credentials, and hardcoded secrets before attackers do.
The Bot Left a Fingerprint: Detecting and Attributing LLM-Generated Passwords
LLMs leave statistical fingerprints in the passwords they generate. We built a 100-year-old model to find them and detected 28,000 in the wild.