How to scan your code for security issues with DeepSec
By Flavio
Updated
Tagged: Security
DeepSec is Vercel's open-source AI security scanner. How it works, how to keep the first run cheap, and what 504 findings on my own repo turned into.
DeepSec is an open-source security scanner from Vercel.
It works in two stages. First, a fast pattern scanner picks out the code that deserves a look. Then a coding agent, Codex or Claude Code, reads that code, follows the data across files, checks for existing defenses, and writes a finding.
Pull request scanners only see new code. DeepSec can do that too, but it was built for the bigger job: going through a whole repository, including the authentication code written three years ago and the webhook nobody has touched since launch. Most existing code has never been reviewed by a model this good. That’s the same pressure I wrote about in Security in the age of AI.
I ran it on the entire flaviocopes.com repository. It investigated 729 files and reported 504 potential findings. That sounds terrible. By the end of the post you’ll see how it turned into a short list of things to fix, and how I used Codex to get there.
Along the way, we’ll install DeepSec, put a cost limit on the first run, read the files it generates, revalidate and triage the findings, add project context, and run it on branches and in CI.
DeepSec isn’t a magic command. It can miss bugs, some findings will be wrong, and the AI stage costs real money. What I like about it is that it treats security review as a repeatable process with saved state, instead of a one-off prompt to a coding agent.
What DeepSec does
A traditional static scanner searches code for known patterns, like a SQL query built from a string, a route without an obvious authentication wrapper, or a call that sends user input to another server.
That approach is fast and predictable, but it lacks context. A pattern can tell you that a route reads a user-supplied URL, yet it can’t always tell whether another function validates that URL, whether the route is public, or whether the request can reach a private network. A coding agent can dig in and answer those questions.
DeepSec puts both approaches into one pipeline:
The pattern scan narrows down what to look at, and the agent handles the slower reasoning. A second agent pass can then revalidate the findings, filtering out false positives and adjusting severities where needed.
Because DeepSec stores every stage inside a .deepsec/ directory, a later run can pick up from the saved state instead of starting from scratch. That’s the main difference compared to giving a coding agent a one-off prompt like this:
Review this repository for security problems.
A prompt like that can still catch bugs, but it doesn’t give you coverage checks, incremental state, resumable runs, structured findings, revalidation, or a stable report format. DeepSec wraps the whole review workflow around the model so you can run it repeatedly and track what it covered.
What DeepSec is not
Before we run anything, it helps to be clear about what a scan covers and what it doesn’t.
Even a clean DeepSec run won’t tell you a repository is completely safe. You still need the rest of your security basics alongside it:
- a threat model written by people who understand the product
- dependency and secret scanning
- security tests
- runtime monitoring
- manual review of sensitive code
- penetration testing for high-risk systems
Processing also doesn’t stay completely local. Your repository lives on your machine during a local run, but the model provider you choose still receives the relevant code and prompts. Check the provider and gateway data policies before scanning private code.
DeepSec is also built for trusted repositories. Treat it like any other coding agent with access to your project: don’t point a local run at an untrusted pull request and assume that code can’t touch your machine. We’ll come back to how to handle that safely in the CI section.
What you need
DeepSec creates its own Node.js workspace inside .deepsec/. Your main project doesn’t need to use JavaScript, since DeepSec can review TypeScript, Go, Python, Lua, Terraform, and other text-based codebases.
To run it, you’ll need:
- Node.js 22 or newer
- npm, pnpm, or Yarn
- a Git repository
- access to a supported coding-agent model
- permission to scan the code
You can pay for model calls through Vercel AI Gateway, use your own OpenAI or Anthropic API key, or lean on an existing local Codex or Claude login. DeepSec itself is open source under the Apache 2.0 license, while model calls and optional Vercel Sandbox runs are billed separately.
Preview the setup first
If you want to see what setup will do without touching your repository, run a dry preview first:
npx deepsec init --plan --output json
That’s handy in automation or whenever you want to inspect the plan before running it.
You can also create just the workspace files and stop there:
npx deepsec init --scaffold-only
This generates the .deepsec/ skeleton and exits. It won’t install packages, sign in, choose a model, scan the repository, or start any paid processing.
My advice is to use --scaffold-only on an important repository so you can review the new directory, commit the useful configuration files, and then continue. For a smaller project, the regular interactive setup is faster and more convenient.
Run the first scan
Go to the root of your repository and start the setup command:
npx deepsec init
First, DeepSec asks which model you want to use. The list shows benchmark results and relative costs, and those options shift as new models come out, so check the current list instead of copying a model name from an old tutorial.
Next, it asks how model calls should authenticate. The default path uses Vercel AI Gateway, signing in to Vercel when needed and creating a small project for the DeepSec workspace.
Once you pick those options, the command takes over. It creates .deepsec/, studies the repository, writes a short project description, builds an inventory of entry points, checks matcher coverage, runs the local pattern scan, and starts the AI review.
Depending on the size of your codebase, that first run can take anywhere from a few minutes to hours, and a large repository can take much longer.
Put a hard limit on the first run
The pattern scan runs locally for free, while the AI review costs real money. Don’t start an unlimited first run on a large repository without guardrails.
Instead, pass a cost and time limit when you launch setup:
npx deepsec init \
--max-cost-usd 25 \
--max-duration 30m
When DeepSec hits either limit, it stops cleanly at a safe checkpoint. To pick up where it left off, run the same command again:
npx deepsec init \
--max-cost-usd 25 \
--max-duration 30m
Any completed work gets skipped, though the limit applies per run, so keep track of your total spend across resumed sessions.
Another good way to test the waters is to process a small batch of files first from inside .deepsec/:
pnpm deepsec process --limit 50
Running fifty files gives you a clear sense of cost, speed, and finding quality before you commit to the whole repo. You can check the DeepSec FAQ for current cost examples, but treat them as rough estimates since file complexity and model choice can swing the price by a lot.
Use a local Codex or Claude login
If Codex or Claude is already authenticated on your machine, you can reuse that local session directly:
npx deepsec init --model-auth local
In this mode, DeepSec doesn’t set up a gateway token or API key. Whichever tool you pick just needs an active local login of its own.
This is the path I used for the flaviocopes.com scan we’ll look at later, running through my existing ChatGPT subscription without an OpenAI API key. It’s a great way to try DeepSec out.
Keep in mind that subscription limits can run out quickly on a full scan of a large repository, so switch to a gateway or a direct provider key once the workload outgrows your plan. Local credentials also can’t be forwarded into a remote sandbox, since sandbox runs require a real API token.
Use your own API key
You can also skip Vercel AI Gateway and talk to OpenAI directly with your own key. Start by loading it into a temporary shell variable so it doesn’t end up in your shell history:
read -s MY_OPENAI_KEY
export MY_OPENAI_KEY
Then run setup pointing at that variable:
npx deepsec init \
--agent codex \
--model-auth direct \
--ai-provider openai \
--ai-api-key-env MY_OPENAI_KEY
DeepSec saves the environment variable’s name, not the key itself, so you’ll need to provide that variable again on future runs (or put it in .deepsec/.env.local and keep that file out of Git).
If you’re using Anthropic instead, pass the Claude agent and provider:
npx deepsec init \
--agent claude \
--model-auth direct \
--ai-provider anthropic \
--ai-api-key-env MY_ANTHROPIC_KEY
You can see all supported credential options in the DeepSec model and Vercel setup guide.
Understand the generated workspace
After setup finishes, you’ll see a new .deepsec/ directory in your repository. Here are the main files and folders inside it:
.deepsec/
deepsec.config.ts
generated-matchers.ts
package.json
AGENTS.md
data/
my-app/
INFO.md
SETUP.md
project.json
setup/
files/
runs/
reports/
This workspace stays isolated from your main app, with its own package.json, dependencies, configuration, and scan state.
Not everything inside .deepsec/ belongs in Git. The generated .gitignore keeps credentials and reproducible scan state out of version control, while leaving configuration and context files like INFO.md, SETUP.md, deepsec.config.ts, and generated-matchers.ts ready to commit. Still, review what’s tracked before you push, because security reports can expose sensitive code paths and vulnerability details.
Review INFO.md
INFO.md tells the coding agent what your repository does. DeepSec injects it into every investigation, revalidation, and triage prompt. Setup drafts it automatically, though you’ll still want to read it over and tighten anything it got wrong.
For my flaviocopes.com scan, setup generated a solid starting point:
# flaviocopes.com
## What this codebase does
- Astro 7 site deployed as static output on Cloudflare Pages
- Public browser tools, mostly running in the browser
- Pages Functions for newsletters, sponsorships, course recovery, and purchases
- A scheduled Worker and several local operational scripts
## Auth shape
- There is no user account system or authenticated application area
- Paddle webhook signatures protect the purchase flow
- Public forms use Turnstile and IP-based rate limits
- Course URLs are possession-based credentials
## Known false positives
- Lessons and posts contain security examples that are not production code
- Public IDs and Turnstile site keys are not secrets
- Editor commands and MCP configuration are local tooling
That context helped the agent judge the code it found. It knew most of the site is static, and that purchase webhooks, public forms, course links, and scripts crossed more important trust boundaries.
Keep INFO.md short and factual, and make sure it covers:
- what the product does
- where untrusted input enters
- how users authenticate
- how authorization works
- which data is sensitive
- important invariants
- known patterns that look unsafe but are intentional
Don’t put any secrets in this file. If security concepts like these are new to you, my free Security Fundamentals course walks through assets, attackers, trust boundaries, controls, testing, and incident response.
Understand the surface inventory
During setup, DeepSec also builds a structured inventory of your project’s entry points and saves it under data/<project>/setup/. That inventory covers:
- HTTP routes
- RPC handlers
- queue consumers
- cron jobs
- command-line commands
- webhooks
- agent tools
DeepSec then compares those entry points against the files its matchers reached. A scanner can report zero findings because the code is safe, or because it never looked at the right files in the first place, so you have to verify coverage before trusting an empty result.
If an important surface has no matcher coverage, setup tries to generate a project-specific matcher for it. If coverage still comes up short, setup halts before starting the paid AI stage, surfacing the blind spot instead of handing you a reassuring empty report.
What a matcher is
A matcher is a rule that picks out security-sensitive code for investigation. It usually combines file paths with one or more regular expressions, like looking inside src/rpc/ for calls that register RPC handlers.
A matcher doesn’t need to prove a vulnerability. Its job is to flag a file and say:
This file contains an entry point or risky operation. An agent should read it.
DeepSec gives matchers three noise levels:
precisefor a pattern that strongly suggests a specific bugnormalfor a useful candidate that needs agent investigationnoisyfor a narrow family where every file deserves review
Keep the scope tight, because the wider a matcher is, the more files reach the expensive AI stage.
Review generated matchers
Setup stores the project-specific rules it accepts in .deepsec/generated-matchers.ts. These generated matchers are declarative data, not model-written TypeScript that DeepSec executes, and DeepSec validates their paths, regular expressions, examples, and candidate counts before using them.
You should still review the file yourself. Check that each matcher:
- points to real source directories
- represents a stable code pattern
- doesn’t include generated files
- reaches the surface it claims to cover
- produces a reasonable number of candidates
You can test a single matcher from inside .deepsec/ using its real slug from generated-matchers.ts:
pnpm deepsec scan --matchers internal-rpc-entrypoint
Inspect several matching files afterward. A matcher that selects hundreds of unrelated files will cost you money without improving coverage.
The everyday DeepSec workflow
After initialization, run your commands from inside .deepsec/. Start by checking the current state:
pnpm deepsec status
Next, run the local matcher scan:
pnpm deepsec scan
Then process any new candidates with the coding agent you picked:
pnpm deepsec process
Revalidate the findings:
pnpm deepsec revalidate
Generate a summary report:
pnpm deepsec report
Export one Markdown file per finding if you want them as separate files:
pnpm deepsec export \
--format md-dir \
--out ./findings
You don’t need to run every command after every edit. The first full review goes through the whole pipeline, and later runs are incremental.
What happens during scan
scan reads the repository, runs the active matchers, and creates candidate records for matching files. It doesn’t call an AI model, so it’s fast enough to run often.
A candidate isn’t a finding yet; it’s a starting point for the agent. If a matcher spots dangerouslySetInnerHTML, that file deserves a look, even though the value might already be sanitized, come from trusted static content, or turn out to be a real stored XSS bug.
DeepSec also detects frameworks like Next.js, React, Express, Fastify, NestJS, and Hono so it can activate framework-specific matchers and add relevant threat hints to the investigation prompt. Other ecosystems can still use generic matchers, and the supported technology page lists the current coverage.
What happens during process
process is where DeepSec starts spending money. It takes pending candidate files in batches and hands them to the coding-agent backend you configured.
For each candidate, the agent receives:
- the source file
- candidate matches
- the project context from
INFO.md - repository tools for following code across files
- a structured output format
From there, the agent can search for callers, middleware, validation, authorization, and other defenses before returning zero or more findings. Each finding includes details like:
- severity
- confidence
- affected lines
- an explanation
- a recommended fix
DeepSec records the model, agent, time, cost when available, and analysis history. That history is append-only, so running another model later won’t delete earlier results.
Revalidate important findings
AI agents can misread code, so DeepSec gives you a revalidate command that sends a finding through another agent pass. The outcome can be:
true-positivefalse-positivefixeduncertainduplicate
When you have a large batch of findings, start with the high-severity ones:
pnpm deepsec revalidate --min-severity HIGH
Revalidation costs money too, since it re-reads the code and may check Git history. Even after revalidation, you’ll still see a noticeable false-positive rate, so plan on reviewing the output yourself.
Never open a production incident or ship a risky patch from a finding’s title alone. Read the code path, confirm that attacker-controlled input reaches the risky operation, and check whether a defense already exists elsewhere before you change anything.
My free Web Application Security course covers the common bugs these reports mention, including XSS, injection, CSRF, SSRF, unsafe uploads, and broken access control.
Triage the result
Severity and priority aren’t the same thing. A high-severity bug on an unreachable internal prototype is usually less urgent than a medium finding on a public payment endpoint.
DeepSec has a separate triage step for sorting that out:
pnpm deepsec triage
Triage reads the finding text, weighs exploitability and impact, and assigns a priority like P0, P1, P2, or skip. Because it doesn’t re-read the source code, it’s cheaper than revalidation and doesn’t replace it. Revalidation checks whether a finding is real, while triage helps you decide what order to fix things in.
Fix one finding at a time
A useful finding should trace a clear path through your system:
untrusted input -> missing control -> sensitive operation -> impact
Here’s what that looks like in practice:
invoice ID from URL
-> no tenant ownership check
-> database query by invoice ID
-> another tenant's invoice is returned
Confirm each arrow before you touch any code. Fix the missing control at the narrowest shared boundary, add a test for the negative case, and run both your normal project tests and DeepSec again:
pnpm deepsec scan
pnpm deepsec process
pnpm deepsec revalidate
The updated file hash tells DeepSec that the source changed. For a serious issue, it’s also worth running a second agent backend on it. Two models agreeing on the same bug gives you a stronger signal, though you still want to verify the fix with your own eyes and tests.
Add project-specific configuration
The main configuration file lives at .deepsec/deepsec.config.ts. Here’s what a small multi-project setup looks like:
import { defineConfig } from 'deepsec/config'
import { generatedMatchersPlugin } from './generated-matchers.js'
export default defineConfig({
projects: [
{
id: 'web-app',
root: '../apps/web',
priorityPaths: ['src/api/', 'src/auth/'],
},
{
id: 'worker',
root: '../apps/worker',
priorityPaths: ['src/handlers/', 'src/queues/'],
},
],
plugins: [generatedMatchersPlugin],
})
priorityPaths tells processing which paths deserve attention first. If you have a project-specific rule the agent needs to know about, add it with promptAppend:
{
id: 'worker',
root: '../apps/worker',
promptAppend:
'Webhook handlers must verify signatures before parsing trusted fields.',
}
Keep that text short and factual. A long prompt full of vague security advice buries the rules that matter.
When you want to exclude specific files from investigation, add ignore paths in data/<id>/config.json:
{
"ignorePaths": ["**/fixtures/**", "**/generated/**"]
}
Save ignores for files that genuinely shouldn’t be investigated. If a matcher is noisy because its scope is too broad, fix the matcher instead of hiding its results with ignores.
Write a custom matcher
Generated matchers cover straightforward path and regex rules, while trickier project patterns are better written in code. Suppose an application registers internal RPC handlers like this:
registerRpc('users.get', getUser)
You can write a custom matcher in .deepsec/matchers/internal-rpc.ts:
import {
regexMatcher,
type MatcherPlugin,
} from 'deepsec/config'
export const internalRpc: MatcherPlugin = {
slug: 'internal-rpc-entrypoint',
description: 'Internal RPC entry points',
noiseTier: 'normal',
filePatterns: ['src/rpc/**/*.ts'],
examples: ["registerRpc('users.get', getUser)"],
match(content) {
return regexMatcher(
'internal-rpc-entrypoint',
[
{
regex: /registerRpc\s*\(/,
label: 'RPC registration',
},
],
content
)
},
}
Register it in deepsec.config.ts without removing the generated plugin:
import {
defineConfig,
type DeepsecPlugin,
} from 'deepsec/config'
import { generatedMatchersPlugin } from './generated-matchers.js'
import { internalRpc } from './matchers/internal-rpc.js'
const projectMatchers: DeepsecPlugin = {
name: 'web-app-matchers',
matchers: [internalRpc],
}
export default defineConfig({
projects: [{ id: 'web-app', root: '..' }],
plugins: [generatedMatchersPlugin, projectMatchers],
})
Then run only that matcher to see what it picks up:
pnpm deepsec scan --matchers internal-rpc-entrypoint
Open several of the candidates it finds. Loosen the rule if it’s missing real handlers, or tighten it if it’s catching unrelated files. All a custom matcher needs to do is narrow down which files the agent should review, not act as a full static analyzer.
The matcher guide explains the full plugin contract and the safety rules for generated matchers.
Review only changed files
A full repository scan makes sense for the first audit, and after that you can review a branch or pull request directly. From .deepsec/, compare the current branch with origin/main:
pnpm deepsec process --diff origin/main
Direct mode finds the changed files, runs your local matchers on them, and asks the agent to review every changed file even when no matcher fires.
You can also review staged changes:
pnpm deepsec process --diff-staged
Or uncommitted and untracked files:
pnpm deepsec process --diff-working
To write a pull-request-shaped Markdown summary:
pnpm deepsec process \
--diff origin/main \
--comment-out comment.md
DeepSec only creates that file if the run produces new findings.
Direct mode returns exit code 0 when it finds nothing new and 1 when it produces at least one new finding, while other non-zero codes mean the command failed. That makes it usable as a CI gate.
Start in advisory mode first. Save the report as an artifact, review the quality of the findings, and only turn it into a blocking check once your team understands its cost and false-positive rate.
Be careful with pull request CI
A pull request can change more than application code. It can modify package.json, install scripts, DeepSec configuration, and other files that execute during CI. Don’t give a single job both untrusted pull request code and powerful repository permissions.
Keep these capabilities separate:
job 1: read code + run review + write artifact
job 2: read sanitized artifact + write PR comment
The first job shouldn’t have permission to modify the repository, and the second job should never execute pull request code.
Keep in mind that fork pull requests don’t receive repository secrets in the normal pull_request event, so skip them or move the review into an isolated environment. Remember too that the model credential exists in the review job, and a malicious change can try to steal any secret available to that job.
For a production setup, start from DeepSec’s official PR mode workflow and apply your repository’s trust policy. Pin third-party GitHub Actions to full commit hashes, limit permissions, and require a trusted approval before running secret-bearing analysis on outside contributions.
My free Software Supply Chain Security course goes deeper into repository permissions, CI secrets, untrusted contributions, artifacts, and release controls.
Run trusted scheduled scans in CI
A scheduled full scan is simpler because it runs against the trusted default branch. Here’s the shape for a GitHub Actions workflow:
name: deepsec scheduled scan
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1'
permissions:
contents: read
jobs:
scan:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v7
with:
node-version: 24
cache: pnpm
- run: pnpm install --frozen-lockfile
working-directory: .deepsec
- run: pnpm deepsec scan
working-directory: .deepsec
- run: pnpm deepsec process
working-directory: .deepsec
env:
AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
- run: pnpm deepsec revalidate --min-severity HIGH
working-directory: .deepsec
env:
AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
- run: pnpm deepsec export --format md-dir --out ./findings
working-directory: .deepsec
This workflow processes every pending candidate in a clean CI run, so run a limited scan locally before turning it on. A full scheduled scan can take a long time and cost a lot more than you’d expect.
Because Git normally ignores DeepSec’s generated state, you’ll need to persist .deepsec/data/ in private storage if you add --limit to spread the work across scheduled runs. Otherwise, each clean runner reprocesses the same first batch.
You’ll also want a private artifact step if you need to keep the exported report instead of publishing vulnerability reports to a public build log. Pin the actions to reviewed commit hashes before using this on a sensitive repository.
Scale with Vercel Sandbox
A local DeepSec run uses your machine, which is easier for small and medium repositories. For large ones, you can distribute the work across Vercel Sandbox microVMs:
pnpm deepsec sandbox process \
--project-id web-app \
--sandboxes 10 \
--concurrency 4
Each sandbox handles part of the workload while your host keeps the real model credential and adds it only to requests going to the model provider, so the sandbox never sees the raw credential.
Sandbox mode is useful when:
- a local run would take many hours or days
- the repository contains thousands of candidate files
- you need isolation from the scanned working tree
- a scheduled job needs to finish within a predictable window
Sandbox fanout adds infrastructure, authentication, upload time, and cost, so only reach for it when your workload genuinely calls for it.
My Vercel Sandbox tutorial explains the microVM model, authentication, timeouts, network policies, and credential brokering.
Scan several repositories
One .deepsec/ workspace can manage more than one repository. From an existing workspace, add another project:
pnpm deepsec init-project \
../billing-service \
--id billing-service
Then run setup for it:
pnpm deepsec setup --project-id billing-service
From there, pass the project ID to later commands:
pnpm deepsec scan --project-id billing-service
pnpm deepsec process --project-id billing-service
This works well when a product is split across a web application, API, Worker, and background service. Don’t combine unrelated repositories just to get one dashboard, though. Shared state helps when the repositories belong to the same product and you review them together.
How I used DeepSec on flaviocopes.com
At first, I didn’t plan to scan the complete flaviocopes.com repository. Most of the site is static content, and the sensitive surface is much smaller: Cloudflare Pages Functions, purchase webhooks, course recovery, public tools, and operational scripts.
I decided to run the full scan anyway, and it taught me the most useful lesson in this tutorial: the number of findings isn’t the number of changes you need to make.
Starting the scan
I started from the DeepSec page on Vercel:

Then I ran the normal setup command from the repository root:
npx deepsec init
Setup opened the browser and asked me to authorize Vercel:

For the model, I picked Codex with gpt-5.6-sol and xhigh reasoning, using my ChatGPT subscription through the local Codex login instead of configuring an API key. DeepSec created its isolated workspace and installed the required packages:

From there, it studied the repository, wrote the threat model, checked its coverage, and generated four project-specific matchers. Two matchers found Astro page entry points, one found local Node.js operator scripts, and the fourth found Codex MCP server registrations. The setup screen showed that work as it happened:

The generated threat model was good. It picked up that the site is statically built while still having a small server-side surface, and it flagged the purchase webhook, public forms, course links, local scripts, deploy credentials, and AI endpoint as the important boundaries. It even recorded known false positives, like lessons containing deliberately unsafe code meant for students to read rather than production endpoints.
The result looked alarming
DeepSec investigated 729 files and reported 504 potential findings:
- 1 critical
- 16 high
- 67 medium
- 42 high-impact bugs
- 378 bugs

Seeing 504 findings pop up in a security tool is alarming at first glance, until you notice the wording in the screenshot: potential findings. DeepSec immediately prompted me to revalidate them, because that first pass was never meant to become a 504-item task list.
The saved run also showed the scale of the analysis. Codex processed about 14.4 million input tokens and produced about 1.7 million output tokens. DeepSec displayed $0.0000 because the model ran through my local ChatGPT subscription, so there was no separate API bill, though it still used subscription capacity.
I asked Codex what to do next
Next, I opened Codex in the repository and asked it to analyze the DeepSec results. Instead of telling it to fix everything, I asked it to sort out what mattered, what could wait, and what wasn’t a real production risk.
You can run that kind of triage pass with a prompt like this:
Analyze the findings saved by DeepSec in this repository.
Do not change any files.
Group related findings by root cause.
Separate remotely reachable production risks from local scripts,
content examples, and normal product bugs.
Tell me which issues need attention first and explain why.
Because this second pass had the repository, the DeepSec evidence, and the current architecture together, it could answer questions a severity table can’t:
- Is this code reachable from the internet?
- Can an attacker control the input?
- Is there already a defense in another file?
- Is this a security issue or a normal product bug?
- Does the same root problem appear in several findings?
- What’s the real impact if the code fails?
Once Codex broke it down, the raw count got much less scary. Out of the 504 findings, 462 came from src/tools and src/pages/tools, where the site’s small browser tools live. And 378 of the findings were classified as regular bugs, including wrong calculations, broken generated output, edge cases, and UI problems. Those can be worth fixing over time, sure, but they aren’t 378 security emergencies. On top of that, some issues showed up twice, once in a tool’s implementation and again in its Astro page, so fixing one shared cause closes more than one report.
After Codex grouped everything by reachability and impact, the work narrowed down to three areas:
- server-side purchase, course-recovery, and public-form flows
- browser tools that render active content or generate commands and code
- local operator scripts where untrusted data could reach a shell or filesystem operation
Everything else went into a normal product-quality backlog, waited for manual verification, or got discarded when the reported path wasn’t real. Instead of 504 urgent changes, I ended up with a few concrete places to investigate and improve.
What I learned from the run
DeepSec searched broadly and kept the evidence, and Codex turned that evidence into a plan I could act on. Next time I scan a repo like this, I’ll follow the same steps:
- Let DeepSec build the threat model and inventory.
- Run a bounded sample first when model calls cost money.
- Treat the first output as potential findings.
- Revalidate the important results.
- Ask a coding agent to group them by root cause and reachability.
- Confirm the important code paths before changing anything.
Focus first on the places where untrusted input meets authentication, private data, money, infrastructure, or an irreversible action.
When DeepSec is a poor fit
DeepSec works best on applications and services. It’s a weaker first choice for:
- a static site with no sensitive server code
- a tiny script with no external input
- a library without project-specific threat context
- generated code
- a repository you don’t trust on your machine
- a project where nobody can review and fix the findings
You can still scan libraries and frameworks, though they often need custom prompts and matchers because whether a behavior is dangerous depends on how another application uses it.
It’s also a poor fit when you want a cheap check on every tiny edit. Direct pull request mode helps keep scope down, yet every reviewed file still costs model work. Stick with normal linters, tests, dependency scanners, and focused static rules for fast feedback, and save DeepSec for places where deeper repository reasoning is worth the cost.
If you want a shorter Codex-based path without a .deepsec/ workspace, see How to scan your code with the Codex Security CLI.
How the DeepSec pipeline fits together
DeepSec gives AI security review a repeatable pipeline:
understand the repository
-> inventory the exposed surfaces
-> prove scanner coverage
-> find candidate files cheaply
-> investigate them deeply
-> revalidate the result
-> keep the history
-> repeat on changes
Pattern matching on its own has no context, while an agent scanning freely can miss parts of the repository. Putting them together gives you a focused list of code paths to investigate.
To try it on your own project, start with the setup command:
npx deepsec init --scaffold-only
Read what it creates, add your real threat boundaries, and run a small bounded scan before giving it the whole repository. The DeepSec documentation covers the current commands, and the complete source is in the vercel-labs/deepsec repository.
Want me to talk about your product? You can sponsor this site.
Related posts about security: