Repository navigation
chore(security): set up deepsec workspace - #1201
bukinoshita wants to merge 4 commits into
Conversation
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>
There was a problem hiding this comment.
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.mduse unpinnednpx deepsec, which may run a different version than the workspace’s pinned 2.3.12. Pin the command tonpx 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
|
|
||
| ## Setup | ||
|
|
||
| `npx deepsec init` created this workspace and normally completes its |
There was a problem hiding this comment.
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>
|
|
||
| ## Setup | ||
|
|
||
| `npx deepsec init` created this workspace and normally completes its |
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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
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:
deepsec init --scaffold-onlyat 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.yamlrepeats the rootminimumReleaseAgeandtrustPolicy..deepsec/is its own pnpm workspace, so the root file does not apply to it..deepsec/.gitignorealso ignoresdata/*/tech.json, which every scan rewrites with a timestamp and the absolute path of the local checkout. It also ignoresfindings/andfindings.json, the export targets from the deepsec docs. This repository is public, so findings must not be committed.biome.jsoncskips.deepsec. deepsec rewritesdeepsec.config.tsandgenerated-matchers.tsin its own style, andpnpm lintfails on them otherwise..deepsec/README.mdsets the workspace up withpnpm deepsec setup, which runs the pinned version. The generated text said to re-runnpx deepsec init, which downloads the latest release..deepsec/README.mddocuments that deepsec copies a credentialed remote URL intoproject.jsonand into exported finding links, and how to fix it..deepsec/AGENTS.mdrunsinit-projectthroughpnpm deepsec, because a baredeepsecis not onPATH.SETUP.md, a prompt for writingINFO.md, is left out, and the two docs no longer point to it forresend-node.Verified
On a fresh clone of this branch:
pnpm lint,pnpm typecheckandpnpm testpass with the same counts ascanary: Biome checks 320 files, and 49 test files pass.pnpm install --frozen-lockfileleaves.deepsec/alone, andnpm pack --dry-runlists no.deepsecfile..deepsec/,pnpm install --frozen-lockfileandpnpm deepsec scanwork. The scan flags 32 files with 39 candidate matches, andgit statusstays clean afterwards.pnpm deepsec setup --through installcompletes 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.jsonand in an exported finding, and was gone after settinggithubUrlas the README says.To finish setup
From
.deepsec/, with a model credential:This uses Vercel AI Gateway and logs in to Vercel. To use your own OpenAI key instead:
Setup then inventories the SDK's surfaces, generates matchers for what the built-in ones miss, and runs the AI review.
--max-cost-usdstops the review at that spend, and running the command again continues it.Notes
e2e/.Checklist
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..deepsec/is its own pnpm workspace.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..gitignore, and has Biome skip.deepsecbecause deepsec rewrites its config files in its own style.pnpm lint,pnpm typecheck, andpnpm teststill pass andnpm packlists no.deepsecfiles.To finish setup
The AI review has not run yet and requires a model credential. From
.deepsec/, runpnpm 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_KEYto use an OpenAI key. Setup inventories the SDK's surfaces, generates matchers, and runs the review;--max-cost-usdcaps the spend and can be resumed.Notes
originremote URL into the ignoreddata/*/project.jsonand into exported finding links, so a token embedded in that URL leaks into both.Written for commit 808376c. Summary will update on new commits.