Skip to content
Back to search

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.

Checked today

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/vercel-labs--deepsec/badge.svg)](/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

i

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)

  1. ---
  2. name: deepsec
  3. 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.
  4. ---
  5. # /deepsec — scan this repository with deepsec
  6. `deepsec` is an AI-powered vulnerability scanner.
  7. - Modern AI models are great at security code review.
  8. - Most review solutions only run on pull requests.
  9. - That means most legacy code was never reviewed, and your code from 6
  10. months ago was reviewed by older models.
  11. - Instead deepsec does security review on ALL of your existing code using
  12. scaled VM fanout.
  13. - Vercel's deepsec is open source, runs in your own infrastructure, and
  14. supports strong agent sandboxing.
  15. A fast regex scan flags candidate files, then AI agents investigate each
  16. candidate in depth and record findings with severity ratings; findings can
  17. later be revalidated, triaged, and exported. Everything it adds to a repository
  18. lives in a single `.deepsec/` workspace (config, installed package, per-project
  19. data). Because processing runs real AI agents, it costs money in proportion
  20. to how much code it investigates.
  21. Follow this runbook when the user invokes `/deepsec` or asks for a scan.
  22. ## 1. Ask for scope first
  23. Ask the user which scope to process, using a structured question tool if you
  24. have one (AskUserQuestion in Claude Code), otherwise plain text:
  25. - **Uncommitted changes** — working tree + untracked files
  26. - **Diff to main** — changes vs `origin/main` (use `main` if there is no
  27. `origin` remote)
  28. - **Entire codebase** — warn that this is the expensive option: AI
  29. processing investigates every candidate file and can cost real money on a
  30. large repository
  31. Ask before doing anything else so the rest of the flow can run unattended.
  32. ## 2. Detect onboarding state
  33. From the repository root:
  34. - **No `.deepsec/deepsec.config.ts`** → not onboarded. Do step 3 in full.
  35. - **`.deepsec/` exists but `.deepsec/node_modules/deepsec` is missing, or a
  36. previous setup was interrupted** → re-run the init command from step 3; it
  37. resumes from checkpoints and repairs the install rather than starting over.
  38. - **Otherwise** → onboarded; skip to step 4.
  39. ## 3. Onboard without full processing
  40. Onboarding normally ends with an AI processing pass over the whole
  41. repository. Since the user already chose a scope, stop setup after the
  42. coverage phase — that still includes install, login, threat model, matcher
  43. generation, and the final regex scan, but skips the full-repo AI `process`
  44. phase. The scoped processing happens in step 4 instead.
  45. From the repository root, inspect the read-only plan, then run setup:
  46. ```bash
  47. npx -y deepsec init --plan --output json
  48. npx -y deepsec init --yes --through coverage --output jsonl
  49. ```
  50. If `npx` fails with `EBADDEVENGINES`, the repository's
  51. `devEngines.packageManager` requires another package manager. Run the same
  52. commands with `pnpm dlx deepsec` (or that package manager's equivalent) in
  53. place of `npx -y deepsec`.
  54. Parse every output line as JSON. On a `needs_input` event, show the supplied
  55. message and actions to the user rather than inventing remediation. In
  56. particular, `VERCEL_AUTH_REQUIRED` normally asks the user to run
  57. `npx vercel login`; after they do, follow the returned link action from
  58. inside `.deepsec` (use `npx vercel link` when the user needs to choose a
  59. project), then re-run the same init command. Exit code 2 means input is
  60. needed; exit code 3 means a cost/duration boundary stopped the resumable
  61. run — re-running the same command resumes it. Never expose credential
  62. values, bypass `--yes` prompts on the user's behalf beyond the flag itself,
  63. or launch an interactive login yourself.
  64. ## 4. Run the scoped processing
  65. Run from inside `.deepsec/` (the config loader only finds
  66. `deepsec.config.ts` in the current directory or its ancestors; after step 3,
  67. `npx deepsec` resolves to the copy installed there):
  68. | Scope | Command |
  69. | --- | --- |
  70. | Uncommitted changes | `cd .deepsec && npx deepsec process --diff-working` |
  71. | Diff to main | `cd .deepsec && npx deepsec process --diff origin/main` |
  72. | Entire codebase, right after step 3 | `cd .deepsec && npx deepsec process` (the final scan from setup already produced the candidate set) |
  73. | Entire codebase, previously onboarded | `cd .deepsec && npx deepsec scan && npx deepsec process` |
  74. ## 5. Interpret results
  75. - Direct-mode (`--diff*`) exit codes: `0` = no net-new findings, `1` = at
  76. least one net-new finding (not an error), anything else = runtime error.
  77. Pre-existing findings on touched files are excluded from the gate.
  78. - Summarize any findings for the user, then offer follow-ups (all from
  79. inside `.deepsec/`): `npx deepsec report`, `npx deepsec revalidate`, and
  80. `npx deepsec export --format md-dir --out ./findings`.
  81. ## Going deeper
  82. After onboarding, full documentation ships with the installed package at
  83. `.deepsec/node_modules/deepsec/dist/docs/` — `getting-started.md`,
  84. `reviewing-changes.md` (direct mode, exit codes, CI gating),
  85. `configuration.md`, `models.md`, and more. Read the relevant doc before
  86. 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)

  1. # deepsec
  2. [`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
  3. large-scale repos.
  4. `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.
  5. For large codebases, work fans out across worker machines in parallel.
  6. If a run is interrupted or errors out partway through, just re-run the same
  7. command — deepsec picks up where it left off, skipping files it already
  8. analyzed and only investigating the rest.
  9. <p>
  10. <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&amp;logo=Vercel&amp;labelColor=000000" height="28"></a>
  11. <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&amp;labelColor=000000" height="28"></a>
  12. <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&amp;labelColor=000000" height="28"></a>
  13. <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&amp;labelColor=000000&amp;label=npm%20downloads" height="28"></a>
  14. </p>
  15. ## Get started
  16. From the root of the repository you want to scan:
  17. ```bash
  18. npx deepsec init
  19. ```
  20. The command guides you through everything. It asks you to pick an AI model
  21. (with benchmark scores and prices to compare) and how to pay for model
  22. usage — your own OpenAI/Anthropic API key, or Vercel AI Gateway — and then
  23. works unattended: it studies your codebase, scans it, and runs the AI
  24. review. The only thing it adds to your repository is a `.deepsec/` folder
  25. where all of its state and findings live.
  26. If the run is interrupted for any reason — Ctrl-C, lost connection, a
  27. spending limit — run `npx deepsec init` again and it continues where it
  28. left off. To cap what a run may spend or how long it may take:
  29. ```bash
  30. npx deepsec init --max-cost-usd 100 --max-duration 2h
  31. ```
  32. When the scan finishes, get a readable report:
  33. ```bash
  34. cd .deepsec
  35. pnpm deepsec export --format md-dir --out ./findings
  36. ```
  37. For later scans, work from inside `.deepsec/`:
  38. ```bash
  39. pnpm deepsec scan # fast pattern scan, free
  40. pnpm deepsec process # AI review of new candidates
  41. pnpm deepsec revalidate # optional, cuts false-positive rate
  42. pnpm deepsec export --format md-dir --out ./findings
  43. ```
  44. The [getting started guide](https://github.com/vercel-labs/deepsec/blob/main/docs/getting-started.md)
  45. covers all of this in more detail, including using your own OpenAI or
  46. Anthropic API key and running from CI or a coding agent.
  47. ## Docs
  48. After initialization, agents can read the exact documentation matching the
  49. installed CLI at `.deepsec/node_modules/deepsec/SKILL.md` and
  50. `.deepsec/node_modules/deepsec/dist/docs/`. Setup errors expose these as
  51. absolute machine-readable paths.
  52. - [Getting started](https://github.com/vercel-labs/deepsec/blob/main/docs/getting-started.md) — set up and run your first scan
  53. - [Reviewing changes](https://github.com/vercel-labs/deepsec/blob/main/docs/reviewing-changes.md) — `process --diff` and CI gating
  54. - [Supported technology](https://github.com/vercel-labs/deepsec/blob/main/docs/supported-tech.md) — built-in coverage
  55. - [Generated and hand-authored matchers](https://github.com/vercel-labs/deepsec/blob/main/docs/writing-matchers.md)
  56. - [Configuration](https://github.com/vercel-labs/deepsec/blob/main/docs/configuration.md)
  57. - [Plugins](https://github.com/vercel-labs/deepsec/blob/main/docs/plugins.md)
  58. - [Models](https://github.com/vercel-labs/deepsec/blob/main/docs/models.md)
  59. - [Project link and credentials](https://github.com/vercel-labs/deepsec/blob/main/docs/vercel-setup.md)
  60. - [Architecture](https://github.com/vercel-labs/deepsec/blob/main/docs/architecture.md)
  61. - [Data layout](https://github.com/vercel-labs/deepsec/blob/main/docs/data-layout.md)
  62. - [FAQ](https://github.com/vercel-labs/deepsec/blob/main/docs/faq.md)
  63. - [Samples](https://github.com/vercel-labs/deepsec/tree/main/samples)
  64. - [Contributing](https://github.com/vercel-labs/deepsec/blob/main/CONTRIBUTING.md)
  65. ## AI provider
  66. By default, deepsec routes model calls through Vercel AI Gateway, which
  67. gives access to every major model without provider-specific keys. You can
  68. instead bring your own key — OpenAI, Anthropic, or a custom HTTPS
  69. provider — by passing `--model-auth direct` with `--ai-provider` and
  70. `--ai-api-key-env` to `init`; no Vercel account is needed in that mode.
  71. Deepsec only ever stores the *name* of the environment variable holding
  72. your key, never the key itself. See
  73. [project link and credentials](https://github.com/vercel-labs/deepsec/blob/main/docs/vercel-setup.md)
  74. for the full reference.
  75. If a `process` or `revalidate` run halts because the upstream credential
  76. ran out of quota or credits, deepsec stops gracefully and tells you
  77. where to top up. Re-run the same command afterward and it picks up
  78. where it left off.
  79. ## Distributed execution (optional)
  80. Large monorepos can fan work across [Vercel Sandbox](https://vercel.com/docs/vercel-sandbox) microVMs:
  81. ```bash
  82. pnpm deepsec sandbox process --project-id my-app --sandboxes 10 --concurrency 4
  83. ```
  84. Setup already verified the Vercel connection, so this needs no extra
  85. onboarding. The local working tree is tarballed and uploaded; `.git` is
  86. excluded. Model credentials remain host-side and are injected only at the
  87. selected egress host.
  88. ## Security model of deepsec itself
  89. Treat `deepsec` like a coding agent with full shell access on the enviroment that it is
  90. running on. It is designed to run on trusted inputs (your source code) but you may still
  91. be concerned about prompt injection due to external dependencies or vendored code.
  92. Running on a sandbox (see above) does limit the potential exposure substantially:
  93. - The API keys for the coding agents are injected outside of the sandbox and hence cannot be exfiltrated
  94. - 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)
  95. ## Workflow reference
  96. | Command | What it does |
  97. |-----------------|----------------------------------------------------------|
  98. | `scan` | Find candidate sites with regex matchers (fast, no AI) |
  99. | `process` | AI investigation; emits findings + recommendation |
  100. | `process --diff`| PR-mode: scan + investigate only files changed in a diff |
  101. | `triage` | Lightweight P0/P1/P2 classification (cheaper model) |
  102. | `revalidate` | Re-check existing findings; checks git history for fixes |
  103. | `enrich` | Add git committer info + (with a plugin) ownership data |
  104. | `report` | Markdown + JSON summary for one project |
  105. | `export` | Per-finding JSON or directory of markdown files |
  106. | `metrics` | Cross-project counts: severities, vulns by type, TPs |
  107. | `status` | Snapshot of the project mirror |
  108. | `sandbox <cmd>` | Run any of the above on Vercel Sandbox microVMs |
  109. ## License
  110. 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
  1. import type { CandidateMatch } from "@deepsec/core";
  2. import type { MatcherPlugin } from "../types.js";
  3. /**
  4. * Classic supply-chain pattern: `curl … | sh` / `curl … | tar -x` in a
  5. * Dockerfile RUN, without a checksum-verification step (sha256sum, shasum,
  6. * gpg --verify) in the same RUN block. The build executes arbitrary code or
  7. * extracts files downloaded from an external host with no integrity check.
  8. */
  9. export const dockerfileCurlPipeUnverifiedMatcher: MatcherPlugin = {
  10. noiseTier: "precise" as const,
  11. slug: "dockerfile-curl-pipe-unverified",
  12. description: "RUN curl|wget piped to shell/tar without checksum verification",
  13. filePatterns: ["**/Dockerfile", "**/Dockerfile.*", "**/*.Dockerfile"],
  14. requires: { tech: ["docker"] },
  15. examples: [
  16. `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
  17. `RUN curl -L https://get.docker.com/ | bash`,
  18. `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
  19. `RUN curl -L https://example.com/release.tar.gz | tar -xz`,
  20. `RUN wget -O- https://example.com/file.zip | unzip -`,
  21. ],
  22. match(content) {
  23. const lines = content.split("\n");
  24. const hitLines: number[] = [];
  25. const snippets: string[] = [];
  26. // Coalesce RUN ... \ continuation lines into logical statements.
  27. const statements: { start: number; text: string }[] = [];
  28. let i = 0;
  29. while (i < lines.length) {
  30. const line = lines[i];
  31. if (!/^\s*RUN\b/i.test(line)) {
  32. i++;
  33. continue;
  34. }
  35. const start = i;
  36. let text = line;
  37. while (text.trimEnd().endsWith("\\") && i + 1 < lines.length) {
  38. i++;
  39. text += "\n" + lines[i];
  40. }
  41. statements.push({ start, text });
  42. i++;
  43. }
  44. const PIPE = /\b(curl|wget)\b[^|\n]*\|\s*(?:sh|bash|zsh|tar\b|gunzip\b|unzip\b)/i;
  45. const HAS_VERIFY =
  46. /(sha256sum|sha1sum|shasum|gpg\s+--?verify|cosign\s+verify|minisign|openssl\s+dgst)/i;
  47. for (const stmt of statements) {
  48. if (!PIPE.test(stmt.text)) continue;
  49. if (HAS_VERIFY.test(stmt.text)) continue;
  50. hitLines.push(stmt.start + 1);
  51. const snipStart = Math.max(0, stmt.start - 1);
  52. const snipEnd = Math.min(lines.length, stmt.start + stmt.text.split("\n").length + 1);
  53. snippets.push(lines.slice(snipStart, snipEnd).join("\n"));
  54. }
  55. if (hitLines.length === 0) return [];
  56. const match: CandidateMatch = {
  57. vulnSlug: "dockerfile-curl-pipe-unverified",
  58. lineNumbers: hitLines,
  59. snippet: snippets[0],
  60. matchedPattern: "curl|wget | sh/tar with no checksum check",
  61. };
  62. return [match];
  63. },
  64. };
packages/scanner/src/matchers/github-workflow-security.ts · Bundled script · 108 lines · 1 finding marked
  1. import type { CandidateMatch } from "@deepsec/core";
  2. import type { MatcherPlugin } from "../types.js";
  3. /**
  4. * GitHub Actions workflow + composite-action security risks (supply chain).
  5. *
  6. * Patterns:
  7. * - `pull_request_target` triggers — run on the base branch with secrets
  8. * and can checkout attacker code from the PR
  9. * - `actions/checkout@<branch>` or unpinned third-party actions — mutable refs
  10. * - `${{ github.event.pull_request.* }}` / `github.event.head_commit.message`
  11. * interpolated into `run:` blocks → shell injection
  12. * - `secrets.*` referenced in steps that run untrusted code (PR checkouts,
  13. * external scripts, building untrusted Dockerfiles)
  14. * - `permissions: write-all` or absent permissions block (defaults to broad)
  15. * - `id-token: write` combined with no audience binding
  16. */
  17. export const githubWorkflowSecurityMatcher: MatcherPlugin = {
  18. noiseTier: "precise" as const,
  19. slug: "github-workflow-security",
  20. description: "GitHub Actions workflow / composite-action with supply-chain or injection risk",
  21. filePatterns: [
  22. ".github/workflows/**/*.yml",
  23. ".github/workflows/**/*.yaml",
  24. ".github/actions/**/*.yml",
  25. ".github/actions/**/*.yaml",
  26. ],
  27. requires: { tech: ["github-actions"] },
  28. examples: [
  29. `on:\n pull_request_target:\n types: [opened]`,
  30. `on:\n workflow_run:\n workflows: [build]`,
  31. ` - uses: actions/checkout@main`,
  32. ` - uses: actions/setup-node@v3`,
  33. ` run: echo "\${{ github.event.pull_request.title }}"`,
  34. ` run: git log \${{ github.head_ref }}`,
  35. ` token: \${{ secrets.GITHUB_TOKEN }}`,
  36. `permissions: write-all`,
  37. `permissions:\n id-token: write\n contents: read`,
  38. ` - run: |\n echo \${{ github.event.pull_request.head.ref }}`,
  39. ` - 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
  40. ],
  41. match(content) {
  42. const lines = content.split("\n");
  43. const hitLines: number[] = [];
  44. const labels = new Set<string>();
  45. let firstContext: string | undefined;
  46. const PATTERNS: { regex: RegExp; label: string }[] = [
  47. {
  48. regex: /^\s*-\s*pull_request_target\b|^\s*pull_request_target\s*:/,
  49. label: "pull_request_target trigger",
  50. },
  51. { regex: /^\s*-\s*workflow_run\b|^\s*workflow_run\s*:/, label: "workflow_run trigger" },
  52. {
  53. regex: /\buses\s*:\s*[\w-]+\/[\w./-]+@(?:main|master|v?\d+|develop)\s*$/m,
  54. label: "unpinned action ref (branch/major-tag)",
  55. },
  56. {
  57. regex: /\$\{\{\s*github\.event\.(?:pull_request|head_commit|comment|issue|review)\.\w+/,
  58. label: "github.event interpolation in run:",
  59. },
  60. { regex: /\$\{\{\s*github\.head_ref\s*\}\}/, label: "github.head_ref in script" },
  61. { regex: /\bsecrets\.[A-Z_][A-Z0-9_]+/, label: "secret reference" },
  62. { regex: /^\s*permissions\s*:\s*write-all\b/, label: "permissions: write-all" },
  63. { regex: /\bid-token\s*:\s*write\b/, label: "id-token: write (OIDC)" },
  64. { regex: /\brun\s*:\s*\|.*\$\{\{[^}]*\}\}/s, label: "run block interpolating expression" },
  65. { regex: /\bcurl\s+[^|]*\|\s*(?:sh|bash)\b/, label: "curl | sh in workflow" },
  66. ];
  67. for (let i = 0; i < lines.length; i++) {
  68. for (const { regex, label } of PATTERNS) {
  69. if (regex.test(lines[i])) {
  70. hitLines.push(i + 1);
  71. labels.add(label);
  72. if (firstContext === undefined) {
  73. const s = Math.max(0, i - 2);
  74. const e = Math.min(lines.length, i + 3);
  75. firstContext = lines.slice(s, e).join("\n");
  76. }
  77. break;
  78. }
  79. }
  80. }
  81. // Always-flag fallback: any workflow file is part of the supply chain.
  82. if (hitLines.length === 0) {
  83. const anchor = lines.findIndex((l) => /^\s*(?:on|jobs|name)\s*:/.test(l));
  84. if (anchor === -1) return [];
  85. const s = Math.max(0, anchor);
  86. const e = Math.min(lines.length, anchor + 5);
  87. const match: CandidateMatch = {
  88. vulnSlug: "github-workflow-security",
  89. lineNumbers: [anchor + 1],
  90. snippet: lines.slice(s, e).join("\n"),
  91. matchedPattern: "GitHub workflow file (path-based, no specific risk pattern)",
  92. };
  93. return [match];
  94. }
  95. const match: CandidateMatch = {
  96. vulnSlug: "github-workflow-security",
  97. lineNumbers: hitLines,
  98. snippet: firstContext ?? "",
  99. matchedPattern: Array.from(labels).slice(0, 4).join(", "),
  100. };
  101. return [match];
  102. },
  103. };

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.