vuln-scan
Static source-code vulnerability scan. Reads a target directory (and THREAT_MODEL.md if present), spawns parallel review subagents per focus area, and writes VULN-FINDINGS.json + .md for /triage to consume. Read-only — no building, running, or network. For execution-verified crashes, use vuln-pipeli
By anthropics · 995 installs
npx skills add anthropics/defending-code-reference-harness --skill vuln-scan
Source repository · Upstream listing
/vuln scan
Static vulnerability review of a source tree. Produces VULN FINDINGS.json
(+ a human readable .md ) that /triage ingests directly.
This skill does not execute code. It reads source and reasons about it.
For execution verified findings (ASAN crashes, reproducing PoCs), point the
user at vuln pipeline run <target — see README Step 2.
Tool fallbacks. Prefer the dedicated Glob and Grep tools. Some sessions
do not provision them — allowed tools is a permission filter, not a loader,
so listing them here does not make them appear. When Glob/Grep are
unavailable, fall back to the read only Bash commands whitelisted above:
rg files <scope / ls R for enumeration, rg n / grep rn for
search, wc / head / file for sniffing. These are the ONLY permitted
Bash commands; do not write helper scripts or pipe target content into a
shell interpreter.
Arguments
<target dir (required) — directory to scan. Relative or absolute.
focus <area — scan only this focus area (repeatable). Skips recon.
single — no subagent fan out; one sequential pass. Use on tiny targets
or when debugging the prompt.
extra <file — append the contents of <file to the review brief
(after the category list). Use to add org specific vulnerability classes,
compliance checks, or stack specific patterns. Plain text; same shape as
the category blocks below.
no score — skip the Step 3b confidence pass (saves a round of
subagents). Findings keep the scanner's self reported confidence only.
Step 1 — Scope
1. Resolve <target dir . If it doesn't exist or has no source files, stop
with an error.
2. Look for <target dir /THREAT MODEL.md . If present, parse its section 3 "Entry
points & trust boundaries" table and section 4 "Threats" table for focus areas
and threat classes. This is the preferred scoping input.
3. If no THREAT MODEL.md and no focus : do a quick recon — list the
source tree, read entry points and dispatch code, and propose 3 10 focus
areas using the pattern <subsystem (<function/file ) — <key operations .
Same shape as harness/prompts/recon prompt.py .
4. If focus was given, use exactly those.
Tell the user the focus areas you'll scan and the source file count before
fanning out.
Step 2 — Fan out
Unless single , spawn one Task subagent per focus area in parallel.
Cap at 10 concurrent. Each subagent gets the review brief below with its
focus area filled in. On tiny targets (<15 source files), fall through to
single automatically.
Review brief (per subagent)
Step 3 — Collate
1. Collect <finding blocks from all subagents. Drop category=none
placeholders.
2. Light dedupe — if two findings cite the same file:line with the
same category, keep the one with the longer description and note the
duplicate id. (Heavy dedupe is /triage 's job; don't over engineer here.)
3. Assign stable ids F 001 , F 002 , ... in (severity desc, file, line)
order.
Step 3b — Confidence pass (skip if no score )
A cheap second opinion read that ranks findings by signal quality.
Nothing is dropped — this pass calibrates confidence so humans and
/triage see high signal findings first. Spawn one Task subagent per
finding in parallel with the brief below. Shallow: re read and score, not
a full reachability trace.
Scoring brief (per finding)
Resolve: overwrite each finding's confidence with the score
(normalized to 0.0 1.0) and attach confidence reason . Re sort findings
by ( confidence desc, severity desc, file , line ) and reassign ids
F 001.. in that order. Compute low confidence count = findings with
confidence < 0.4, for the summary line.
Step 4 — Write output
Write both files to <target dir / :
VULN FINDINGS.json — the /triage ingest shape:
Findings are sorted by confidence desc (then severity, file, line), so
the top of the file is the highest signal material.
VULN FINDINGS.md — human readable: a summary table (id severity
category file:line title), then one F NNN section per finding with
the full description.
Step 5 — Hand back
Tell the user:
1. Counts: N findings (H/M/L split, X low confidence), across K focus
areas, from M source files.
2. Top 3 by confidence, one line each.
3. Next step: /triage <target dir /VULN FINDINGS.json repo <target dir
4. Remind: these are static candidates , not verified. For
execution verified crashes, vuln pipeline run <target (README Step 2).
Constraints
Never execute target code. No Bash, no builds, no docker , no network.
If the user asks you to "reproduce" or "confirm with a PoC," decline and
point at vuln pipeline .
Don't fabricate line numbers. Every file:line you emit must be
something you Read or Grep'd. If unsure of the exact line, cite the
function and say so in the description.
Stay in <target dir . Don't follow symlinks or .. out of it.
Findings are candidates for /triage , not final verdicts. This skill
never drops a finding — Step 3b only ranks. /triage does the rigorous
N vote verification and is where false positives actually get removed.
Provenance
The focus area recon pattern and memory safety quality tiers are lifted
from this repo's own harness/prompts/find prompt.py and
harness/prompts/recon prompt.py — the same logic the autonomous pipeline
uses, applied statically. The broader category menu, DO NOT REPORT
exclusions, per finding confidence pass, and
exploit scenario / recommendation output fields are adapted from
[ anthropics/claude code security review ](https://github.com/anthropics/claude code security review)'s
/security review command.