Skip to content

chore(security): set up deepsec workspace - #1201

Open
bukinoshita wants to merge 4 commits into
canaryfrom
fix/setup-deepsec-5620
Open

bukinoshita wants to merge 4 commits into
canaryfrom
fix/setup-deepsec-5620

Conversation

@bukinoshita

@bukinoshita bukinoshita commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Related issue or discussion

None. This was requested directly.

What this changes

Adds a deepsec workspace in .deepsec/. deepsec is Vercel's open-source security review harness: a local regex scan picks candidate files, then an AI agent reviews them. Nothing in this PR runs in CI or ships in the npm package.

The AI review has not run, so there are no findings yet. It needs a model credential and costs money, so a maintainer has to finish setup (see "To finish setup").

What is in the workspace:

  • The scaffold from deepsec init --scaffold-only at deepsec 2.3.12, pinned exactly, with a lockfile.
  • data/resend-node/INFO.md, the project context deepsec gives to every AI review. It describes how the SDK handles the API key, the threat model, the patterns to flag and the known false positives. It steers every later review, so it is worth a careful read.

Changes on top of the generated scaffold:

  • .deepsec/pnpm-workspace.yaml repeats the root minimumReleaseAge and trustPolicy. .deepsec/ is its own pnpm workspace, so the root file does not apply to it.
  • .deepsec/.gitignore also ignores data/*/tech.json, which every scan rewrites with a timestamp and the absolute path of the local checkout. It also ignores findings/ and findings.json, the export targets from the deepsec docs. This repository is public, so findings must not be committed.
  • biome.jsonc skips .deepsec. deepsec rewrites deepsec.config.ts and generated-matchers.ts in its own style, and pnpm lint fails on them otherwise.
  • .deepsec/README.md sets the workspace up with pnpm deepsec setup, which runs the pinned version. The generated text said to re-run npx deepsec init, which downloads the latest release.
  • .deepsec/README.md documents that deepsec copies a credentialed remote URL into project.json and into exported finding links, and how to fix it.
  • .deepsec/AGENTS.md runs init-project through pnpm deepsec, because a bare deepsec is not on PATH.
  • The generated SETUP.md, a prompt for writing INFO.md, is left out, and the two docs no longer point to it for resend-node.

Verified

On a fresh clone of this branch:

  • pnpm lint, pnpm typecheck and pnpm test pass with the same counts as canary: Biome checks 320 files, and 49 test files pass.
  • The root pnpm install --frozen-lockfile leaves .deepsec/ alone, and npm pack --dry-run lists no .deepsec file.
  • In .deepsec/, pnpm install --frozen-lockfile and pnpm deepsec scan work. The scan flags 32 files with 39 candidate matches, and git status stays clean afterwards.
  • pnpm deepsec setup --through install completes the scaffold and install phases, so setup resumes at the model-access step.

The remote URL note in the README was reproduced with a dummy token. The token appeared in project.json and in an exported finding, and was gone after setting githubUrl as the README says.

To finish setup

From .deepsec/, with a model credential:

pnpm install
pnpm deepsec setup --model-profile value --max-cost-usd 25

This uses Vercel AI Gateway and logs in to Vercel. To use your own OpenAI key instead:

MY_KEY=... pnpm deepsec setup --agent codex --model-auth direct --ai-provider openai --ai-api-key-env MY_KEY --max-cost-usd 25

Setup then inventories the SDK's surfaces, generates matchers for what the built-in ones miss, and runs the AI review. --max-cost-usd stops the review at that spend, and running the command again continues it.

Notes

  • The lockfile pins 288 packages, all tooling. GitHub's dependency graph will list them, and Renovate will likely propose deepsec updates as it does for e2e/.

Checklist

  • I understand the code in this PR and the problem it solves.
  • I read this description, and it accurately describes the change.
Open in Web Open in Cursor 

Summary by cubic

Adds a .deepsec/ workspace so maintainers can run deepsec security reviews of the SDK locally. Nothing here runs in CI or ships in the npm package.

  • Pins deepsec 2.3.12 with a lockfile; .deepsec/ is its own pnpm workspace.
  • Adds data/resend-node/INFO.md, the project context (what the SDK does, how the API key is handled, threat model, patterns to flag, known false positives) that deepsec injects into every AI review.
  • Keeps regenerated scan output out of the public repo via .gitignore, and has Biome skip .deepsec because deepsec rewrites its config files in its own style.
  • Verified that root pnpm lint, pnpm typecheck, and pnpm test still pass and npm pack lists no .deepsec files.

To finish setup

The AI review has not run yet and requires a model credential. From .deepsec/, run pnpm deepsec setup --model-profile value --max-cost-usd 25 (uses Vercel AI Gateway and logs in to Vercel) or --agent codex --model-auth direct --ai-provider openai --ai-api-key-env MY_KEY to use an OpenAI key. Setup inventories the SDK's surfaces, generates matchers, and runs the review; --max-cost-usd caps the spend and can be resumed.

Notes

  • The workspace docs warn that deepsec copies the origin remote URL into the ignored data/*/project.json and into exported finding links, so a token embedded in that URL leaks into both.

Written for commit 808376c. Summary will update on new commits.

View guided diff

cursoragent and others added 3 commits November 14, 2026 03:28
Scaffolded with `deepsec init --scaffold-only` (deepsec 2.3.12) and
installed with a lockfile. Nothing here runs in CI or ships in the npm
package.

Changes on top of the generated scaffold:

- pnpm-workspace.yaml repeats the root minimumReleaseAge and trustPolicy.
  .deepsec is its own pnpm workspace, so the root file does not apply.
- .gitignore also ignores data/*/tech.json, which every scan rewrites with
  a timestamp and the absolute path of the local checkout, and the export
  targets from the deepsec docs, so findings cannot be committed to this
  public repository.
- Biome skips .deepsec, because deepsec rewrites deepsec.config.ts and
  generated-matchers.ts in its own style.

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
deepsec injects INFO.md into every AI review. It covers what the SDK does,
how the API key is handled, the threat model, the patterns to flag and the
known false positives.

The generated SETUP.md, a prompt for writing this file, is not committed.

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
AGENTS.md asks for no comments that explain the code. The reasons for
these entries are in the commit that added them.

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>
@bukinoshita
bukinoshita requested a review from a team as a code owner November 14, 2026 03:30
@bukinoshita
bukinoshita requested a review from drish November 14, 2026 03:30

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 issues found across 10 files

Confidence score: 3/5

  • In .deepsec/README.md, setup or export can copy credentials embedded in Git remote URLs into metadata and finding links, exposing them wherever those outputs are shared. Warn users to remove credentials before running either command.
  • The recovery instructions in .deepsec/README.md use unpinned npx deepsec, which may run a different version than the workspace’s pinned 2.3.12. Pin the command to npx deepsec@2.3.12 init.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name=".deepsec/README.md">

<violation number="1" location=".deepsec/README.md:12">
P2: The setup guide omits the credential-bearing Git remote hazard: deepsec copies remote URLs into metadata and exported finding links. Warn users to remove credentials from the remote before running setup or export.</violation>

<violation number="2" location=".deepsec/README.md:12">
P2: The recovery path re-runs unpinned `npx deepsec`, so it can execute a newer registry release instead of the workspace’s pinned 2.3.12. Pin the bootstrap command to `npx deepsec@2.3.12 init`.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Re-trigger cubic

Comment thread .deepsec/data/resend-node/INFO.md Resolved
Comment thread .deepsec/AGENTS.md Resolved
Comment thread .deepsec/README.md Outdated

## Setup

`npx deepsec init` created this workspace and normally completes its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The setup guide omits the credential-bearing Git remote hazard: deepsec copies remote URLs into metadata and exported finding links. Warn users to remove credentials from the remote before running setup or export.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .deepsec/README.md, line 12:

<comment>The setup guide omits the credential-bearing Git remote hazard: deepsec copies remote URLs into metadata and exported finding links. Warn users to remove credentials from the remote before running setup or export.</comment>

<file context>
@@ -0,0 +1,77 @@
+
+## Setup
+
+`npx deepsec init` created this workspace and normally completes its
+install, exact Vercel project link, Sandbox/model probes, threat model,
+coverage-guided scans, custom matchers, and first AI processing run.
</file context>

Comment thread .deepsec/README.md Outdated

## Setup

`npx deepsec init` created this workspace and normally completes its

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The recovery path re-runs unpinned npx deepsec, so it can execute a newer registry release instead of the workspace’s pinned 2.3.12. Pin the bootstrap command to npx deepsec@2.3.12 init.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At .deepsec/README.md, line 12:

<comment>The recovery path re-runs unpinned `npx deepsec`, so it can execute a newer registry release instead of the workspace’s pinned 2.3.12. Pin the bootstrap command to `npx deepsec@2.3.12 init`.</comment>

<file context>
@@ -0,0 +1,77 @@
+
+## Setup
+
+`npx deepsec init` created this workspace and normally completes its
+install, exact Vercel project link, Sandbox/model probes, threat model,
+coverage-guided scans, custom matchers, and first AI processing run.
</file context>

- INFO.md said every `fetchRequest` call sends the bearer key. The verb
  helpers attach the default headers; `fetchRequest` is public and adds
  none.
- README.md now sets the workspace up with the pinned `pnpm deepsec setup`
  instead of re-running `npx deepsec init`, which fetches the latest
  release. It also documents that deepsec copies a credentialed remote URL
  into project.json and into exported finding links.
- AGENTS.md runs `init-project` through pnpm, because a bare `deepsec` is
  not on PATH, and no longer says resend-node has a SETUP.md.

Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 issues found across 3 files (changes from recent commits).

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Requires human review: Auto-approval blocked by 2 unresolved issues from previous reviews.

View guided diff | Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants