deepsec
Run deepsec, an AI-powered cyber-security vulnerability scanner. Activates when the user invokes /deepsec, asks to run deepsec, or wants to scan their repo, branch, or uncommitted changes for vulnerabilities.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/vercel-labs/deepsec with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/vercel-labs/deepsec'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/vercel-labs--deepsec)HTML
<a href="/listings/vercel-labs--deepsec"><img src="/api/listings/vercel-labs--deepsec/badge.svg" alt="findsafeskills safety rating" /></a>Install
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
SKILL.md · Manifest · 111 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- ---
- name: deepsec
- description: Run deepsec, an AI-powered cyber-security vulnerability scanner. Activates when the user invokes /deepsec, asks to run deepsec, or wants to scan their repo, branch, or uncommitted changes for vulnerabilities.
- ---
- # /deepsec — scan this repository with deepsec
- `deepsec` is an AI-powered vulnerability scanner.
- - Modern AI models are great at security code review.
- - Most review solutions only run on pull requests.
- - That means most legacy code was never reviewed, and your code from 6
- months ago was reviewed by older models.
- - Instead deepsec does security review on ALL of your existing code using
- scaled VM fanout.
- - Vercel's deepsec is open source, runs in your own infrastructure, and
- supports strong agent sandboxing.
- A fast regex scan flags candidate files, then AI agents investigate each
- candidate in depth and record findings with severity ratings; findings can
- later be revalidated, triaged, and exported. Everything it adds to a repository
- lives in a single `.deepsec/` workspace (config, installed package, per-project
- data). Because processing runs real AI agents, it costs money in proportion
- to how much code it investigates.
- Follow this runbook when the user invokes `/deepsec` or asks for a scan.
- ## 1. Ask for scope first
- Ask the user which scope to process, using a structured question tool if you
- have one (AskUserQuestion in Claude Code), otherwise plain text:
- - **Uncommitted changes** — working tree + untracked files
- - **Diff to main** — changes vs `origin/main` (use `main` if there is no
- `origin` remote)
- - **Entire codebase** — warn that this is the expensive option: AI
- processing investigates every candidate file and can cost real money on a
- large repository
- Ask before doing anything else so the rest of the flow can run unattended.
- ## 2. Detect onboarding state
- From the repository root:
- - **No `.deepsec/deepsec.config.ts`** → not onboarded. Do step 3 in full.
- - **`.deepsec/` exists but `.deepsec/node_modules/deepsec` is missing, or a
- previous setup was interrupted** → re-run the init command from step 3; it
- resumes from checkpoints and repairs the install rather than starting over.
- - **Otherwise** → onboarded; skip to step 4.
- ## 3. Onboard without full processing
- Onboarding normally ends with an AI processing pass over the whole
- repository. Since the user already chose a scope, stop setup after the
- coverage phase — that still includes install, login, threat model, matcher
- generation, and the final regex scan, but skips the full-repo AI `process`
- phase. The scoped processing happens in step 4 instead.
- From the repository root, inspect the read-only plan, then run setup:
- ```bash
- npx -y deepsec init --plan --output json
- npx -y deepsec init --yes --through coverage --output jsonl
- ```
- If `npx` fails with `EBADDEVENGINES`, the repository's
- `devEngines.packageManager` requires another package manager. Run the same
- commands with `pnpm dlx deepsec` (or that package manager's equivalent) in
- place of `npx -y deepsec`.
- Parse every output line as JSON. On a `needs_input` event, show the supplied
- message and actions to the user rather than inventing remediation. In
- particular, `VERCEL_AUTH_REQUIRED` normally asks the user to run
- `npx vercel login`; after they do, follow the returned link action from
- inside `.deepsec` (use `npx vercel link` when the user needs to choose a
- project), then re-run the same init command. Exit code 2 means input is
- needed; exit code 3 means a cost/duration boundary stopped the resumable
- run — re-running the same command resumes it. Never expose credential
- values, bypass `--yes` prompts on the user's behalf beyond the flag itself,
- or launch an interactive login yourself.
- ## 4. Run the scoped processing
- Run from inside `.deepsec/` (the config loader only finds
- `deepsec.config.ts` in the current directory or its ancestors; after step 3,
- `npx deepsec` resolves to the copy installed there):
- | Scope | Command |
- | --- | --- |
- | Uncommitted changes | `cd .deepsec && npx deepsec process --diff-working` |
- | Diff to main | `cd .deepsec && npx deepsec process --diff origin/main` |
- | Entire codebase, right after step 3 | `cd .deepsec && npx deepsec process` (the final scan from setup already produced the candidate set) |
- | Entire codebase, previously onboarded | `cd .deepsec && npx deepsec scan && npx deepsec process` |
- ## 5. Interpret results
- - Direct-mode (`--diff*`) exit codes: `0` = no net-new findings, `1` = at
- least one net-new finding (not an error), anything else = runtime error.
- Pre-existing findings on touched files are excluded from the gate.
- - Summarize any findings for the user, then offer follow-ups (all from
- inside `.deepsec/`): `npx deepsec report`, `npx deepsec revalidate`, and
- `npx deepsec export --format md-dir --out ./findings`.
- ## Going deeper
- After onboarding, full documentation ships with the installed package at
- `.deepsec/node_modules/deepsec/dist/docs/` — `getting-started.md`,
- `reviewing-changes.md` (direct mode, exit codes, CI gating),
- `configuration.md`, `models.md`, and more. Read the relevant doc before
- varying the commands above; flags and defaults change between releases.
README.md · README · 143 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
- # deepsec
- [`deepsec`](https://deepsec.sh) is an agent-powered vulnerability scanner that you can run in your own infrastructure, optimized to perform on-demand review of all code in existing
- large-scale repos.
- `deepsec` is designed to surface hard-to-find issues that have been lurking in applications for a long time. It is configured to use the best models at maximum thinking levels (tunable via `--thinking-level`, see [models](https://github.com/vercel-labs/deepsec/blob/main/docs/models.md)), meaning scans can cost thousands or even tens-of-thousands of dollars for large codebases. Our customers have found the cost worth it for how quickly they were able to patch vulnerabilities that would have otherwise gone unfixed.
- For large codebases, work fans out across worker machines in parallel.
- If a run is interrupted or errors out partway through, just re-run the same
- command — deepsec picks up where it left off, skipping files it already
- analyzed and only investigating the rest.
- <p>
- <a href="https://vercel.com/labs#labs-products"><img alt="Vercel Labs Product" src="https://img.shields.io/badge/LABS-PRODUCT-0a0a0a.svg?style=for-the-badge&logo=Vercel&labelColor=000000" height="28"></a>
- <a href="https://www.npmjs.com/package/deepsec"><img alt="npm version: deepsec" src="https://img.shields.io/npm/v/deepsec.svg?style=for-the-badge&labelColor=000000" height="28"></a>
- <a href="https://github.com/vercel-labs/deepsec/blob/main/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/github/license/vercel-labs/deepsec.svg?style=for-the-badge&labelColor=000000" height="28"></a>
- <a href="https://www.npmjs.com/package/deepsec"><img alt="npm downloads per month: deepsec" src="https://img.shields.io/npm/dm/deepsec.svg?style=for-the-badge&labelColor=000000&label=npm%20downloads" height="28"></a>
- </p>
- ## Get started
- From the root of the repository you want to scan:
- ```bash
- npx deepsec init
- ```
- The command guides you through everything. It asks you to pick an AI model
- (with benchmark scores and prices to compare) and how to pay for model
- usage — your own OpenAI/Anthropic API key, or Vercel AI Gateway — and then
- works unattended: it studies your codebase, scans it, and runs the AI
- review. The only thing it adds to your repository is a `.deepsec/` folder
- where all of its state and findings live.
- If the run is interrupted for any reason — Ctrl-C, lost connection, a
- spending limit — run `npx deepsec init` again and it continues where it
- left off. To cap what a run may spend or how long it may take:
- ```bash
- npx deepsec init --max-cost-usd 100 --max-duration 2h
- ```
- When the scan finishes, get a readable report:
- ```bash
- cd .deepsec
- pnpm deepsec export --format md-dir --out ./findings
- ```
- For later scans, work from inside `.deepsec/`:
- ```bash
- pnpm deepsec scan # fast pattern scan, free
- pnpm deepsec process # AI review of new candidates
- pnpm deepsec revalidate # optional, cuts false-positive rate
- pnpm deepsec export --format md-dir --out ./findings
- ```
- The [getting started guide](https://github.com/vercel-labs/deepsec/blob/main/docs/getting-started.md)
- covers all of this in more detail, including using your own OpenAI or
- Anthropic API key and running from CI or a coding agent.
- ## Docs
- After initialization, agents can read the exact documentation matching the
- installed CLI at `.deepsec/node_modules/deepsec/SKILL.md` and
- `.deepsec/node_modules/deepsec/dist/docs/`. Setup errors expose these as
- absolute machine-readable paths.
- - [Getting started](https://github.com/vercel-labs/deepsec/blob/main/docs/getting-started.md) — set up and run your first scan
- - [Reviewing changes](https://github.com/vercel-labs/deepsec/blob/main/docs/reviewing-changes.md) — `process --diff` and CI gating
- - [Supported technology](https://github.com/vercel-labs/deepsec/blob/main/docs/supported-tech.md) — built-in coverage
- - [Generated and hand-authored matchers](https://github.com/vercel-labs/deepsec/blob/main/docs/writing-matchers.md)
- - [Configuration](https://github.com/vercel-labs/deepsec/blob/main/docs/configuration.md)
- - [Plugins](https://github.com/vercel-labs/deepsec/blob/main/docs/plugins.md)
- - [Models](https://github.com/vercel-labs/deepsec/blob/main/docs/models.md)
- - [Project link and credentials](https://github.com/vercel-labs/deepsec/blob/main/docs/vercel-setup.md)
- - [Architecture](https://github.com/vercel-labs/deepsec/blob/main/docs/architecture.md)
- - [Data layout](https://github.com/vercel-labs/deepsec/blob/main/docs/data-layout.md)
- - [FAQ](https://github.com/vercel-labs/deepsec/blob/main/docs/faq.md)
- - [Samples](https://github.com/vercel-labs/deepsec/tree/main/samples)
- - [Contributing](https://github.com/vercel-labs/deepsec/blob/main/CONTRIBUTING.md)
- ## AI provider
- By default, deepsec routes model calls through Vercel AI Gateway, which
- gives access to every major model without provider-specific keys. You can
- instead bring your own key — OpenAI, Anthropic, or a custom HTTPS
- provider — by passing `--model-auth direct` with `--ai-provider` and
- `--ai-api-key-env` to `init`; no Vercel account is needed in that mode.
- Deepsec only ever stores the *name* of the environment variable holding
- your key, never the key itself. See
- [project link and credentials](https://github.com/vercel-labs/deepsec/blob/main/docs/vercel-setup.md)
- for the full reference.
- If a `process` or `revalidate` run halts because the upstream credential
- ran out of quota or credits, deepsec stops gracefully and tells you
- where to top up. Re-run the same command afterward and it picks up
- where it left off.
- ## Distributed execution (optional)
- Large monorepos can fan work across [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) microVMs:
- ```bash
- pnpm deepsec sandbox process --project-id my-app --sandboxes 10 --concurrency 4
- ```
- Setup already verified the Vercel connection, so this needs no extra
- onboarding. The local working tree is tarballed and uploaded; `.git` is
- excluded. Model credentials remain host-side and are injected only at the
- selected egress host.
- ## Security model of deepsec itself
- Treat `deepsec` like a coding agent with full shell access on the enviroment that it is
- running on. It is designed to run on trusted inputs (your source code) but you may still
- be concerned about prompt injection due to external dependencies or vendored code.
- Running on a sandbox (see above) does limit the potential exposure substantially:
- - The API keys for the coding agents are injected outside of the sandbox and hence cannot be exfiltrated
- - For the worker sandboxes, network egress from the sandbox is limited to coding agent hosts (Egress is allowed during the bootstrap process, but this does not run the coding agent)
- ## Workflow reference
- | Command | What it does |
- |-----------------|----------------------------------------------------------|
- | `scan` | Find candidate sites with regex matchers (fast, no AI) |
- | `process` | AI investigation; emits findings + recommendation |
- | `process --diff`| PR-mode: scan + investigate only files changed in a diff |
- | `triage` | Lightweight P0/P1/P2 classification (cheaper model) |
- | `revalidate` | Re-check existing findings; checks git history for fixes |
- | `enrich` | Add git committer info + (with a plugin) 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 of the above on Vercel Sandbox microVMs |
- ## License
- Apache 2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
packages/scanner/src/matchers/dockerfile-curl-pipe-unverified.ts · Bundled script · 69 lines · 2 findings marked
- import type { CandidateMatch } from "@deepsec/core";
- import type { MatcherPlugin } from "../types.js";
- /**
- * Classic supply-chain pattern: `curl … | sh` / `curl … | tar -x` in a
- * Dockerfile RUN, without a checksum-verification step (sha256sum, shasum,
- * gpg --verify) in the same RUN block. The build executes arbitrary code or
- * extracts files downloaded from an external host with no integrity check.
- */
- export const dockerfileCurlPipeUnverifiedMatcher: MatcherPlugin = {
- noiseTier: "precise" as const,
- slug: "dockerfile-curl-pipe-unverified",
- description: "RUN curl|wget piped to shell/tar without checksum verification",
- filePatterns: ["**/Dockerfile", "**/Dockerfile.*", "**/*.Dockerfile"],
- requires: { tech: ["docker"] },
- examples: [
- `RUN curl -fsSL https://example.com/install.sh | sh`,
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 17 on GitHub
- `RUN curl -L https://get.docker.com/ | bash`,
- `RUN wget -qO- https://example.com/install | sh`,
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 19 on GitHub
- `RUN curl -L https://example.com/release.tar.gz | tar -xz`,
- `RUN wget -O- https://example.com/file.zip | unzip -`,
- ],
- match(content) {
- const lines = content.split("\n");
- const hitLines: number[] = [];
- const snippets: string[] = [];
- // Coalesce RUN ... \ continuation lines into logical statements.
- const statements: { start: number; text: string }[] = [];
- let i = 0;
- while (i < lines.length) {
- const line = lines[i];
- if (!/^\s*RUN\b/i.test(line)) {
- i++;
- continue;
- }
- const start = i;
- let text = line;
- while (text.trimEnd().endsWith("\\") && i + 1 < lines.length) {
- i++;
- text += "\n" + lines[i];
- }
- statements.push({ start, text });
- i++;
- }
- const PIPE = /\b(curl|wget)\b[^|\n]*\|\s*(?:sh|bash|zsh|tar\b|gunzip\b|unzip\b)/i;
- const HAS_VERIFY =
- /(sha256sum|sha1sum|shasum|gpg\s+--?verify|cosign\s+verify|minisign|openssl\s+dgst)/i;
- for (const stmt of statements) {
- if (!PIPE.test(stmt.text)) continue;
- if (HAS_VERIFY.test(stmt.text)) continue;
- hitLines.push(stmt.start + 1);
- const snipStart = Math.max(0, stmt.start - 1);
- const snipEnd = Math.min(lines.length, stmt.start + stmt.text.split("\n").length + 1);
- snippets.push(lines.slice(snipStart, snipEnd).join("\n"));
- }
- if (hitLines.length === 0) return [];
- const match: CandidateMatch = {
- vulnSlug: "dockerfile-curl-pipe-unverified",
- lineNumbers: hitLines,
- snippet: snippets[0],
- matchedPattern: "curl|wget | sh/tar with no checksum check",
- };
- return [match];
- },
- };
packages/scanner/src/matchers/github-workflow-security.ts · Bundled script · 108 lines · 1 finding marked
- import type { CandidateMatch } from "@deepsec/core";
- import type { MatcherPlugin } from "../types.js";
- /**
- * GitHub Actions workflow + composite-action security risks (supply chain).
- *
- * Patterns:
- * - `pull_request_target` triggers — run on the base branch with secrets
- * and can checkout attacker code from the PR
- * - `actions/checkout@<branch>` or unpinned third-party actions — mutable refs
- * - `${{ github.event.pull_request.* }}` / `github.event.head_commit.message`
- * interpolated into `run:` blocks → shell injection
- * - `secrets.*` referenced in steps that run untrusted code (PR checkouts,
- * external scripts, building untrusted Dockerfiles)
- * - `permissions: write-all` or absent permissions block (defaults to broad)
- * - `id-token: write` combined with no audience binding
- */
- export const githubWorkflowSecurityMatcher: MatcherPlugin = {
- noiseTier: "precise" as const,
- slug: "github-workflow-security",
- description: "GitHub Actions workflow / composite-action with supply-chain or injection risk",
- filePatterns: [
- ".github/workflows/**/*.yml",
- ".github/workflows/**/*.yaml",
- ".github/actions/**/*.yml",
- ".github/actions/**/*.yaml",
- ],
- requires: { tech: ["github-actions"] },
- examples: [
- `on:\n pull_request_target:\n types: [opened]`,
- `on:\n workflow_run:\n workflows: [build]`,
- ` - uses: actions/checkout@main`,
- ` - uses: actions/setup-node@v3`,
- ` run: echo "\${{ github.event.pull_request.title }}"`,
- ` run: git log \${{ github.head_ref }}`,
- ` token: \${{ secrets.GITHUB_TOKEN }}`,
- `permissions: write-all`,
- `permissions:\n id-token: write\n contents: read`,
- ` - run: |\n echo \${{ github.event.pull_request.head.ref }}`,
- ` - run: curl -fsSL https://example.com/install.sh | sh`,
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 40 on GitHub
- ],
- match(content) {
- const lines = content.split("\n");
- const hitLines: number[] = [];
- const labels = new Set<string>();
- let firstContext: string | undefined;
- const PATTERNS: { regex: RegExp; label: string }[] = [
- {
- regex: /^\s*-\s*pull_request_target\b|^\s*pull_request_target\s*:/,
- label: "pull_request_target trigger",
- },
- { regex: /^\s*-\s*workflow_run\b|^\s*workflow_run\s*:/, label: "workflow_run trigger" },
- {
- regex: /\buses\s*:\s*[\w-]+\/[\w./-]+@(?:main|master|v?\d+|develop)\s*$/m,
- label: "unpinned action ref (branch/major-tag)",
- },
- {
- regex: /\$\{\{\s*github\.event\.(?:pull_request|head_commit|comment|issue|review)\.\w+/,
- label: "github.event interpolation in run:",
- },
- { regex: /\$\{\{\s*github\.head_ref\s*\}\}/, label: "github.head_ref in script" },
- { regex: /\bsecrets\.[A-Z_][A-Z0-9_]+/, label: "secret reference" },
- { regex: /^\s*permissions\s*:\s*write-all\b/, label: "permissions: write-all" },
- { regex: /\bid-token\s*:\s*write\b/, label: "id-token: write (OIDC)" },
- { regex: /\brun\s*:\s*\|.*\$\{\{[^}]*\}\}/s, label: "run block interpolating expression" },
- { regex: /\bcurl\s+[^|]*\|\s*(?:sh|bash)\b/, label: "curl | sh in workflow" },
- ];
- for (let i = 0; i < lines.length; i++) {
- for (const { regex, label } of PATTERNS) {
- if (regex.test(lines[i])) {
- hitLines.push(i + 1);
- labels.add(label);
- if (firstContext === undefined) {
- const s = Math.max(0, i - 2);
- const e = Math.min(lines.length, i + 3);
- firstContext = lines.slice(s, e).join("\n");
- }
- break;
- }
- }
- }
- // Always-flag fallback: any workflow file is part of the supply chain.
- if (hitLines.length === 0) {
- const anchor = lines.findIndex((l) => /^\s*(?:on|jobs|name)\s*:/.test(l));
- if (anchor === -1) return [];
- const s = Math.max(0, anchor);
- const e = Math.min(lines.length, anchor + 5);
- const match: CandidateMatch = {
- vulnSlug: "github-workflow-security",
- lineNumbers: [anchor + 1],
- snippet: lines.slice(s, e).join("\n"),
- matchedPattern: "GitHub workflow file (path-based, no specific risk pattern)",
- };
- return [match];
- }
- const match: CandidateMatch = {
- vulnSlug: "github-workflow-security",
- lineNumbers: hitLines,
- snippet: firstContext ?? "",
- matchedPattern: Array.from(labels).slice(0, 4).join(", "),
- };
- return [match];
- },
- };
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.