Run vercel-labs/deepsec — an agent-powered vulnerability scanner — against any local codebase. Use when Kevin says "deepsec", "security scan", "scan this repo for vulns", "find security bugs in <repo>", "audit <project> for vulnerabilities", "production security review", or before shipping a new service. Performs a regex pre-scan, chooses a current benchmark-backed `best`, `value`, or `budget` model/harness profile, investigates candidates, revalidates to cut false positives, and exports actionable findings. Cost-aware: always preserve the benchmark snapshot and run a `--limit 50` calibration before a full scan.
Run vercel-labs/deepsec — Vercel's open-source security harness — against any local codebase Kevin asks to audit. deepsec installs into a .deepsec/ directory inside the target repo (checked into the same git repo so config and matchers travel with the code) and uses coding agents to investigate security-sensitive files at maximum thinking.
deepsec uses high-reasoning agents and can spend heavily. Model names and prices change; do not copy a historical default from this skill into a run. Full scans cost real money:
| Files | Approx cost | Approx wall time |
|---|---|---|
| 100 | $25–60 | 5–15 min |
| 500 | $130–300 | 25–60 min |
| 2,000 | $500–1,200 | 1.5–4 hr |
Iron rule: never run a full process without explicit confirmation from Kevin of the expected dollar amount. Always start with --limit 50 to calibrate. For repos > 1,000 files, compare the current value and budget profiles and propose Vercel Sandbox fanout before suggesting a full best run.
node -v)pnpm available (deepsec scaffold uses pnpm; npm/yarn work but pnpm is the documented path)codex CLI subscription (the reviewed upstream default backend)claude CLI subscriptionAI_GATEWAY_API_KEY=vck_... (Vercel AI Gateway — covers both Claude and Codex with one token)ANTHROPIC_AUTH_TOKEN / OPENAI_API_KEYIf sandbox fanout is needed: a Vercel account with OIDC tokens or access tokens.
init → INFO.md → scan → process → triage → revalidate → export
(project-aware (regex, (AI, (P0/P1/P2) (re-check (markdown
context for the no AI, expensive, code + or JSON)
prompts) ~15s) iterative) git
history)From inside the target repo's root (NOT from .deepsec/):
npx deepsec init
cd .deepsec
pnpm installThis creates .deepsec/ with:
package.json — pinned deepsec installdeepsec.config.ts — one projects[] entry pointing at ..data/<id>/INFO.md — the per-project context document (placeholders)data/<id>/SETUP.md — agent prompt for filling INFO.mdAGENTS.md, .env.local, .gitignoreOpen .env.local and fill in AI_GATEWAY_API_KEY (or rely on logged-in claude / codex). Kevin's typical setup: rely on his existing Claude subscription unless this is a CI run.
INFO.md (project-aware context)INFO.md is injected into every scan batch's prompt. Vague INFO.md → vague findings. Quality of this file is the highest-leverage tunable.
In the parent repo (NOT inside .deepsec/):
.deepsec/node_modules/deepsec/SKILL.md (deepsec's bundled skill) to internalize the format the tool expects..deepsec/data/<id>/SETUP.md for project-specific instructions.README.md · Any AGENTS.md / CLAUDE.md / .cursorrules · 5–10 representative source files (entry points, auth, data layer, middleware).deepsec/data/<id>/INFO.md.Writing rules for INFO.md:
pnpm deepsec scanRuns ~110 regex matchers across the codebase. Output goes to data/<id>/files/ as one FileRecord JSON per scanned source file. Then:
pnpm deepsec statusShows files scanned, files pending AI investigation, count of candidate sites. Report this to Kevin before proceeding to process.
Deepsec's setup reads the current DeepSecBench results and supports three headless profiles:
best: highest compatible score;value: highest score within 2.5× the cheapest recommendation;budget: cheapest compatible recommended combination.For a new setup, preserve the JSON output as run evidence:
npx deepsec init --yes --model-profile value --output jsonlUse best for a one-time baseline only when the projected cost is approved. Use value as the default comparison point and budget for broad calibration. Direct OpenAI/Anthropic credentials restrict compatible harnesses; alternate models run through the Pi backend. Social benchmark claims are snapshots, not permanent defaults. Record the selected model, harness, reasoning level, benchmark timestamp, price route, and zero-data-retention policy.
Always start with a limit:
pnpm deepsec process --limit 50 --concurrency 5The persisted setup supplies the selected backend/model. With --limit 50 you'll see real cost per file on this codebase. Multiply out, show Kevin the projected total cost, get explicit approval before lifting the limit.
For an explicit alternate route:
pnpm deepsec process --agent pi --model zai/glm-5.2 --limit 50Current upstream defaults at the 2026-08-10 review are Codex/GPT-5.5, Claude/Opus 4.8, and Pi/GLM 5.2, but the live DeepSecBench profile and the limited run—not this sentence—govern selection.
pnpm deepsec process --concurrency 5Idempotent — interrupt and re-run, deepsec picks up where it stopped.
pnpm deepsec triage --severity HIGH # ~1¢/finding, P0/P1/P2 labels
pnpm deepsec revalidate --min-severity HIGH # cuts FP rate by 50%+Both optional but worth running on the HIGH/CRITICAL set before showing findings to Kevin or anyone else.
pnpm deepsec enrichAdds git committer info to each finding. With a custom plugin, can add ownership/team data.
pnpm deepsec export --format md-dir --out ./findings
pnpm deepsec export --format json --out findings.json
pnpm deepsec metrics # cross-project countsmd-dir → one markdown file per finding under ./findings/{CRITICAL,HIGH,MEDIUM,LOW}/. Each file is structured to be pasted directly into a Linear/GitHub issue or fed to a coding agent for remediation.
For monorepos > 1,000 files where local scanning would take days:
pnpm deepsec sandbox process \
--project-id my-app \
--sandboxes 10 \
--concurrency 4Tarballs the working tree (excludes .git), uploads to Vercel Sandbox microVMs, runs in parallel. API keys stay outside the sandbox so they can't be exfiltrated. Vercel runs scans on their own monorepos at 1,000+ concurrent sandboxes.
Requires AI_GATEWAY_API_KEY and a Vercel account. See docs/vercel-setup.md.
After a first scan, ask the agent to write project-specific matchers:
Inspect previous deepsec runs against ./my-app. Are there custom matchers we should add to find more candidates for vulnerabilities? Look at the auth model, data layer, and team conventions.
Each new matcher widens the regex pre-scan's coverage without adding AI cost. This is how Vercel built their internal "every authentication path" scanner.
deepsec has a 10–20% false positive rate (per Vercel; revalidate cuts it). When presenting findings to Kevin:
process without --limit on first invocation. Always calibrate..deepsec/ is checked into git (config, matchers). Generated output in data/<id>/files/, data/<id>/runs/ is gitignored.After a scan that surfaces new patterns:
wiki/tools/deepsec.md under "Custom matchers used".wiki/postmortems/.wiki/concepts/auth-condition-edge-cases.md).wiki/log.md: ## [YYYY-MM-DD] security-scan | <repo> — N findings (C: x, H: y, M: z)