vet
A free, local scanner for the agent layer of your repo — the secrets it can read, the permissions it runs with, the MCP servers it connects to, and the instruction files it obeys. One command before you open a PR.
npx @deepwissen/vet Part of the AI Preflight family — one detection engine, two surfaces: a VS Code extension, this CLI, and the shared engine they’re both built on.
What it is — A fast, local command-line security gate for AI-assisted development — the pre-PR counterpart to the extension. It scans what your AI agent is about to touch — secrets, trap files, prompt-injection, risky MCP/agent configs — before you open the PR. It answers one question: is it safe to merge what the agent just touched?
Local, zero-dependency, detect-and-explain only — it never modifies your files and never sends anything anywhere.
pickle.load — caught together. That's the "not just another secret scanner" point, in 25 seconds.Install
npx @deepwissen/vet # run once, nothing installed
npm i -g @deepwissen/vet # or install the `vet` command globally
Requires Node 18+. Pulls in @deepwissen/preflight-core (the engine) automatically. No
account, no sign-in.
Uninstall:
npm uninstall -g @deepwissen/vet # remove the global command
npm cache clean --force # optional — clears the npx cache too
npx leaves only a cache entry (nothing installed), so if you only ever ran npx @deepwissen/vet, there’s nothing to uninstall.
Your first scan
vet . # scan the whole project
You’ll get one of:
✓ vet: no findings in 306 file(s)
or a grouped report:
src/config.ts
ERROR [secret] AWS Access Key found in config.ts line 12 (long-lived credential)
→ move it to a secrets manager and prefer a short-lived, rotated credential
3 finding(s) across 2 file(s) — 1 error, 2 warning, 0 info
Exit codes: 0 clean · 1 findings at/above your --fail-on · 2 usage error.
Choosing what to scan
| Command | What it scans |
|---|---|
vet | files staged in git (the pre-commit default) |
vet <paths> | specific files or folders — ad hoc |
vet --since main | files changed since a branch/commit — pre-PR |
vet --history | past commits — catches deleted-but-leaked secrets still in git history |
vet canary | a runtime test of your agent’s ignore rules (see below) |
vet harden | your agent’s permission posture — is it over-permissioned? (see below) |
vet # staged changes (pre-commit)
vet src/ config.json # specific paths
vet --since main # the PR diff
vet --history # secrets committed then "deleted" but still in history
Two checks that go past a static scan
Most of vet reads your files. Two commands go further, because the agent layer has risks a file scan can’t see:
vet --history— a secret you committed and later removed is still sitting in your git history, fully recoverable. This finds those.vet canary— plants a clearly-fake credential in an ignored file (e.g..cursorignore’d), then you ask your agent a general question and runvet canary --check: it reports whether that fake token surfaced in what the agent could actually see..cursorignoreis a request, not a wall — this tests whether it held. Clean up withvet canary --cleanup(it removes the one marked file it wrote).
vet harden — is my agent over-permissioned?
Your agent’s permissions live scattered across config files — .claude/settings.json,
.mcp.json, maybe ~/.claude/settings.json — and most people never look. So they don’t
know: can my agent run any shell command? can it read my .env? is an MCP server
unpinned? vet harden answers that in one command, and tells you what to change — no
hunting through JSON.
vet harden # review this project's agent config posture
vet harden --global # also include your personal ~/.claude config
vet harden --json # machine-readable (for scripts / CI)
vet harden --fail-on warning # exit non-zero if any risk ≥ warning (CI gate)
No install ceremony — npx @deepwissen/vet harden works too.
What you get back — two sections and a verdict: the risks that are set and dangerous, and the protections that are missing:
RISKS (2) ← things that ARE set and dangerous
✗ permissions.allow grants Bash(*)
→ scope to specific commands, e.g. "Bash(git diff:*)"
✗ defaultMode is bypassPermissions
→ set to 'ask' so the agent prompts before acting
RECOMMENDED HARDENING (1) ← protection that's MISSING
+ add a secret read-block to permissions.deny
"permissions": { "deny": ["**/.env","**/*.pem","~/.ssh/**","~/.aws/credentials"] }
why: stop the agent reading credentials into context
POSTURE: 2 risks, 1 recommendation
Open the named file, apply the changes (scope the Bash(*), switch defaultMode to ask,
paste the deny block), and re-run. When it prints POSTURE: no known gaps, your agent
config is at a sane security baseline. It never edits your files — it shows you the
setting to add and you paste it.
When to run it:
-
Cloning someone else’s repo — before you let the agent loose, see what the committed config lets it do.
-
Onboarding to a team project — a teammate may have added
Bash(*)or an auto-approve flag; one command surfaces it. -
Auditing your personal setup —
vet harden --globalchecks the~/.claudeconfig that applies to all your projects. -
In CI — fail the PR if someone commits a risky agent config, same as a leaked secret:
- run: npx @deepwissen/vet harden --fail-on warning
The honest part: it’s an opinionated security baseline, not a guarantee — no known gaps
means nothing we check for is wrong, not “provably secure.” It’s security settings only
(Claude’s own /context and /skill-doctor own performance/token tuning), read-only (it
recommends, never rewrites — a consent-gated --fix may come later), and Claude Code
first (it understands .claude/settings.json and .mcp.json today; other tools as it
grows).
Mental model:
vet hardenis a security checkup for what your AI agent is allowed to do — it finds the dangerous settings, names the missing protections, and hands you the exact config to paste. You stay in control; it just makes the invisible visible.
Workflows
Before every commit (git hook):
# .husky/pre-commit (or .git/hooks/pre-commit)
npx @deepwissen/vet --fail-on error
Pre-PR gate (GitHub Actions):
on: [pull_request]
permissions: { contents: read, security-events: write }
jobs:
vet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with: { fetch-depth: 0 }
- uses: deepwissen/vet@v0.1.13 # pin the version
with: { fail-on: error } # scans PR diff, uploads SARIF
Any other CI (one line):
npx -y @deepwissen/vet@0.1.13 --since "$BASE_REF" --fail-on error
Feed a dashboard:
vet . --sarif > vet.sarif # → GitHub code scanning / GitLab / DefectDojo…
vet . --json | jq '.findings[]' # → custom
Choosing a strictness level
--fail-on | Blocks on | Use for |
|---|---|---|
error (default) | real exposures only — hardcoded/long-lived secrets, broad agent grants | PR gate, pre-commit |
warning | also traps, risky configs, MCP hygiene | hardened / release branches |
any | everything, incl. info | strict audits |
Warnings/info are report-only at the default — they inform review without breaking the build.
Handling false positives
A security tool earns trust by being quiet on noise. Two mechanisms — use the right one:
1. .vetignore — for whole surfaces (docs, fixtures, generated dirs). gitignore syntax,
at the repo root:
test/ # directory, any depth
*.md # docs with example secrets
.tiefrun/collections/** # tool-specific fixtures
!keep/real.md # negation (last match wins)
2. Inline vet:allow — for a single line in a file you want to keep scanning:
const sample = "pk_test_..."; // vet:allow -- Stripe docs example
// vet:allow-next-line aws-access-key
const example = "AKIA...";
Rule of thumb: .vetignore for “this whole area is examples”; vet:allow for “this one
line, but keep watching the rest of the file.” Both counts are always reported (never
silent). --no-ignore bypasses both for a true audit.
⚠️ Don’t
.vetignoreyour.github/workflows/or real source — that’s exactly where a real leak hurts most. Use inlinevet:allowthere instead.
What it checks
Five things — the first is table stakes; the other four are the agent layer almost no scanner looks at:
- Secrets — 54 provider formats (AWS, GitHub, Stripe, OpenAI, Anthropic…), auth headers
(Basic / Bearer / NTLM), JWT / PASETO / PASERK / NKEY, credentials in URLs and connection
strings, and generic
password/api_key/tokenfields with an entropy check — all with long-lived-vs-short-lived credential awareness. - Trap files — unsafe deserialization (
pickle,yaml.load,torch.load) that runs code the moment the data is loaded. - Excessive agent permissions (OWASP LLM06: Excessive Agency) —
Bash(*),--dangerously-skip-permissions, auto-approve — across Claude Code, MCP, Cline/Roo, Aider, Codex, Continue. - MCP config risk — embedded secrets, injected tool descriptions, over-broad grants, unpinned servers.
- Instruction-file integrity — prompt injection, hidden unicode, bidi tricks, fake LLM
role tags in
CLAUDE.md/.cursorrules/ copilot instructions / prompt files.
How it compares to gitleaks
On Samsung’s CredData benchmark (15,753 labeled secrets), vet (engine 0.1.29) vs gitleaks 8.30.1 with default rules:
| Metric | vet | gitleaks |
|---|---|---|
| Recall | 65% | 45% |
| Precision | 73% | 86% |
| F1 | 0.69 | 0.59 |
With default rules, gitleaks scores 0% on three categories vet catches — auth headers, URL credentials, and PASETO/PASERK. The trade-off is honest: vet raises more false alarms on clean code, mostly in docs and test fixtures. Both are true.
And gitleaks only does secrets — the other four checks above are outside its scope. Run both.
Same engine, in your editor
Prefer live feedback while you code? The AI Preflight VS Code extension runs the same checks in a sidebar as you edit (plus token/context analysis). Search “AI Preflight” in the Marketplace.
Fully local — no network calls, no telemetry, zero third-party dependencies. Read-only,
except vet canary, which writes one marked file and removes it with vet canary --cleanup.
One honest note: a clean scan means nothing was found — not that nothing is there. Run it before every PR, and again whenever you add an MCP server or change your agent’s settings.
Tech: TypeScript, zero runtime deps, published tokenlessly via OIDC Trusted Publishing.
Updates
-
New `vet harden` — a one-command security checkup for your agent's permissions.
- 🛡️ `vet harden` reads your scattered agent config (`.claude/settings.json`, `.mcp.json`, `~/.claude`) and reports what your agent is allowed to do — `Bash(*)`, bypass-permissions, unpinned MCP servers.
- It names the dangerous settings AND the missing protections, and hands you the exact config block to paste. Read-only — it never edits your files.
- CI-ready: `vet harden --fail-on warning` fails a PR that commits a risky agent config, the same way you'd gate a leaked secret.
Three clear jobs now: `vet` scans your code and configs for risk, `vet harden` is the focused 'is my agent over-permissioned?' checkup, and preflight (coming) manages your skills. Same engine.
-
Two checks that go past a static scan, plus a benchmark against gitleaks.
- 🕳️ `vet --history` — finds secrets committed and later deleted but still recoverable in git history.
- 🐦 `vet canary` — plants a fake credential in an ignored file and checks whether your agent could still see it (`.cursorignore` is a request, not a wall).
- 📊 Benchmarked on Samsung CredData (15,753 secrets): vet F1 0.69 vs gitleaks 0.59 — higher recall, honest about more false alarms on docs/fixtures.
Secrets now cover 54 provider formats, auth headers, and PASETO/PASERK — three classes gitleaks' default rules score 0% on. This page tracks the current release; check the changelog for fixes between versions.