|
| 1 | +# deepsec |
| 2 | + |
| 3 | +This directory holds the [deepsec](https://www.npmjs.com/package/deepsec) |
| 4 | +config for the parent repo. Checked into git so teammates inherit |
| 5 | +project context (auth shape, threat model, custom matchers); generated |
| 6 | +scan output is gitignored. |
| 7 | + |
| 8 | +Currently configured project: `sim` (target: `..`). |
| 9 | + |
| 10 | +## Setup |
| 11 | + |
| 12 | +1. `pnpm install` — installs deepsec. |
| 13 | +2. Add an AI Gateway / Anthropic / OpenAI token to `.env.local`. If |
| 14 | + you already have `claude` or `codex` CLI logged in on this |
| 15 | + machine, you can skip the token for non-sandbox runs (`process` / |
| 16 | + `revalidate` / `triage`); deepsec auto-detects and reuses the |
| 17 | + subscription. See |
| 18 | + `node_modules/deepsec/dist/docs/vercel-setup.md` after install. |
| 19 | +3. Open the parent repo in your coding agent (Claude Code, Cursor, …) |
| 20 | + and have it follow `data/sim/SETUP.md` to fill in |
| 21 | + `data/sim/INFO.md`. |
| 22 | + |
| 23 | +## Daily commands |
| 24 | + |
| 25 | +```bash |
| 26 | +pnpm deepsec scan |
| 27 | +pnpm deepsec process --concurrency 5 |
| 28 | +pnpm deepsec revalidate --concurrency 5 # cuts FP rate |
| 29 | +pnpm deepsec export --format md-dir --out ./findings |
| 30 | +``` |
| 31 | + |
| 32 | +`--project-id` is auto-resolved while there's only one project in |
| 33 | +`deepsec.config.ts`. Once you've added a second project, pass |
| 34 | +`--project-id sim` (or whichever id you want) explicitly. |
| 35 | + |
| 36 | +`scan` is free (regex only). `process` is the AI stage (≈$0.30/file |
| 37 | +on Opus by default). Run state goes to `data/sim/`. |
| 38 | + |
| 39 | +## Adding another project |
| 40 | + |
| 41 | +To scan another codebase from this same `.deepsec/`: |
| 42 | + |
| 43 | +```bash |
| 44 | +pnpm deepsec init-project ../some-other-package # path relative to .deepsec/ |
| 45 | +``` |
| 46 | + |
| 47 | +Appends an entry to `deepsec.config.ts` and writes |
| 48 | +`data/<id>/{INFO.md,SETUP.md,project.json}`. Open the new SETUP.md |
| 49 | +in your agent to fill in INFO.md. |
| 50 | + |
| 51 | +## Layout |
| 52 | + |
| 53 | +``` |
| 54 | +deepsec.config.ts Project list (one entry per scanned repo) |
| 55 | +data/sim/ |
| 56 | + INFO.md Repo context — checked into git, hand-curated |
| 57 | + SETUP.md Agent setup prompt — checked in, deletable |
| 58 | + project.json Generated (gitignored) |
| 59 | + files/ One JSON per scanned source file (gitignored) |
| 60 | + runs/ Run metadata (gitignored) |
| 61 | + reports/ Generated markdown reports (gitignored) |
| 62 | +AGENTS.md Pointer for coding agents |
| 63 | +.env.local Tokens (gitignored) |
| 64 | +``` |
| 65 | + |
| 66 | +## Docs |
| 67 | + |
| 68 | +After `pnpm install`: |
| 69 | + |
| 70 | +- Skill: `node_modules/deepsec/SKILL.md` |
| 71 | +- Full docs: `node_modules/deepsec/dist/docs/{getting-started,configuration,models,writing-matchers,plugins,architecture,data-layout,vercel-setup,faq}.md` |
| 72 | + |
| 73 | +Or browse on |
| 74 | +[GitHub](https://github.com/vercel/deepsec/tree/main/docs). |
0 commit comments