Build This Now
Build This Now
Qu'est-ce que le code Claude ?Installer Claude CodeL'installateur natif de Claude CodeTon premier projet Claude Code
Claude Code v2.1.122 Release NotesClaude Code Dynamic Workflows : comment orchestrer 1 000 sous-agents sur une vraie codebaseBonnes pratiques Claude CodeMeilleures pratiques pour Claude Opus 4.7Claude Code sur un VPSIntégration GitRevue de code avec Claude CodeLes Worktrees avec Claude CodeClaude Code à distanceClaude Code ChannelsChannels, Routines, Teleport, DispatchTâches planifiées avec Claude CodePermissions Claude CodeLe mode auto de Claude CodeAjouter les paiements Stripe avec Claude CodeFeedback LoopsWorkflows TodoGestion des tâches dans Claude CodeTemplates de projetTarification et utilisation des tokens Claude CodeTarifs de Claude Code : ce que tu vas vraiment payerClaude Code Ultra ReviewConstruire une app Next.js avec Claude CodeClaude Code With Supabase: Database, Auth, RLSVercel deepsec with Claude CodeTest-Driven Development with Claude CodeCommerce agentique : comment construire une app que les agents IA peuvent payerClaude Code 1M Context in Practice: When Bigger Isn't BetterClaude Code GitHub Actions Setup Guide (@claude + Cron)Claude Code Headless Mode: The Definitive Guide to claude -pClaude Code Max Plan vs API Cost: Break-Even GuideClaude Code Prompt Caching: The Token Discount Most People Never Turn OnCombien coûte la création d'un SaaS avec Claude Code en 2026Run a Team of AI Agents in Parallel with Git WorktreesPrompt Injection in Coding Agents: How to Not Get Pwned
speedy_devvkoen_salo
Blog/Handbook/Workflow/Vercel deepsec with Claude Code

Vercel deepsec with Claude Code

Open-source security harness from vercel-labs that audits your repo with Claude Opus. Wire it into the Claude Code build loop.

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.

Published May 10, 20267 min readHandbook hubWorkflow index

Problem: Static scanners flag style and miss the bug a security engineer would catch on read-through. Snyk and Semgrep look at known patterns. They do not read intent. Path traversal in your own glue code, broken auth in a route handler, an SSRF inside a server action. Pattern matchers walk past those because the shape is yours, not a CVE template.

deepsec does the read. Vercel open-sourced it on May 4, 2026 under vercel-labs. It is a CLI, Apache 2.0, and it points your existing Claude Opus 4.7 (or Codex GPT-5.5) at your repo at max thinking. Findings come back ranked by severity, with git blame stuck on each one.

The point of this post is not to use deepsec on its own. The point is to wire it into a Claude Code session so the same model that built the feature also fixes what the audit returns.

Quick Win: Drop into a repo and try one PR-scoped pass:

ANTHROPIC_AUTH_TOKEN=$ANTHROPIC_API_KEY \
  npx deepsec init && \
  pnpm --dir .deepsec install && \
  pnpm --dir .deepsec deepsec process --diff

What deepsec actually is

A harness, not a scanner. The regex layer at the top handles file selection. Coding agents do the actual analysis. Each finding lands as a JSON FileRecord under .deepsec/data/<projectId>/, additive on every run.

Pluggable agents mean you pick the model. Vercel's default is Claude Opus 4.7 at max effort or Codex GPT-5.5 at xhigh, both routed through Vercel AI Gateway. Bring your own Anthropic key and the gateway step is optional.

False positive rate sits around 10 to 20%. Cost on a fresh laptop run is a few dollars per hundred files. On a real monorepo it climbs into the thousands. That is the tradeoff for agentic depth.

The Five Stages

Every run walks the same pipeline. Each stage is idempotent so you can rerun any of them in isolation:

StageWhat runsAI cost
scan~110 regex matchers pick security-sensitive filesNone
processAgents read each file, trace data flows, write findingsHigh
revalidateA second agent pass tags false positivesMedium
enrichGit blame stamps owner metadata on each findingNone
exportMarkdown per finding (P0 to P2) plus JSONNone

scan finishes in around 15 seconds on a 2k-file repo. The cost lives in process. That is where you decide how much to pay.

Final File Tree

After init, your repo gets a single tracked folder and an ignored data tree:

your-repo/
├── .deepsec/
│   ├── deepsec.config.ts
│   ├── package.json
│   └── data/
│       └── <projectId>/
│           ├── INFO.md
│           ├── records/
│           └── findings/
├── .claude/
│   ├── skills/
│   │   └── deepsec/
│   │       └── SKILL.md
│   └── agents/
│       └── security-fixer.md
└── package.json

INFO.md is the project context the agents read first. Auto-fill it from your discovery docs if you have them. The agents follow it like a CLAUDE.md.

Wrap deepsec as a Claude Code Skill

The skill is a thin shell. It hands off to the deepsec CLI and parses what comes back. The skill never decides what to fix. That is the agent's job below.

Create the file at .claude/skills/deepsec/SKILL.md:

---
name: deepsec
description: Run a Vercel deepsec audit on the current repo. Triggers on "audit security", "run deepsec", "scan for vulnerabilities". Returns the path to the findings folder.
---

# deepsec

CLI wrapper around vercel-labs/deepsec.

## Commands

Init (once per repo):

```bash
npx deepsec init && pnpm --dir .deepsec install
```

PR-scoped pass (cheap, run on every feature):

```bash
pnpm --dir .deepsec deepsec process --diff
pnpm --dir .deepsec deepsec revalidate
pnpm --dir .deepsec deepsec export --format md-dir --out ../findings
```

Full scan (expensive, run weekly):

```bash
pnpm --dir .deepsec deepsec sandbox process --sandboxes 10 --concurrency 4
```

Output lives at `./findings/*.md`. Hand the folder to `security-fixer`.

Build the security-fixer Agent

This is the loop closer. The agent reads each markdown finding, opens the file deepsec flagged, and either patches it or writes a justification. Then it re-runs revalidate to confirm the patch sticks.

Create .claude/agents/security-fixer.md:

---
name: security-fixer
description: Reads deepsec findings and patches each one. Fails if any P0 remains after one pass.
tools: Read, Edit, Write, Bash, Grep
---

You receive a folder of deepsec findings at `./findings/`.

For each file in the folder:
1. Read the finding. Note the severity (P0 / P1 / P2), file path, line range, and proposed mitigation.
2. Open the source file at the cited line range.
3. If the finding is correct, patch the code. Keep the patch minimal. No drive-by refactors.
4. If the finding is a false positive, add a one-line justification comment with the deepsec finding ID. Do not silence the finding any other way.
5. Move the markdown to `./findings/resolved/`.

After the loop, run:

```bash
pnpm --dir .deepsec deepsec process --diff && \
pnpm --dir .deepsec deepsec revalidate
```

If any P0 remains, exit with status 1. The orchestrator will requeue.

Two agents now own the security loop. deepsec finds. security-fixer patches. Neither one trusts itself.

Hook It Into /ship

Most build systems already have a feature-completion command. In Build This Now that is /ship. The audit fits at the end, after the GAN evaluator passes and before the feature is marked done.

Add a step to your existing pipeline. The exact wiring depends on your orchestrator, but the shape is the same:

- name: deepsec audit
  run: pnpm --dir .deepsec deepsec process --diff && \
       pnpm --dir .deepsec deepsec revalidate && \
       pnpm --dir .deepsec deepsec export --format md-dir --out ./findings
- name: fix findings
  agent: security-fixer
  inputs:
    findings_dir: ./findings
  fail_on: P0

Run it on the diff, not the whole repo. Full scans go in a weekly cron, not the per-feature loop. The diff mode keeps the bill in the dollars and the wall clock under a minute.

Cost and Cadence

Three modes, three budgets. Pick by what you can afford and what you ship:

ModeCost per runCadenceUse case
--diff on PR$1 to $20Every featureThe default. Catches what the LLM just wrote.
Sandbox fanout$50 to $500WeeklyThe whole repo, parallel across Vercel Sandboxes.
Full local scan$1k to $10k+QuarterlyThe deep audit. Plan it like a security engagement.

Vercel runs the sandbox mode at over a thousand concurrent containers on their own monorepo. You will not need that. Ten sandboxes at concurrency four covers a Next.js app comfortably.

Layer Vercel Agent on the PR

deepsec is the local layer. Vercel Agent is the remote one. It reads your CLAUDE.md natively and replies on the PR when you tag it.

Open the PR, tag the agent, and Claude Code reads the comments back through gh:

gh pr comment <num> --body "@vercel run a review"
gh pr view <num> --comments

Two sets of eyes. One inside the editor at write time. One on GitHub at review time. They overlap on purpose.

What You Get After One Feature

Run the full loop on a new endpoint and you end up with:

  • .deepsec/data/<projectId>/findings/: JSON record per finding, owner included
  • ./findings/*.md: human-readable findings, one file each
  • A clean diff against your branch with each P0 patched
  • A revalidate pass that confirms the patches close the finding
  • Zero P0 findings open at merge time

That is the target state. If you cannot hit it, the feature does not ship.

Remember: deepsec does not catch business-logic flaws, role-based authz edge cases, or async races. It catches the bugs an experienced security engineer would catch on a careful read. Pair it with hooks for the rest. Sandbox the runtime. Stack the layers.

The old security pass was a quarterly engagement and a stack of Jira tickets. The new one runs in the same loop that wrote the code, in dollars instead of weeks. Build the loop once. Ship audited features after that.


Posted by @speedy_devv

Continue in Workflow

  • Commerce agentique : comment construire une app que les agents IA peuvent payer
    Un guide en français simple du commerce agentique en 2026 : ce que font x402, ACP et le Machine Payments Protocol, plus un pas-à-pas d'un week-end pour livrer une API payante que les agents IA peuvent acheter.
  • Bonnes pratiques Claude Code
    Cinq habitudes séparent les ingénieurs qui livrent avec Claude Code : les PRDs, les règles CLAUDE.md modulaires, les slash commands personnalisés, les resets /clear, et un état d'esprit d'évolution du système.
  • Le mode auto de Claude Code
    Un second modèle Sonnet examine chaque appel d'outil Claude Code avant qu'il s'exécute. Ce que le mode auto bloque, ce qu'il autorise, et les règles d'autorisation qu'il place dans tes paramètres.
  • Channels, Routines, Teleport, Dispatch
    Les quatre fonctionnalités Claude Code livrées par Anthropic en mars et avril 2026 qui transforment le CLI en une couche de coordination orientée événements, entre téléphone, web et desktop.
  • Claude Code 1M Context in Practice: When Bigger Isn't Better
    The 1M-token context window is GA at flat pricing, but bigger isn't always better. A decision framework, token-cost math, and when to use /compact, subagents, and dynamic workflows instead.
  • Claude Code Channels
    Connecte Claude Code à Telegram, Discord ou iMessage avec des serveurs MCP plugin. Walkthroughs de setup et workflows mobiles async qui valent la peine d'être configurés.

More from Handbook

  • Principes de base de l'agent
    Cinq façons de construire des agents spécialisés dans le code Claude : Sous-agents de tâches, .claude/agents YAML, commandes slash personnalisées, personas CLAUDE.md, et invites de perspective.
  • L'ingénierie du harness agent
    Le harness, c'est toutes les couches autour de ton agent IA sauf le modèle lui-même. Découvre les cinq leviers de contrôle, le paradoxe des contraintes, et pourquoi le design du harness détermine les performances de l'agent bien plus que le modèle.
  • Patterns d'agents
    Orchestrateur, fan-out, chaîne de validation, routage par spécialiste, raffinement progressif, et watchdog. Six formes d'orchestration pour câbler des sub-agents Claude Code.
  • Meilleures pratiques des équipes d'agents
    Patterns éprouvés pour les équipes d'agents Claude Code. Prompts de création riches en contexte, tâches bien calibrées, propriété des fichiers, mode délégué, et correctifs v2.1.33-v2.1.45.

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.

Claude Code With Supabase: Database, Auth, RLS

Set up Supabase in a Next.js project using Claude Code: migrations, row-level security policies, auth, and edge functions from a single terminal.

Test-Driven Development with Claude Code

Make Claude write failing tests from your spec, then implement until green without cheating. How to wire testing into the agent loop so quality is enforced, not hoped for.

On this page

What deepsec actually is
The Five Stages
Final File Tree
Wrap deepsec as a Claude Code Skill
Build the security-fixer Agent
Hook It Into /ship
Cost and Cadence
Layer Vercel Agent on the PR
What You Get After One Feature

Arrête de tout configurer. Place à la construction.

Des templates SaaS avec orchestration IA.