deepsec: the forge reviews its own security

The forge runs deepsec (open source, Apache-2.0) on itself (#14792). Its workspace is committed in .deepsec/:

What deepsec generates (data/forge/runs/, files/, the generated matchers) stays ignored.

On every pull

The pull's own check step never runs deepsec and is never handed a key: whatever a pull's code runs can read its own environment. The forge runs deepsec itself, after the fast check step is green (src/checks/deepsec_step.ts, #15024), for a repository that has a scope in .deepsec/data/forge/config.json. It lists the changed src/ files in scope from the bare repository's diff, priority paths first, and caps them by a dollar ceiling. Then it runs deepsec process --project-id forge --files-from <list> --limit <n> when all of these hold, and otherwise names the one that does not:

The check log gets one line:

deepsec: 2 changed src/ files in scope (src/http/c.ts, src/core/d.ts), at most $0.54 at $0.27 a file under a $3.00 ceiling; ran deepsec 2.3.16, no findings (advisory, never blocks the gate)

deepsec exits 1 when it produces a finding, and the line then names the exit.

The review never changes the check's verdict. It does not block the gate until its false-positive rate has been measured over two weeks.

What is left: a prompt planted in the files reviewed could steer the agent to send the key to api.anthropic.com, the one host it can reach. The key cannot leave for anywhere else.

Every week

The forge sweeps its own repository (FORGE_SENTINEL_REPO, else trevato/forge) once a week. The maintenance duty deepsec-sweep (src/maintain/duties/deepsec_sweep.ts, #15026) ticks daily and starts src/checks/deepsec_sweep.ts a week after the last sweep began. It exports the default branch's tree, then runs scan, process --limit n and revalidate --min-severity HIGH in the same cell, with the same key and the same config as a pull's review. What it wrote is filed through the same path as a pull's findings: each new one a sealed report under P0 Trust, each one already open matched.

Spend

process has no spend cap of its own. The cap is a file count: floor(ceiling ÷ $0.27). $0.27 a file was measured on the 2026-11-20 sweep at thinking high; xhigh cost about six times that.

Vercel's Sandbox mode uploads the tree to Vercel, so it stays off: .deepsec/deepsec.config.ts sets ai: { mode: "direct" }, and no run names a Vercel account.

Try it locally, with your own key: cd .deepsec && DEEPSEC_ANTHROPIC_KEY=… bunx deepsec@2.3.16 process --project-id forge --files-from <list>.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs