deepsec-vulnerability-scanner
AI agent skill for using deepsec, the agent-powered security vulnerability scanner for large codebases
What this skill does
# deepsec Vulnerability Scanner
> Skill by [ara.so](https://ara.so) — Daily 2026 Skills collection.
`deepsec` is an agent-powered vulnerability scanner that uses coding agents (Claude, Codex) at maximum thinking levels to surface hard-to-find security issues in large codebases. It uses regex matchers to find candidate sites, then AI to deeply investigate each one, producing actionable findings with severity ratings.
## Installation
Navigate to the root of the repo you want to scan:
```bash
npx deepsec init # creates .deepsec/ directory with project scaffolding
cd .deepsec
pnpm install # installs deepsec from npm
```
After init, bootstrap the installation by prompting your coding agent:
> Read `.deepsec/node_modules/deepsec/SKILL.md` to understand the tool. Then read `.deepsec/data/<id>/SETUP.md` and follow it: skim this repo's README, any AGENTS.md/CLAUDE.md, and a handful of representative code files, then replace each section of `.deepsec/data/<id>/INFO.md`. Keep it SHORT — target 50–100 lines total.
## AI Provider Setup
### Vercel AI Gateway (recommended for large scans)
```bash
export AI_GATEWAY_API_KEY=vck_...
```
One key covers both Claude and Codex. Get a key from the Vercel dashboard.
### Direct provider keys (bypasses gateway)
```bash
# Anthropic
export ANTHROPIC_AUTH_TOKEN=sk-ant-...
export ANTHROPIC_BASE_URL=https://api.anthropic.com
# OpenAI
export OPENAI_API_KEY=sk-...
export OPENAI_BASE_URL=https://api.openai.com/v1
```
Explicit values always win over `AI_GATEWAY_API_KEY` expansion.
## Core Workflow
Run these commands from inside `.deepsec/`:
```bash
# Step 1: Find candidate sites with regex matchers (fast, no AI)
pnpm deepsec scan
# Step 2: AI investigation — emits findings + recommendations
pnpm deepsec process
# Step 3: Optional — re-check findings, cuts false positive rate
pnpm deepsec revalidate
# Step 4: Export findings
pnpm deepsec export --format md-dir --out ./findings
```
### Full Command Reference
| Command | What it does |
|---|---|
| `scan` | Regex matcher pass — fast, no AI cost |
| `process` | AI deep-investigation of candidates |
| `triage` | Lightweight P0/P1/P2 classification (cheaper model) |
| `revalidate` | Re-check findings; checks git history for fixes |
| `enrich` | Add git committer info + ownership data |
| `report` | Markdown + JSON summary for one project |
| `export` | Per-finding JSON or directory of markdown files |
| `metrics` | Cross-project counts: severities, vulns by type, TPs |
| `status` | Snapshot of the project mirror |
| `sandbox <cmd>` | Run any command on Vercel Sandbox microVMs |
## Configuration
Create `deepsec.config.ts` in your `.deepsec/` directory:
```typescript
import { defineConfig } from 'deepsec';
export default defineConfig({
projects: [
{
id: 'my-app',
root: '../', // path to repo root, relative to .deepsec/
name: 'My Application',
}
],
// Model selection — defaults to highest capability
model: {
scan: 'claude-opus-4',
triage: 'claude-haiku-4',
},
// Concurrency for local processing
concurrency: 4,
});
```
See `docs/configuration.md` for the full `deepsec.config.ts` reference.
## Writing Custom Matchers
Matchers are regex patterns that identify candidate code sites for AI investigation. Prompt your coding agent with the writing-matchers doc to grow your matcher set:
> Read `docs/writing-matchers.md` and add matchers for [specific concern] in our codebase.
Example matcher file structure:
```typescript
// .deepsec/matchers/auth.ts
import { defineMatcher } from 'deepsec';
export default defineMatcher({
id: 'jwt-none-alg',
description: 'JWT algorithm set to none or not verified',
severity: 'critical',
pattern: /jwt\.verify\s*\(|algorithm['":\s]+['"]none['"]/gi,
fileGlobs: ['**/*.ts', '**/*.js'],
// Context lines to include around match
contextLines: 10,
});
```
```typescript
// .deepsec/matchers/sql.ts
import { defineMatcher } from 'deepsec';
export default defineMatcher({
id: 'raw-sql-interpolation',
description: 'String interpolation directly into SQL queries',
severity: 'high',
pattern: /`\s*SELECT|INSERT|UPDATE|DELETE.*\$\{/gi,
fileGlobs: ['**/*.ts', '**/*.js', '**/*.py'],
contextLines: 15,
// Provide project-specific context to the AI investigator
hint: 'Check if user-controlled input reaches query construction. Our ORM is Prisma; raw queries use prisma.$queryRaw.',
});
```
## INFO.md: Project Context for AI
The `INFO.md` file is injected into every scan batch. Keep it 50–100 lines:
```markdown
## Auth
- JWT issued by `lib/auth/jwt.ts` → `signToken()` / `verifyToken()`
- Session middleware: `middleware/session.ts` wraps all `/api/*` routes
- RBAC: `lib/permissions.ts` → `can(user, action, resource)`
## Data Access
- ORM: Prisma via `lib/db.ts` singleton
- Raw queries only in `lib/db/raw.ts` — uses tagged template `sql\`\``
- User input reaches DB through `services/` layer only
## External Inputs
- Webhooks: `app/api/webhooks/` — bodies parsed before signature check in v1 routes
- File uploads: `app/api/upload/` → stored in S3, filenames sanitized by `lib/storage.ts`
## Known Sensitive Areas
- `lib/crypto.ts` — key derivation, do not flag standard bcrypt usage as vuln
- `app/admin/` — intentionally privileged, verify RBAC not auth bypass
```
## Distributed Execution (Vercel Sandbox)
Fan work across microVMs for large monorepos:
```bash
# Process using 10 sandboxes, 4 concurrent per sandbox
pnpm deepsec sandbox process \
--project-id my-app \
--sandboxes 10 \
--concurrency 4
```
```bash
# Full distributed pipeline
pnpm deepsec sandbox scan --project-id my-app --sandboxes 5
pnpm deepsec sandbox process --project-id my-app --sandboxes 10 --concurrency 4
pnpm deepsec sandbox revalidate --project-id my-app --sandboxes 5
```
Requires a Vercel account. The local working tree is tarballed and uploaded (`.git` excluded). Supports both OIDC tokens (local) and access tokens (CI).
For CI environments:
```bash
export VERCEL_ACCESS_TOKEN=your_token_here
export VERCEL_TEAM_ID=team_xxx
```
## Export Formats
```bash
# Directory of markdown files (one per finding)
pnpm deepsec export --format md-dir --out ./findings
# Single JSON file with all findings
pnpm deepsec export --format json --out ./findings.json
# Per-finding JSON files
pnpm deepsec export --format json-dir --out ./findings-json
```
## Viewing Results
```bash
# Summary report for a project
pnpm deepsec report --project-id my-app
# Cross-project metrics
pnpm deepsec metrics
# Current pipeline status
pnpm deepsec status
```
## Idempotency and Resuming
Commands are idempotent — safe to interrupt and restart:
```bash
# If process is interrupted, just re-run — it picks up where it left off
pnpm deepsec process
# Force re-process specific files
pnpm deepsec process --force --file src/auth/login.ts
```
## Plugin Authoring
```typescript
// .deepsec/plugins/jira-ownership.ts
import { definePlugin } from 'deepsec';
export default definePlugin({
name: 'jira-ownership',
hooks: {
// Called during `enrich` — add owner metadata to findings
async enrichFinding(finding) {
const owner = await fetchJiraTeamForPath(finding.file);
return {
...finding,
metadata: { ...finding.metadata, team: owner },
};
},
},
});
```
Register in `deepsec.config.ts`:
```typescript
import { defineConfig } from 'deepsec';
import jiraOwnership from './plugins/jira-ownership';
export default defineConfig({
plugins: [jiraOwnership],
projects: [{ id: 'my-app', root: '../' }],
});
```
## Data Layout
Key paths inside `.deepsec/data/<project-id>/`:
```
data/<id>/
SETUP.md # one-time agent bootstrap instructions
INFO.md # project context injected into every scan batch
scan/ # FileRecord JSON from matcher pass
findings/ # AI-produced findings (one JSON per finding)
revalidated/ # findings after revalidaRelated in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.