Security · AI Agents

We Ran vet, Our Own Secret Scanner, on Our Repos — 21 False Positives, Every One Fixed

We built vet, a security scanner for the AI-agent era, and pointed it at our own code. It found 21 issues — every one a false positive. For a security tool that's existential. Here's the full autopsy: 9 root causes, every fix, and the discipline that keeps a scanner's red light meaningful.

Contents
Contents
  1. Why false positives are the whole ballgame
  2. 1. Entropy noise on files that aren’t code
  3. 2. Confusing a field name for a secret value
  4. 3. Template placeholders
  5. 4. Obvious example literals
  6. 5. The right rule in the wrong language
  7. 6. GitHub Actions permissions aren’t secrets
  8. 7. The standard CI clone idiom
  9. 8. A keyword inside prose
  10. 9. The one that was a semantic bug — Stripe publishable keys
  11. The discipline that made it safe
  12. The result
  13. Why this tool exists at all

We build vet — a security scanner for the AI-agent era. It checks what an AI coding agent is about to touch before you open the PR: exposed secrets, trap files, prompt-injection in instruction files, risky MCP configs, and — the part almost nobody else checks — whether your agent is configured to run anything without asking (OWASP LLM06, “excessive agency”).

So naturally, the first thing we did with it was point it at our own codebases.

It found 21 issues. Zero were real.

That’s not a flex. For a security tool, it’s an existential problem — and fixing it taught us more about building a trustworthy scanner than shipping the detectors did. Here’s the full autopsy.

Why false positives are the whole ballgame

A security gate that cries wolf doesn’t get tuned. It gets --no-verify’d, then continue-on-error: true’d, then deleted. The moment a developer stops believing a red result means something real, your tool is dead weight — worse than nothing, because it provides false assurance.

So we adopted one rule: every false positive is a bug, triaged to root cause, fixed in the engine, and locked with a regression test — and every fix ships with a “positive control” proving the real detection still fires. You cannot make the scanner quiet by making it blind.

Here are the 21 findings — which collapsed into 9 distinct root causes.

1. Entropy noise on files that aren’t code

11 of the 21 were a single disease: our Shannon-entropy layer firing on generated and asset files.

  • Mermaid-generated SVGs — long path and style data scores high on entropy.
  • Minified JS/CSS, source maps, lockfile hashes — all high-entropy, none of it a secret.

The fix: skip the entropy layer entirely for .svg, .min.*, .map, and lockfiles — and treat any string containing CSS/markup/code punctuation (; { } < > ( ) ,) as non-secret. A real credential token is drawn from [A-Za-z0-9_\-+/=.:~]; it never contains a semicolon or an angle bracket.

Lesson: entropy is a heuristic, not an oracle. Scope it to where secrets actually live.

2. Confusing a field name for a secret value

const body = JSON.stringify({ anthropic_api_key: key });

Flagged. But key is a variable — the literal anthropic_api_key is just a field name. There’s no secret here.

The fix: in code, the keyword layer only fires when the value is a credential-shaped literal — not a bare identifier, function call, or field echo.

Lesson: keyword + ":" + something is not a secret. keyword + ":" + a-literal-that-looks-like-one is.

3. Template placeholders

const token = `{{${name}}}`;
const headers = { bearerToken: '{{bearerToken}}' };

Mustache/Handlebars/ERB placeholders ({{var}}, <%= %>) are the opposite of a hardcoded secret — they’re the explicit absence of one.

The fix: recognize template interpolation as a placeholder, same bucket as ${ENV} and <your-key-here>.

4. Obvious example literals

bearerToken = "oauth2-token-here"
api_key = "api-key-goes-here"

The fix: …-here / …-goes-here suffixes join the placeholder list.

Lesson (3 & 4): docs and examples are full of secret-shaped non-secrets. A scanner that can’t tell “fill this in” from “oops, committed a key” is unusable in any repo with a README.

5. The right rule in the wrong language

const cfg = yaml.load(src); // TypeScript, js-yaml v4

We flagged yaml.load as unsafe deserialization. That’s true for Python’s PyYAML — but js-yaml v4’s load is safe by default (the unsafe one was removed years ago). Same method name, opposite safety.

The fix: gate the yaml.load rule to Python. yaml.unsafe_load is still flagged everywhere.

Lesson: a rule without language context is a rule that’s wrong half the time.

6. GitHub Actions permissions aren’t secrets

permissions:
  id-token: write

The keyword matcher saw …token: write and flagged it. But id-token: write is an OIDC permission grant — in fact, it’s how you do tokenless publishing. Flagging it is almost ironic.

The fix: read/write/none permission values are not secrets.

7. The standard CI clone idiom

git clone https://x-access-token:${GH_TOKEN}@github.com/org/repo.git

Our “credentials in URL” rule fired — but the “password” is ${GH_TOKEN}, a variable injected from a secret, not an embedded credential. This is the canonical GitHub Actions pattern; flagging it would hit a huge fraction of real workflows.

The fix: skip URL credentials whose password is an interpolation (${…}, {{…}}, $VAR, %VAR%). A literal embedded password still fires — we tested that.

8. A keyword inside prose

echo "2. Add as repository secret:"

The word “secret:” in a help message, with the matcher grabbing a stray quote as the “value.”

The fix: an unquoted value that isn’t credential-shaped (a lone quote, punctuation) isn’t a finding.

9. The one that was a semantic bug — Stripe publishable keys

pk_live_…

We flagged it as a secret. It isn’t. Stripe has three live-key prefixes:

  • sk_live_ — secret key 🔴
  • rk_live_ — restricted key 🔴
  • pk_live_ — publishable key 🟢 — designed to be public, shipped in your client-side JavaScript

Our pattern matched [spr]k_live_ — all three. Flagging a publishable key as a long-lived secret isn’t noise; it’s telling someone to panic about a value that’s supposed to be in public code.

The fix: [sr]k_live_. One character. sk_/rk_ still error; pk_ goes quiet.

Lesson: this is the one that most looked like a false positive but was actually a knowledge bug. Getting these right is the difference between “a regex that matches key-shaped strings” and “a scanner that understands secrets.”

The discipline that made it safe

Three rules kept this from degrading into “mute everything until it’s green”:

  1. Root cause, not symptom. We didn’t allowlist 11 SVGs — we fixed the entropy-on-assets class.
  2. Positive controls, every time. Every FP fix shipped with a test proving the real thing still fires: sk_live_… still errors, a literal admin:hunter2@host URL still errors, a genuine high-entropy token still errors. You don’t earn quiet by going blind.
  3. Know what not to fix. The long tail — a repo’s test fixtures, a canonical jwt.io sample JWT, local-dev defaults — doesn’t belong in the engine. That’s what a .vetignore and inline // vet:allow are for. Pushing every one into the detector trades false positives for false negatives. The skill is drawing that line.

The result

After the fixes, we re-ran vet across a real 306-file repo: 85 findings → 0, every one confirmed by hand as illustrative/fixture, zero live credentials — and the positive controls all still fired. The gate is now enforcing in CI, blocking on real exposures, quiet on noise.

That’s the bar for a security tool: not “finds things,” but “the red light means something.”

Why this tool exists at all

Secrets are table stakes — gitleaks and friends do that well. What pulled us into building vet is the agent era: your AI assistant now reads your files, follows your instruction files, and calls MCP tools. The risky moment moved upstream — to what enters the model’s context and what the agent is allowed to do. So alongside secrets, vet flags:

  • Trap files — unsafe deserialization an agent shouldn’t auto-ingest.
  • Instruction-file integrity — prompt injection, hidden unicode, bidi overrides, LLM role-tag spoofing in CLAUDE.md / .cursorrules.
  • MCP hygiene — embedded secrets, unpinned servers, over-broad alwaysAllow: ["*"].
  • Excessive agency (LLM06) — can an agent here run Bash(*), or is --dangerously-skip-permissions wired into CI? Almost no tool checks this. It’s the one we’re proudest of.
Terminal demo: a single 'vet .' scan flags a hardcoded AWS key, an over-permissioned agent config (Bash *), and an unsafe pickle.load trap at once — then gates on error, writes SARIF, and passes a clean file.
One vet . — a hardcoded secret, an over-permissioned agent config, and an unsafe pickle.load, caught in a single scan.

It’s local, zero-dependency, detect-and-explain only — it never modifies your files and never sends anything anywhere.

npx @deepwissen/vet            # scan staged changes
npx @deepwissen/vet --since main

If you point it at your repo and it cries wolf — open an issue. That’s literally how we got here.

Sources & further reading

  1. 1OWASP Top 10 for LLM Applications (LLM06: Excessive Agency)owasp.org

Related content

Article 7-min read AI Agents Nov 27

Why I Built Preflight

Skills, plugins, and hooks make coding agents more useful — and they're instructions your AI follows and code it runs, installed from the internet. Malicious ones are already in the wild. Preflight is the pre-flight checklist: see what your agent carries, scan it for what actually hurts, and choose what to install — before you trust it.