Stop triaging CVEs by CVSS score. Start fixing the ones that can actually hurt you, with a plan you can prove is safe.
A command-line framework for risk-aware, uncertainty-driven prioritization and safe remediation of software dependency vulnerabilities, built on reachability analysis, dependency hypergraphs, and decision optimization, with a formally verified plan checker and a tamper-evident audit log.
Honesty note. This README describes the design and target behavior of DepRisk. Every feature is tagged with its status in Feature status. Benchmark numbers are never hand-written: they are produced by
deprisk benchand committed underbenchmarks/results/. If a number is not there, it does not exist yet.
- The problem
- What DepRisk does differently
- Quick start
- Installation
- Usage
- How it works (the method)
- Architecture
- Formal verification
- Tamper-evident audit log
- Air-gapped operation
- CI/CD integration
- Configuration
- Evaluation and reproducibility
- Threat model and limitations
- Feature status
- Roadmap
- For teams and companies
- Contributing
- Research and citation
- License
A typical mid-size project has hundreds of transitive dependencies. A scanner reports dozens or hundreds of advisories. Teams then do one of three things:
- Fix everything by CVSS order. CVSS measures severity in a generic scenario, not your exposure. Most "critical" findings sit in code paths your application never calls.
- Ignore the noise. Alert fatigue wins and real risk hides in the pile.
- Bump everything to latest. This breaks builds, burns engineering time, and still gives no guarantee the result is consistent.
Three questions are left unanswered by mainstream tooling:
| Question | Why it is hard |
|---|---|
| Is the vulnerable code reachable from my application? | Needs call-graph analysis, not just version matching. |
| How sure are we, and what is the downside if we are wrong? | Risk is a distribution, not a single number. |
| Given limited time, which set of upgrades is best, and is that set even consistent? | Packages constrain each other in groups (hyperedges), and the best set is an optimization problem. |
DepRisk answers all three, from the terminal, offline if you need it.
Every capability below is implemented and tested in 1.6.0; full status (including which statistical priors remain uncalibrated until fitted on real longitudinal data) is tracked in Feature status and docs/stability.md.
- Reachability-aware (7/7 languages) (experimental calibration). Maps each advisory to vulnerable symbols and checks whether your code can reach them across C#, JavaScript/TypeScript, Python, Java, Rust, Go, and PHP via the single bundled Rust analyzer (
#![forbid(unsafe_code)], run-time SHA-256 verification). Findings are labeledreachable,possibly-reachable,unreachable, orunknown, never silently dropped. - Uncertainty-driven (experimental defaults). Risk is modeled as a probability distribution (seeded Monte Carlo
R = Reach x Exploit x Impact), anddeprisk plan --solver milpoptimizes expected risk and tail risk (RockafellarβUryasev CVaR). - Decision optimization. Remediation is solved as a constrained optimization problem (
deprisk plan --solver greedy|milp|external): minimize residual risk under an exact integer-minute effort budget, dependency ranges, and policy constraints (--pin,--no-major,--license-allow). - Hypergraph & visual offline reports. Multi-package constraints are modeled as hyperedges (
deprisk graph --format table|json|dot|md|html), with zero-CDN clickable inline<svg>dependency & reachability call graphs, boundedΒ±3-line call-site code snippets, opt-in--vscode-links, and GitHub-ready Mermaidflowchart LRMarkdown diagrams (CSP: default-src 'none'). - Verified plans (Ada/SPARK). A small, formally proven kernel (
kernel/spark/, P1βP6 proven by GNATprove in CI) independently checks every plan (deprisk verify --kernel). The optimizer is untrusted; the checker is proven. - Auditable. Every command is recorded in a hash-chained, ECDSA-signed log (
deprisk audit verify) with optional passphrase-encrypted keys (init --encrypt). - Air-gapped ready. Zero network calls during analysis, DSSE-signed offline data bundles (
deprisk bundle create|verify|import), and data-freshness enforcement (--max-data-age). - Interoperable. Reads NuGet (
project.assets.json,packages.lock.json), npm/pnpm/Yarn (package-lock.jsonv1βv3,pnpm-lock.yamlv6/v9,yarn.lockv1/Berry, ADR 0058), Python/PyPI (uv.lock,poetry.lock, pinnedrequirements.txt, ADR 0053), Rust/Cargo (Cargo.lock, ADR 0054), Go (go.mod, ADR 0054), Java/Maven (pom.xml,gradle.lockfile, ADR 0059), PHP/Composer (composer.lock, ADR 0059), and CycloneDX/SPDX SBOMs (JSON) and emits SARIF 2.1.0, JSON (21/21 CI-validated schemas), Graphviz DOT, and signed OpenVEX 0.2.0 (DSSE/in-toto). - Deterministic. Same inputs, same seed, same output. Optional post-v1.0 local-LLM narrative explanations are planned and will never influence any plan or verdict.
Every graph, rank, ci, plan, explain, and license command can emit a 100% offline, single-file HTML report (Content-Security-Policy: default-src 'none', zero JavaScript, zero CDN) with clickable inline <svg> dependency & call graphs, bounded Β±3-line call-site code snippets, opt-in --vscode-links, and GitHub-ready Mermaid flowchart LR Markdown:
Verified end-to-end using the published DepRisk.Cli NuGet global tool against 271,632 live OSV advisories + live FIRST EPSS + live CISA KEV (zero crashes; full untouched log in docs/validation-results/README.md):
| Real Repository / Target | Ecosystem | Live OSV Advisories | Real Result | Wall Time |
|---|---|---|---|---|
expressjs/express (HEAD) |
npm | 232,876 | 9 real findings (serialize-javascript HIGH 8.1, uuid HIGH 7.5, hbs, diff, glob, minimatch + live EPSS & Fixed In) + 368/368 SPDX licenses extracted offline (0 unknown) |
5s |
fastapi/fastapi (HEAD, 3,291 files) |
PyPI + Python reach | 26,498 | 0 findings | 2s |
spring-projects/spring-petclinic (HEAD) |
Maven + Java reach | 7,155 | 0 findings | 3s |
DepRisk (analyzers/reach/Cargo.lock) |
Cargo | 3,136 | 0 findings | <1s |
DepRisk (DepRisk.slnx) |
NuGet | 1,967 | 1 real finding (GHSA-5crp-9r3c-p9vr, Newtonsoft.Json 12.0.1, HIGH 7.5, EPSS 32.9%, fixed in 13.0.1) |
3s |
Everything works offline in 1.6.0:
# 1. Install the .NET global tool
dotnet tool install -g DepRisk.Cli
deprisk doctor
# 2. Inside your project
cd my-project
dotnet restore # NuGet: scan reads obj/project.assets.json (or packages.lock.json)
# npm: scan reads package-lock.json (npm install --package-lock-only is enough)
deprisk init # optional: start a signed audit log (.deprisk/)
# 3. Scan, visualize the hypergraph, match, rank, and gate CI
deprisk scan # resolved dependency graph (--ecosystem nuget|npm if both are present)
deprisk graph # hypergraph table (--format dot --out graph.dot for Graphviz SVG/PNG)
deprisk match --advisories NuGet.zip # (npm: npm.zip) known vulnerabilities from local OSV data
deprisk rank --advisories NuGet.zip --epss epss_scores-current.csv.gz --kev known_exploited_vulnerabilities.json
deprisk ci --advisories NuGet.zip --fail-on "kev&fixable,cvss>=9" --format sarif --out deprisk.sarif
deprisk audit verify # verify the signed audit log
# 4. Reachability, risk distributions, explanations, VEX, and benchmarks
deprisk symbols template --advisories NuGet.zip --out symbols-draft.json
deprisk symbols check --advisories NuGet.zip --symbols data/symbols/nuget-starter.json
deprisk reach --advisories NuGet.zip --symbols data/symbols/nuget-starter.json
deprisk rank --advisories NuGet.zip --symbols data/symbols/nuget-starter.json --model risk --seed 42
deprisk explain GHSA-xxxx-xxxx-xxxx --advisories NuGet.zip --symbols data/symbols/nuget-starter.json
deprisk vex --product pkg:nuget/App@1.0.0 --author "Example Corp" --advisories NuGet.zip --symbols data/symbols/nuget-starter.json --out vex.json
deprisk bench --cases cases.json
# 5. Verified remediation planning (MILP+CVaR + Ada/SPARK kernel + safe apply)
deprisk catalog build . --out catalog.json
deprisk plan . --advisories NuGet.zip --catalog catalog.json --budget 6h --solver milp --format json --out plan.json
deprisk verify plan.json . --advisories NuGet.zip --catalog catalog.json --kernel kernel/spark/bin/deprisk-kernel
deprisk apply plan.json --dry-run .
deprisk apply plan.json --write . --advisories NuGet.zip --catalog catalog.json --kernel kernel/spark/bin/deprisk-kernel
# 6. Signed offline data bundles (air-gapped transfer)
deprisk bundle create --key bundle.key --out offline-bundle.zip --advisories NuGet.zip --kev kev.json --epss epss.csv.gz
deprisk bundle verify offline-bundle.zip --pubkey bundle.pub
deprisk bundle import offline-bundle.zip --pubkey bundle.pub --dest ./offline-data
# 7. Native offline AI Agent integration (read-only MCP stdio server + SKILL.md)
deprisk mcp # see docs/ai-agents.md and skills/deprisk/SKILL.mdAdvisory data (OSV dumps), EPSS scores, and the CISA KEV list are files you download on a connected machine and pass in; DepRisk never downloads anything. For a full end-to-end validation harness and recorded dogfooding/distribution results, see docs/real-world-validation.md and docs/validation-results/README.md.
Installation channels: All four channels ship today: Option A (NuGet global tool), Option B (standalone self-contained binaries for
linux-x64,osx-arm64, andwin-x64β no .NET required, ADR 0051), Option C (official multi-stage non-root Docker image on GHCR, ADR 0052), and Option D (from source). The Rust reachability analyzer is bundled with run-time SHA-256 verification (ADR 0022, ADR 0033, ADR 0034). The formally verified Ada/SPARK kernel lives inkernel/spark/(bundled in both thelinux-x64standalone archive and the Docker image, and buildable/provable from source with Alire + GNATprove, ADR 0045).
dotnet tool install -g DepRisk.Cli
deprisk doctor # checks the installationDownload the archive for your OS (linux-x64, osx-arm64, or win-x64) and SHA256SUMS from GitHub Releases (ADR 0051). Each archive includes deprisk, the matching bundled Rust reachability analyzer (analyzers/<rid>/deprisk-reach with run-time SHA-256 verification), and β on linux-x64 β the GNATprove-verified Ada/SPARK deprisk-kernel:
# Linux (x64) / macOS (arm64)
sha256sum -c --ignore-missing SHA256SUMS
tar -xzf deprisk-<version>-linux-x64.tar.gz
cd deprisk-<version>-linux-x64
./deprisk doctor# Windows (x64)
Get-FileHash .\deprisk-<version>-win-x64.zip -Algorithm SHA256
Expand-Archive -Path .\deprisk-<version>-win-x64.zip -DestinationPath .
.\deprisk-<version>-win-x64\deprisk.exe doctorKeep
analyzers/<rid>/next to thedepriskexecutable so reachability analysis finds and verifies the bundled analyzer automatically.
The official image (ghcr.io/codeoops-dev/deprisk, linux/amd64, ADR 0052) runs as a non-root user and bundles deprisk, the Rust reachability analyzer (analyzers/linux-x64/deprisk-reach with ADR 0034 SHA-256 verification), and the Ada/SPARK verification kernel (/opt/deprisk/deprisk-kernel):
# Scan a project completely offline (--network none)
docker run --rm --network none -v "$PWD":/work -w /work ghcr.io/codeoops-dev/deprisk:latest scan
# Verify a remediation plan with the bundled Ada/SPARK kernel
docker run --rm --network none -v "$PWD":/work -w /work ghcr.io/codeoops-dev/deprisk:latest \
verify plan.json /work --advisories /work/NuGet.zip --catalog /work/catalog.json --kernel /opt/deprisk/deprisk-kernelRequirements today: the .NET 10 SDK. The Rust toolchain is needed only to build the reachability analyzer from source (analyzers/reach), for example on a platform the package does not bundle it for (use rustup: the release is pinned in analyzers/reach/rust-toolchain.toml, and rustup toolchain install in that directory installs it); GNAT/GNATprove will be needed once the SPARK kernel lands.
git clone https://github.com/codeoops-dev/deprisk.git
cd deprisk
dotnet build -c Release
dotnet test -c Release
dotnet run --project src/DepRisk.Cli -- scan path/to/your/projectCommands marked (planned) do not exist yet; the table in Feature status is the source of truth. Output formats are per command (listed below). Everything that exists today works offline and never makes a network call. Exit codes are stable and documented below.
| Command | Purpose |
|---|---|
deprisk init [path] |
Create .deprisk/ with a signing key and start the signed audit log. Never overwrites anything. --encrypt encrypts the key with the passphrase in DEPRISK_KEY_PASSPHRASE (or in the file named by DEPRISK_KEY_PASSPHRASE_FILE); never given on the command line. --key-file <file> writes the key there instead; commands find it through DEPRISK_KEY_FILE. |
deprisk scan [path] |
Read the resolved dependency graph: NuGet (project.assets.json or packages.lock.json), npm/pnpm/Yarn (package-lock.json v1βv3, pnpm-lock.yaml v6/v9, yarn.lock v1/Berry, ADR 0058), Python/PyPI (uv.lock, poetry.lock, or pinned requirements.txt, ADR 0053), Rust/Cargo (Cargo.lock, ADR 0054), Go (go.mod, ADR 0054), Java/Maven (pom.xml, gradle.lockfile, ADR 0059), PHP/Composer (composer.lock, ADR 0059), or a CycloneDX (1.2 to 1.7) or SPDX (2.2, 2.3) JSON SBOM when its path is given (bom.json, sbom.json, *.cdx.json, *.spdx.json, or any name with --ecosystem; a directory scan never picks one up). --ecosystem auto|nuget|npm|pypi|cargo|go|maven|composer (default: detect; a tree or an SBOM with multiple ecosystems asks you to choose), --format table|json, --out. Offline and deterministic. |
deprisk match [path] |
Match the resolved dependencies against local OSV advisories: --advisories <dir|.zip|.json> (required), --ecosystem, --format table|json, --out, --strict. Offline; matching is by version only. |
deprisk rank [path] |
Like match, ordered by the baseline method: CISA KEV, then EPSS, then CVSS base score (v3.x or v4.0). --advisories <...> (required), --epss <csv[.gz]>, --kev <json>, --ecosystem, --format table|json|sarif, --out, --strict; optionally --symbols <file|dir> (with --source, --analyzer, --entrypoints, --entrypoint, --timeout) adds a reachability verdict to each finding without changing the order. Offline; the reference (B2) for the later model. |
deprisk graph [path] |
The dependency hypergraph of the resolved graph across all 7 ecosystems (NuGet, npm/pnpm/Yarn, PyPI, Cargo, Go, Maven/Gradle, Composer): nodes, hyperedges, every requirement checked against the resolved version (violated and undecided ones are listed), statistics. --ecosystem, --format table|json|dot, --out. Offline. |
deprisk reach [path] |
For every advisory that applies, can the vulnerable code be reached from your application (C# for NuGet, JavaScript and TypeScript for npm)? --advisories <...> and --symbols <file|dir> (required; see docs/symbol-maps.md), --source <dir>, --entrypoints auto|public-api|none, --entrypoint <Ns.Type.Method> (C#) or --entrypoint <path/file.js::name> (npm), --analyzer <file> (or DEPRISK_REACH) to use another analyzer binary; by default the one bundled with the NuGet package is used (linux-x64, linux-arm64, osx-x64, osx-arm64, win-x64; elsewhere build it from analyzers/reach), --timeout, --format table|json, --out. Offline. |
deprisk symbols template [path] |
Which advisory and package pairs of your project have no symbol map entry yet, and a draft for them. --advisories <...> (required), --symbols <file|dir> (leave out what is already covered), --ecosystem, --format table|json, --out <file> (never replaces an existing file without --force), --strict. The draft has empty symbols, complete: null and an empty source on purpose: reach and the other commands refuse it until you have filled in all three; no symbols are proposed (docs/symbol-maps.md, ADR 0024). Offline. |
deprisk symbols check [path] |
Do the symbol maps still fit this project? Counts the entries that apply and lists the unused ones, the incomplete ones (complete: false), complete ones on transitive-only packages, and the pairs still missing. --advisories <...> and --symbols <file|dir> (required), --fail-on missing,incomplete,unused (exit 1 when a condition holds), --ecosystem, --strict. Table output; checks fit, not the correctness of the symbols (docs/symbol-maps.md, ADR 0025). Offline. |
deprisk symbols mine |
Draft candidate symbols from a fix commit in a local git clone (--repo <dir>, --commit <sha|ref>, --advisory <id>, --package <name>, --language csharp|javascript, --format table|json, --out <file>, --force, --git <path>). Drafts keep complete: null and source: "" so reach refuses them until a person reviews them; runs git offline with config/diff hardening (ADR 0038). |
deprisk catalog build [path] |
Build an offline catalog.v1 candidate-version file from a local NuGet package cache (--cache <dir>, --all, --out <file>) for v0.3 remediation planning (ADR 0039). |
deprisk catalog check <file> |
Validate a catalog.v1 candidate-version file offline (schema, versions, counts, SHA-256; exit 4 on any error, ADR 0039). |
deprisk rank --model risk |
Risk distributions by seeded Monte Carlo (R = Reach x Exploit x Impact): per finding mean, p50, p90, p95, cvar95, and the baseline rank for comparison. --samples, --seed, --rank-by mean|p50|p90|p95|cvar95, --risk-params <file>. Uses reachability when --symbols is given. The built-in parameters are uncalibrated placeholders and say so in every result (ADR 0015). |
deprisk plan [path] |
Compute and independently verify (P1βP5) a deterministic remediation plan (plan.v1) under an effort budget (--advisories, --catalog <file>, --budget 6h, --solver greedy|milp|external, --optimizer <exe>, --risk-aversion <Ο>, --cvar-alpha <Ξ±>, --pin, --no-major, --license-allow, --format table|json, --out; ADR 0042, ADR 0043). Offline. |
deprisk verify <plan> |
Independently verify a plan.v1 file against the project, advisories, catalog, and policy using the formally verified Ada/SPARK kernel (--kernel <exe>, P1βP6) or the C# reference verifier (P1βP5); exit 0 on ACCEPT, exit 2 on REJECT (--advisories, --catalog, --budget, --pin, --no-major, --license-allow, --format table|json, --out; ADR 0046). Offline. |
deprisk apply <plan> |
Preview (--dry-run, read-only) or apply (--write --advisories <...> --catalog <file> [--kernel <exe>]) manifest edits from a plan.v1 file; --write runs independent verification first (exit 2 on failure) and rolls back atomically on I/O errors (ADR 0042, ADR 0049). |
deprisk explain <id> [path] |
Why a finding stands where it does: the baseline key that decided its place (or the risk statistic and the baseline rank), the evidence (installed where, fixed in, KEV, EPSS, CVSS), the reachability path step by step with the symbol sources, and what would change the picture. <id> is an advisory id or alias; --package, the analysis options of rank (--advisories, --epss, --kev, --symbols..., --model risk...), --format table|json, --out. Every sentence is built from the data by a fixed template. |
deprisk vex [path] |
An OpenVEX 0.2.0 document, one statement per finding, for --product <purl|iri> by --author <text> (--role, --timestamp <rfc3339>; the analysis options of rank). not_affected (justification vulnerable_code_not_in_execute_path) only for a finding proven unreachable under strict conditions (see below); affected with an action for a reachable one; everything else under_investigation. With --sign --key <private key> (--subject-file <file> | --subject-digest sha256:<hex>) the document is signed: a DSSE envelope with an in-toto statement whose predicate is the OpenVEX document (ADR 0021). |
deprisk vex verify <envelope> --pubkey <public key> [--subject-file <file>] |
Verify a signed OpenVEX document against a public key (exit code 3 if it does not verify), and optionally that it is about the given files. A valid signature says who signed, not that the statements are true. |
deprisk audit verify [path] |
Verify the integrity of the audit log (--pubkey <file>, --head <hash>). |
deprisk bundle create|verify|import |
Package, DSSE-sign (ECDSA P-256), verify (exit 3 on any tamper or extra file), and safely unpack offline data bundles (advisories, epss, kev, symbols, catalog, risk-params, ADR 0047). |
deprisk mcp |
Start an offline, read-only Model Context Protocol (MCP) JSON-RPC 2.0 server on stdin/stdout for AI coding agents (Antigravity, Claude Code, Cursor, Windsurf, Codex). Exposes strictly read-only tools (deprisk_doctor, deprisk_scan, deprisk_graph, deprisk_match, deprisk_rank, deprisk_reach, deprisk_explain, deprisk_plan, deprisk_verify, deprisk_license, deprisk_audit_verify) in-process; see docs/ai-agents.md and skills/deprisk/SKILL.md (ADR 0060, ADR 0064). |
deprisk license [path] |
Offline SPDX license inventory and policy gate reading license metadata from CycloneDX/SPDX SBOMs, catalog.v1, package-lock.json, pnpm-lock.yaml, composer.lock, and pom.xml. Supports --allow <spdx,...>, --deny <spdx,...>, --fail-on-unknown, --catalog <file>, --format table|json|md|html, --out; exits 1 on violation (ADR 0064). |
deprisk bench --cases <manifest.json> |
Compare the baselines (B1 CVSS only, B2 KEV/EPSS/CVSS, B3 reachable-only in a naive and a conservative form) with the risk model on labeled cases, with a held-out split (--split dev|test|all), a leakage guard on the EPSS and KEV dates, case-level bootstrap intervals, reachability precision/recall and unsound-unreachable counts, and calibration (Brier, log loss, reliability). Offline and deterministic; --samples, --seed, --rank-by, --risk-params, --bootstrap, --analyzer, --strict, --format table|json, --out. Format and reading guide: docs/benchmarks.md (ADR 0017). |
deprisk bench calibrate --cases <manifest.json> --out <risk-params.json> |
Fit the Reach factor of the risk model on the dev split (a Beta posterior per reachability label; --prior uniform|current, --min-count, --risk-params) and write a complete parameters file with a provenance note. Judge it on the test split with deprisk bench --split test --risk-params <file>. Exploit and Impact are not fitted. ADR 0018. |
deprisk ci [path] |
One-shot CI mode: like rank, plus a policy gate. --fail-on <expression> (see below) makes it exit with code 1 when a finding matches; --format table|json|sarif, --out; optionally --symbols <file|dir> with --source, --analyzer, --entrypoints, --entrypoint, --timeout (as for reach) to add reachability and use it in the gate. The verdict is printed on standard error so json and sarif on standard output stay clean. |
deprisk doctor |
Diagnose the installation, including the audit signing key (--format table|json). |
deprisk version |
Print the version. |
deprisk help |
Show the command list and options (deprisk --help does the same). |
A VEX statement is made for other people to rely on, so not_affected is the hardest status to earn. deprisk vex writes it only for a finding whose reachability verdict is unreachable, which itself requires a symbol list declared complete, every source file read, no unreadable reflection or call on a value of unknown type in the reachable code, and a direct dependency; vex then checks again that the package is a direct dependency everywhere it occurs, that no file was skipped or unreadable, and that the symbol list has provenance. If any condition fails, the statement is under_investigation with a note. Without --symbols every statement is under_investigation. The impact statement names the analyzer, the digest of the analyzed sources, and the digest of the symbol maps. It is a statement about a conservative call graph, not a proof (ADR 0016).
These work today.
# VEX statements to share with customers (`not_affected` only under the strict conditions above)
deprisk vex --product pkg:nuget/App@1.0.0 --author "Example Corp" --advisories NuGet.zip --symbols symbols/ --out vex.json
# Sign it (a DSSE envelope with an in-toto statement; the key is an ECDSA P-256 key in PEM form, for example from
# `openssl ecparam -name prime256v1 -genkey -noout -out vex.key`) and let a customer verify it with the public key
deprisk vex --product pkg:nuget/App@1.0.0 --author "Example Corp" --advisories NuGet.zip --symbols symbols/ --sign --key vex.key --subject-file App.1.0.0.nupkg --out vex.intoto.json
deprisk vex verify vex.intoto.json --pubkey vex.pub --subject-file App.1.0.0.nupkg
# Gate a build on what is not proven unreachable
deprisk ci --advisories NuGet.zip --symbols symbols/ --fail-on "kev&fixable,cvss>=9¬-unreachable"
# Reproducible risk run
deprisk rank --advisories NuGet.zip --symbols symbols/ --model risk --seed 42 --samples 5000
# Inspect the dependency hypergraph in the terminal, or export Graphviz DOT to render an SVG/PNG
deprisk graph .
deprisk graph . --format dot --out graph.dot
dot -Tsvg graph.dot -o graph.svg
# Build an offline candidate catalog, compute a tail-risk (MILP + CVaR) remediation plan, verify it, and preview edits
deprisk catalog build . --out catalog.json
deprisk plan . --advisories NuGet.zip --catalog catalog.json --budget 8h --solver milp --risk-aversion 0.4 --cvar-alpha 0.95 --pin lib-x --no-major lib-y --format json --out plan.json
deprisk verify plan.json . --advisories NuGet.zip --catalog catalog.json
deprisk apply plan.json --dry-run
# Optional: build & formally prove the Ada/SPARK verification kernel (P1βP6) with Alire, then verify the plan with it
cd kernel/spark && alr -n build && alr -n exec -- gnatprove -P deprisk_kernel.gpr --mode=prove --level=2 --warnings=error
deprisk verify plan.json . --advisories NuGet.zip --catalog catalog.json --kernel kernel/spark/bin/deprisk-kernel --format json
# Package, sign, verify, and unpack an offline data bundle (DSSE + ECDSA P-256)
deprisk bundle create --key bundle.key --out offline-bundle.zip --advisories NuGet.zip --kev kev.json --epss epss.csv.gz
deprisk bundle verify offline-bundle.zip --pubkey bundle.pub
deprisk bundle import offline-bundle.zip --pubkey bundle.pub --dest ./offline-dataGitHub Actions (action.yml, ADR 0048):
- uses: codeoops-dev/DepRisk@v1.6.0
with:
bundle: offline-bundle.zip
bundle-pubkey: bundle.pub
fail-on: 'kev&fixable,cvss>=9'
format: sarif
out: deprisk.sarif| Code | Meaning |
|---|---|
| 0 | Success, policy satisfied |
| 1 | Policy gate failed (for example, reachable finding above threshold) |
| 2 | Plan verification failed |
| 3 | Integrity failure: audit log tampering, a signed OpenVEX document that does not verify, or a bundled analyzer whose SHA-256 does not match the embedded checksum |
| 4 | Input or configuration error |
| 5 | Internal error |
Ordinary dependency graphs use pairwise edges: A depends on B. Real constraints often involve several packages at once (a framework family that must share a version line, a plugin set that must match a host). DepRisk models these as hyperedges.
Let P be the set of packages and V_p the candidate versions of package p. A configuration picks exactly one version per package. A hyperedge e = (S_e, C_e) has a scope S_e β P and a set of allowed joint assignments C_e. A configuration is consistent iff every hyperedge's scope assignment lies in C_e.
For each advisory, DepRisk resolves a symbol set (functions, methods, or modules that carry the flaw) from, in priority order:
- explicit symbol data in the advisory (for example OSV ecosystem-specific fields),
- a curated symbol map shipped in the data bundle,
- symbols mined from the upstream fix commit (functions changed by the patch).
A Rust analyzer builds a conservative call graph from your declared entrypoints and checks whether any path reaches the symbol set. Dynamic features (reflection, dynamic dispatch, eval-like constructs) add possible edges marked as such. Output is one of:
reachable (path found) Β· possibly-reachable (path needs dynamic edges) Β· unreachable (no path in the over-approximated graph) Β· unknown (no symbol data, or unsupported construct)
unknown is deliberately not treated as safe.
For finding v, risk is the product of three uncertain quantities:
R_v = Reach_v Γ Exploit_v Γ Impact_v
Reach_v ~ Beta(Ξ±, Ξ²)where parameters depend on the reachability label and analyzer precision, calibrated on the benchmark.Exploit_vis derived from EPSS and KEV membership, modeled as a calibrated Beta to represent forecast uncertainty.Impact_vcomes from your asset-criticality policy (deprisk.toml), with optional ranges.
DepRisk samples these (seeded Monte Carlo) and reports quantiles (p50, p95) rather than a single number. This is what lets a "probably fine but catastrophic if wrong" finding outrank a "probably fine and mild" one.
Decision variables: x_{p,v} β {0,1} (package p ends at version v).
minimize E[ Ξ£_v (1 β fixed_v(x)) Β· R_v ] + Ξ» Β· CVaR_Ξ±( Ξ£_v (1 β fixed_v(x)) Β· R_v )
subject to Ξ£_v x_{p,v} = 1 for every package p (one version each)
hyperedge constraints C_e for every hyperedge e (consistency)
Ξ£_{p,v} cost(p, v0βv) Β· x_{p,v} β€ B (effort budget)
policy constraints (pins, no-major, license allow-list)
costestimates effort from semver distance and, when API-diff data is available, from whether your code uses the changed API (a breaking change you never touch is cheap).- CVaR is linearized with the RockafellarβUryasev formulation over Monte Carlo scenarios, so the whole problem is a mixed-integer linear program solvable with open-source solvers (default: CBC/HiGHS).
- Setting
--risk-aversion 0recovers pure expected-risk minimization.
apply edits manifests/lockfiles only after the kernel accepts the plan, creates a branch, and (optionally) runs your configured build and test command in a sandbox before proposing a PR. Failed validation rolls back and is logged.
Every core component in the diagram below is built and tested (ingest and hypergraph, Rust reachability analyzer, Monte Carlo risk model, MILP+CVaR optimizer, Ada/SPARK verification kernel, DSSE-signed offline bundles, local store under .deprisk/store/, and signed audit log); only the optional local-LLM narrative explainer and SQLite/PostgreSQL team-store backends remain post-v1.0 roadmap items.
flowchart LR
subgraph Inputs
L[Lockfiles / SBOM]
S[Source code]
D[Signed data bundle<br/>OSV Β· EPSS Β· KEV Β· symbol maps]
end
subgraph Core["DepRisk CLI (C# / .NET)"]
I[Ingest + Hypergraph builder]
R[Risk model<br/>Monte Carlo]
O[Optimizer<br/>MILP + CVaR]
A[Apply + Policy + CI]
X[Explain<br/>optional local LLM]
end
RA[(Reachability analyzer<br/>Rust)]
K[(Verification kernel<br/>Ada/SPARK)]
AL[(Audit log<br/>hash chain + ECDSA P-256)]
ST[(Local store<br/>SQLite)]
L --> I
D --> I
S --> RA
I --> RA
RA --> R
I --> R
R --> O
O -->|plan.json| K
K -->|accepted plan| A
R --> X
I --> ST
Core --> AL
K --> AL
Design decisions
| Decision | Rationale |
|---|---|
| CLI-first, no server | Zero setup, easy to script, easy to run in CI and air-gapped hosts. |
| C# core | Fast to evolve; strong typing for the model and optimizer glue. |
| Rust analyzer | Performance and memory safety for parsing untrusted source at scale. |
| SPARK kernel | Small trusted base with machine-checked proofs; keeps the optimizer out of the trust boundary. |
| Local store | Plain files under .deprisk/store/ (ILocalStore / FileLocalStore, ADR 0036); zero database setup. SQLite/PostgreSQL backends for team mode remain on the post-v1.0 roadmap. |
| No code execution of scanned projects | Static analysis only. apply --write updates manifest files only after independent plan verification (with automatic rollback on I/O error). |
Repository layout
deprisk/
βββ action.yml # Official composite GitHub Action wrapper (ADR 0048)
βββ src/
β βββ DepRisk.Cli/ # commands, option parsing, output formats (SARIF, JSON, DOT, OpenVEX)
β βββ DepRisk.Core/ # hypergraph, risk model, policy, MILP+CVaR optimizer, PlanVerifier, kernel encoder
β βββ DepRisk.Audit/ # hash-chained ECDSA audit log, DSSE signing, offline bundles
β βββ DepRisk.Data/ # advisory ingestion, scanning, catalog builder, analyzer/optimizer/kernel runners
βββ analyzers/
β βββ reach/ # Rust reachability analyzer (C#, JS/TS)
βββ kernel/
β βββ spark/ # Formally verified Ada/SPARK plan checker (P1βP6, GNATprove)
βββ data/
β βββ symbols/ # Starter real-world NuGet & npm symbol maps (complete: false)
βββ schemas/ # 21 frozen v1 JSON Schemas (21/21 validated in CI)
βββ scripts/ # Reproducible real-world validation scripts (.ps1 / .sh)
βββ build/ # packaging and bundled-checksum verification scripts
βββ docs/
β βββ adr/ # 59 architecture decision records (ADR 0001β0059)
β βββ stability.md # v1.0 stability & compatibility contract
β βββ real-world-validation.md # end-to-end validation protocol for real repositories
β βββ method.md # full mathematical specification
β βββ roadmap.md # release history and post-v1.0 items
β βββ symbol-maps.md, benchmarks.md, audit-log.md, threat-model.md
βββ tests/ # 1950+ unit, hardening, oracle, and CLI tests + fixtures
βββ .github/ # CI workflows (build/test, Rust, Ada/SPARK GNATprove, 21 schemas, Action)
The optimizer (MILP + sampling) is complex and floating-point heavy, so it is not trusted. Instead, deprisk verify runs a small kernel written in Ada/SPARK and proven with GNATprove.
The kernel takes the hypergraph, the current configuration, the plan, and the budget as input. If it returns ACCEPT, the following are proven properties of the code:
| Property | Meaning |
|---|---|
| P1: Uniqueness | Every package ends with exactly one version. |
| P2: Consistency | Every hyperedge constraint is satisfied by the resulting configuration. |
| P3: Budget | Total plan cost does not exceed the budget. |
| P4: Policy | Pins, no-major rules, and allow-lists are respected. |
| P5: Fix claims | Every advisory the plan claims to fix is actually outside its affected range after the plan. |
| P6: Absence of runtime errors | No overflow, out-of-bounds, or uninitialized reads (SPARK AoRTE). |
Design choices that keep the proofs tractable: scaled-integer arithmetic (no floating point in the kernel), bounded collections, and a deliberately small integer-only input format (kernel-input.v1, ADR 0044). Proof status is reproducible locally and enforced in CI (spark-kernel job) with:
cd kernel/spark
alr -n build
alr -n exec -- gnatprove -P deprisk_kernel.gpr --mode=prove --level=2 --warnings=errorThe CI pipeline fails if any verification condition is unproven.
What is not proven: that the plan is optimal (that is the optimizer's job and is evaluated empirically), or that reachability labels are correct (see limitations).
Every command that reads sensitive state or changes something writes an entry:
| Field | Content |
|---|---|
seq, timestamp |
Monotonic sequence number and UTC time |
actor, host, cwd |
OS user, machine, working directory |
git_commit |
Repository state at the time |
command, args |
What was run |
inputs_digest, outputs_digest |
SHA-256 over inputs and results |
changes |
Structured diff, from β to (for example lib-a 2.3.1 β 2.5.0) |
prev_hash |
Hash of the previous entry |
signature |
ECDSA (P-256, SHA-256) signature over the entry, Base64 |
Entries form a hash chain, and the format is specified precisely in docs/audit-log.md (RFC 8785 canonical JSON), so anyone can re-implement verification. Anyone with the public key can run:
deprisk audit verify --pubkey auditor.pubEditing, deleting, inserting, or reordering entries is detected. A log alone cannot show that entries were cut off its end, so pin the head: store the head: hash that audit verify prints somewhere you trust (a ticket, a signed release, another machine) and check it later with deprisk audit verify --head <hash>. Keys are generated locally by init; the private key stays in .deprisk/audit.key (owner-only permissions where the OS supports it, excluded from Git by .deprisk/.gitignore). To protect it further, deprisk init --encrypt encrypts it with a passphrase (DEPRISK_KEY_PASSPHRASE, or a file named by DEPRISK_KEY_PASSPHRASE_FILE; in CI, a masked secret), and --key-file keeps it outside the project (set DEPRISK_KEY_FILE to find it later). An existing key is encrypted with OpenSSL (docs/audit-log.md). audit verify reads the log in blocks, so a large log needs no more memory than a small one. Merkle checkpoints and a transparency-log style workflow are on the roadmap.
DepRisk makes no network calls during any command (scan, graph, match, reach, symbols, rank, explain, vex, catalog, plan, verify, apply, ci, bench, bundle, or audit). Fresh data enters isolated environments through DSSE-signed offline bundles (ECDSA P-256 + per-file SHA-256 verification before a single byte is extracted, ADR 0047):
# On a connected machine: package and sign all feeds into one tamper-evident archive
deprisk bundle create --key release.key --out deprisk-bundle.zip \
--advisories NuGet.zip --epss epss.csv.gz --kev kev.json --symbols data/symbols/
# Transfer via approved media, then verify and unpack on the isolated machine
deprisk bundle verify deprisk-bundle.zip --pubkey release.pub
deprisk bundle import deprisk-bundle.zip --pubkey release.pub --dest ./offline-dataBundles are timestamped and tamper-evident (any modified file, wrong key, zip-slip attempt, or unsigned extra entry fails with exit code 3). Combined with --max-data-age <days> (or [policy] data_freshness_days in deprisk.toml), DepRisk also enforces data freshness offline. No telemetry is collected, ever.
deprisk ci runs the whole analysis (scan, match, rank) and then evaluates a policy gate. It is non-interactive, deterministic, offline (you supply the data files), writes SARIF for code-scanning platforms, and returns the documented exit codes: 0 the gate passed (or no gate was set), 1 the gate failed, 4 bad input (including an invalid --fail-on).
Clauses separated by , (any clause may fail the gate); each clause is terms joined by & (all must hold for the same finding).
| Term | Holds when |
|---|---|
any |
there is any finding |
kev |
the finding is listed in the CISA KEV catalog |
ransomware |
it is in KEV with known ransomware use |
direct |
the vulnerable package is a direct dependency somewhere |
fixable |
the advisory lists a fixed version above the installed one |
cvss>=N, cvss>N |
the CVSS base score (v3.x or v4.0, 0 to 10; the highest published one) compares so |
epss>=P, epss>P |
the EPSS probability (0 to 1) compares so |
severity>=LEVEL |
the database rating is at least low, moderate (or medium), high, critical |
reachable |
the reachability verdict is reachable (needs --symbols) |
possibly-reachable |
the verdict is possibly-reachable (needs --symbols) |
reach-unknown |
the verdict is unknown (needs --symbols) |
unreachable |
the verdict is unreachable (needs --symbols) |
not-unreachable |
the verdict is anything but unreachable: reachable, possibly-reachable, or unknown. The safe way to gate: only what is proven unreachable is let through (needs --symbols) |
risk-mean>=N, risk-p50>=N, risk-p90>=N, risk-p95>=N, risk-cvar95>=N |
Monte Carlo risk statistic compares so (also >). Strictly requires --model risk and a calibrated --risk-params <file>; refused with exit code 4 on uncalibrated placeholder defaults (ADR 0049) |
A term about a signal that is not available for a finding is false for it (never "zero"). Examples: kev Β· kev&fixable,cvss>=9 Β· direct&severity>=high Β· kev&fixable,cvss>=9¬-unreachable Β· risk-cvar95>=0.5. The reachability terms need --symbols (and the analyzer); without it the command stops with an input error instead of letting them silently match nothing, and a finding that was not analyzed matches none of them. Reachability never changes the order of rank; it is shown and can be used in the gate.
error if the finding is in KEV, or its CVSS rating (else the database rating) is critical or high; warning for medium or moderate and for unknown ratings; note for low. Rules carry GitHub's security-severity (the CVSS base score) when known. Results point at the project files that use the package.
Use the official composite GitHub Action (action.yml, ADR 0048) with either direct feeds or a DSSE-signed offline bundle:
# .github/workflows/deprisk.yml
name: deprisk
on: [pull_request]
permissions:
contents: read
security-events: write # to upload SARIF
jobs:
deprisk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x
- run: dotnet restore # deprisk reads obj/project.assets.json
- name: DepRisk gate (official Action)
uses: codeoops-dev/DepRisk@v1.6.0
with:
version: 1.6.0
bundle: offline-bundle.zip
bundle-pubkey: release.pub
fail-on: 'kev&fixable,cvss>=9'
format: sarif
out: deprisk.sarif
- uses: github/codeql-action/upload-sarif@v3
if: always() # upload findings even when the gate fails
with:
sarif_file: deprisk.sarifThe advisory, EPSS, and KEV files (or signed bundle) are supplied by your workflow; DepRisk itself never downloads anything. Their digests and published dates are recorded in the output.
All analysis and planning commands (scan, graph, match, rank, ci, reach, explain, vex, symbols, plan, verify, apply) read ./deprisk.toml when present (--config <file> to choose another file, --no-config to ignore it; CLI options always override, and deprisk doctor validates it; ADR 0035, ADR 0040). It is a strict subset of TOML parsed by DepRisk itself (zero dependencies; any unknown key is an error, exit code 4). For security reasons, executable paths (--analyzer, --optimizer, --kernel, --git), signing keys (--key), and output paths (--out) cannot be set in deprisk.toml.
Complete deprisk.toml (1.6.0):
[project]
ecosystem = "nuget" # auto | nuget | npm | pypi | cargo | go | maven | composer
strict = false
[data]
advisories = "data/NuGet.zip"
epss = "data/epss.csv.gz"
kev = "data/kev.json"
symbols = "data/symbols/"
[reach]
source = "src"
entrypoints_mode = "auto" # auto | public-api | none
entrypoints = ["MyApp.Program.Main"]
timeout_seconds = 300
[risk]
model = "baseline" # baseline | risk
samples = 5000
seed = 42
rank_by = "mean" # mean | p50 | p90 | p95 | cvar95
params = "data/risk-params.json"
[policy]
fail_on = "kev&fixable,cvss>=9"
symbols_fail_on = "missing,incomplete"
only_new = false
data_freshness_days = 14
license_allow = ["MIT", "Apache-2.0", "BSD-3-Clause"]
[plan]
budget = "6h"
solver = "milp" # greedy | milp
catalog = "data/catalog.json"
pin = ["lib-x"]
no_major = ["lib-y"]
[vex]
product = "pkg:nuget/MyApp@1.0.0"
author = "Example Corp"
role = "vendor"Claims should be falsifiable. DepRisk ships its own evaluation harness.
Baselines compared
| Baseline | Description |
|---|---|
| B1 | CVSS-only ordering |
| B2 | CVSS + EPSS/KEV |
| B3 | Reachable-only filtering (no uncertainty, no optimization) |
| B4 | "Upgrade everything to latest" |
| DepRisk | Full pipeline |
Metrics
| Metric | What it tells you |
|---|---|
| Residual expected risk vs. effort (Pareto curve) | Quality of prioritization under a budget |
| Alert reduction with no missed known-exploited findings | Noise removed without losing real risk |
| Reachability precision/recall on labeled cases | Analyzer quality |
| Post-plan build/test pass rate | Whether "safe" remediation is actually safe |
| Plan verification time | Practical cost of formal checking |
| Calibration of risk quantiles | Whether stated uncertainty is honest |
Reproduce
deprisk bench --cases <manifest.json> # the comparison on a labeled dataset (exists today)
deprisk bench calibrate --cases <manifest.json> --out risk-params.json # fit the Reach factor on the dev split (exists today)(Planned) A one-command suite (make bench, deprisk bench --suite quick) over datasets pinned by commit hash with ground-truth manifests (known-exploited advisories, historical fix commits), with results in benchmarks/results/ as machine-readable files plus generated plots. No such dataset exists yet. No result is reported unless it can be regenerated by these commands.
Format, scripts, and reading guide: docs/benchmarks.md, benchmarks/README.md, and paper/README.md. B3 is run in two forms: naive (keep only findings called reachable) and conservative (drop only those called unreachable), so the comparison is fair; B4 and the Pareto and post-plan metrics wait for the planner and the kernel, and every result lists them as not evaluated.
Results: not yet generated. The harness exists and is tested on a synthetic dataset whose numbers are not evidence. This section will be filled from
benchmarks/results/when a real dataset has been run.
DepRisk analyzes untrusted code and handles security-relevant decisions, so its own limits are stated plainly.
Security posture
- Static analysis only; scanned projects are never executed by
scan,graph,match,reach,rank,explain,vex,plan,verify, orapply. - Parsers run in the memory-safe analyzer process;
apply --validate(planned) will run project commands only inside a sandbox you configure. - Data bundles are DSSE-signed (ECDSA P-256) and verified (signature + per-file SHA-256 + path safety) before a single byte is extracted (
deprisk bundle verify|import, exit code 3 on any tamper or extra file, ADR 0047). - No telemetry, no phone-home.
- See
docs/threat-model.mdfor assets, adversaries, and mitigations, anddocs/security-assurance.mdfor the machine-verifiable threat-to-proof traceability matrix (unshare -n, static API ban, canary zero-leakage, red-team, fuzzing, and GNATprove P1βP6).
Known limitations
| Limitation | Effect | Handling |
|---|---|---|
| Reflection, dynamic loading, eval-like code | Call graph may miss or over-approximate paths | Marked possibly-reachable/unknown, never silently "safe" |
| Missing symbol data for an advisory | Cannot decide reachability | Labeled unknown; counted as risk |
| EPSS/KEV are forecasts and incomplete | Exploit probability is uncertain | Modeled as distributions |
| Effort/cost estimates are heuristic | Plans may over/under-budget | Budget is a model input; calibrate with deprisk bench |
| Ecosystem coverage | Initial release covers a subset | See Feature status |
| Kernel proves consistency, not optimality | A verified plan may be suboptimal | Optimality evaluated empirically |
Found a security issue in DepRisk itself? See SECURITY.md for private disclosure.
Legend: β implemented (built, tested, behaves as documented) Β· π§ͺ experimental (built and tested; accuracy or calibration not yet measured on real data) Β· π§ in progress (code unfinished) Β· πΊοΈ planned
| Area | Feature | Status |
|---|---|---|
| Ingest | NuGet restore graph (project.assets.json) via deprisk scan |
β |
| Ingest | NuGet lockfiles (packages.lock.json, versions 1 to 3) via deprisk scan |
β |
| Ingest | npm lockfiles (package-lock.json, lockfileVersion 2 and 3, workspaces, aliases) via deprisk scan; rank and ci work for npm too |
β |
| Ingest | npm lockfileVersion 1 (read with the package.json beside it) |
β |
| Ingest | Modern frontend lockfiles: pnpm (pnpm-lock.yaml v6/v9) and Yarn (yarn.lock Classic v1 and Berry v2+) under Ecosystem.Npm with full JS/TS reach, graph, vex, and ci support (ADR 0058) |
β |
| Ingest | CycloneDX 1.2 to 1.7 and SPDX 2.2/2.3 SBOM (JSON; NuGet, npm, PyPI, Cargo, Go, Maven, and Composer components with a package URL) | β |
| Ingest | Python / PyPI lockfiles (uv.lock, poetry.lock, pinned requirements.txt), PEP 503 package normalization, PEP 440 versions & specifiers, OSV PyPI matching, and graph support (ADR 0053) |
β |
| Ingest | Rust / Cargo (Cargo.lock, OSV crates.io) and Go (go.mod, OSV Go) lockfile/module ingest, graph support, and pkg:cargo/pkg:golang SBOM & OpenVEX (ADR 0054) |
β |
| Ingest | Java / Maven (pom.xml XXE-hardened, gradle.lockfile, OSV Maven) and PHP / Composer (composer.lock, OSV Packagist) ingest, graph, and pkg:maven/pkg:composer SBOM & OpenVEX (ADR 0059) |
β |
| Match | Advisory matching: OSV records (dir, .zip, .json) across all 7 ecosystems (NuGet, npm, PyPI, Cargo, Go, Maven, Packagist), offline, via deprisk match |
β |
| Rank | Baseline ranking (KEV, EPSS, CVSS v3.x and v4.0 base score; no reachability or uncertainty) via deprisk rank |
β |
| Rank | CVSS v4.0 base scoring (checked against FIRST's reference calculator on all 104,976 base vectors) | β |
| Model | Dependency hypergraph of the resolved graph across all 7 ecosystems, requirement checks, DOT/JSON/Markdown (Mermaid)/HTML (interactive clickable SVG) export via deprisk graph (ADR 0066) |
β |
| Model | Hypergraph with candidate versions and allowed dependency tuples (offline catalog pruning + MILP/CVaR constraints + SPARK kernel bitmask rules, ADR 0039, ADR 0043, ADR 0045) | β |
| Analysis | Reachability analyzer (analyzers/reach: standalone Rust process with #![forbid(unsafe_code)], conservative call graph, labels reachable / possibly-reachable / unreachable / unknown) for all 7 languages: C#, JavaScript/TypeScript, Python, Java, Rust (tree-sitter-rust), Go (tree-sitter-go), and PHP (tree-sitter-php) (ADR 0012, ADR 0019, ADR 0061, ADR 0065); bundled with the NuGet package for 7 platforms (ADR 0022, ADR 0033) |
β |
| Analysis | deprisk reach and reachability labels in rank, ci, explain, vex, and deprisk mcp across all 7 ecosystems (NuGet, npm/pnpm/Yarn, PyPI, Maven, Cargo, Go, Composer), shipping with starter maps (data/symbols/*-starter.json) and a 44-CVE curated 7-language symbol pack (data/symbols/curated/, ADR 0013, ADR 0020, ADR 0061, ADR 0062, ADR 0065). Field-validated across 5 live open-source ecosystems (docs/validation-results/README.md) |
β |
| Analysis | Guards: an answer is never unreachable for a symbol list that is not declared complete (ADR 0023), and an analyzer answer whose label, reason, symbol, and call path contradict each other is refused (ADR 0026, ADR 0037) |
β |
| Analysis | deprisk symbols template (worklist and draft entries, refused until filled in; no symbols are proposed) and deprisk symbols check (do the maps still fit the project, optional --fail-on gate); ADR 0024, ADR 0025 |
β |
| Analysis | Symbol mining from fix commits (deprisk symbols mine --repo <dir> --commit <rev>, offline, hardened git, supports csharp|javascript|python|java, drafts keep complete: null, ADR 0038, ADR 0061) |
β |
| Risk | Uncertainty model: rank --model risk gives each finding a risk distribution (seeded Monte Carlo over Reach x Exploit x Impact; mean, p50, p90, p95, cvar95) next to its baseline rank. Built-in parameters remain uncalibrated placeholders until fitted on a real longitudinal ("synthetic": false) dataset |
π§ͺ |
| Eval | deprisk bench and bench calibrate: labeled-case benchmark harness with baselines B1/B2/B3, held-out split, temporal leakage guard, reachability against ground truth, and Beta posterior calibration (ADR 0017, ADR 0018). Ships a reproducible 4-language curated corpus (benchmarks/datasets/v1.5-curated/) with untouched outputs committed under benchmarks/results/ ("synthetic": true, ADR 0062) |
β |
| Plan | Offline candidate version catalog (catalog.v1, deprisk catalog build|check, deterministic candidate pruning, ADR 0039) |
β |
| Plan | Effort cost model (integer minutes, uncalibrated defaults), plan.v1 schema, and [plan] policy config in deprisk.toml (ADR 0040) |
β |
| Plan | Optimizer protocol (optimize-request.v1 / optimize-result.v1), solver-free greedy baseline, and independent P1βP5 plan verifier (ADR 0041) |
β |
| Plan | deprisk plan (with P1βP5 verification, exit 2 on failure) and deprisk apply --dry-run (read-only manifest preview, ADR 0042) |
β |
| Plan | Exact MILP + CVaR remediation objective (--solver milp, CPLEX LP writer for HiGHS/CBC, and untrusted --solver external --optimizer <exe> process runner with mandatory P1βP5 verification, ADR 0043) |
β |
| Verify | Formally verified Ada/SPARK plan verification kernel (kernel/spark/, P1βP6 proven by GNATprove in CI) and deprisk verify <plan> (--kernel <exe> or C# reference verifier, ADR 0044β0046) |
β |
| Config | deprisk.toml (strict TOML subset parsed by DepRisk itself; [project], [data], [reach], [risk], [policy], [vex]; CLI overrides; validated by doctor, ADR 0035) |
β |
| Store | Local store under .deprisk/store/ (ILocalStore / FileLocalStore), gate on new findings only (ci --save-baseline, --only-new), and data freshness policy (--max-data-age, [policy] data_freshness_days, ADR 0036) |
β |
| Audit | Hash-chained signed log, init, audit verify (head pinning included) |
β |
| Audit | Passphrase-protected audit key (init --encrypt, environment variable or file, interoperable with OpenSSL); streaming verification of large logs |
β |
| Audit | Merkle checkpoints and external anchoring (post-v1.0 / Later) | πΊοΈ |
| Offline | Signed offline data bundles (deprisk bundle create|verify|import, DSSE ECDSA P-256 manifest + SHA-256 verification before extraction, ADR 0047) |
β |
| Offline | Zero-network & zero-exfiltration proof gate: static API/subprocess/zero-NuGet ban tests + kernel-level Linux unshare -n CI proof across all 34 CLI commands including deprisk mcp, license, and HTML/MD reports (ADR 0055, ADR 0060, ADR 0063, ADR 0064) |
β |
| Offline | Secret zero-leakage canary suite + malicious-repo red-team tests (config smuggling, JSON depth bombs, zip-slip, symlink escape, ANSI/CRLF injection, ADR 0056) | β |
| Distribution | Supply-chain & memory-safety gate: Rust #![forbid(unsafe_code)], cargo audit, Rust & Ada/SPARK adversarial fuzzing, and deterministic CycloneDX 1.5 Self-SBOM on every release (ADR 0057) |
β |
| Output | SARIF 2.1.0, JSON, self-contained offline HTML (--format html, CSP default-src 'none') with clickable inline <svg> dependency/call graphs, Β±3-line code snippets, opt-in --vscode-links, and GitHub PR Markdown (--format md with Mermaid flowchart LR + action.yml step-summary: true) across graph, rank, ci, plan, explain, and license (ADR 0063, ADR 0066) |
β |
| License | Offline SPDX license inventory and policy gate (deprisk license, ci --fail-on license-denied,license-unknown, [policy] license_allow/license_deny, and read-only deprisk_license MCP tool, ADR 0064) |
β |
| Output | OpenVEX 0.2.0 export via deprisk vex (not_affected only under strict conditions, ADR 0016), checked in CI against the official OpenVEX JSON schema; signed as a DSSE envelope with an in-toto statement and verifiable with deprisk vex verify (ADR 0021). A statement is only as sound as the reachability verdict under it |
β |
| Output | deprisk explain: evidence, reachability path, risk, and what would change it, as text or JSON (every sentence from a fixed template) |
β |
| Output | Optional local-LLM narrative (post-v1.0 / Later) | πΊοΈ |
| CI | deprisk ci + policy gate (kev, ransomware, direct, fixable, cvss, epss, severity) |
β |
| CI | Reachability terms in the policy gate (reachable, possibly-reachable, reach-unknown, unreachable, not-unreachable) |
β |
| CI | Risk quantiles as gate terms (risk-mean>=, risk-p50>=, risk-p90>=, risk-p95>=, risk-cvar95>=; strictly requires --model risk and a calibrated --risk-params <file>, ADR 0049) |
β |
| CI | GitHub Action wrapper (action.yml, supports direct feeds or DSSE-signed offline bundles, SARIF output, and exit-code propagation, ADR 0048) |
β |
| Distribution | A pinned Rust toolchain for every build of the analyzer (analyzers/reach/rust-toolchain.toml, installed by every workflow, ADR 0031) |
β |
| Distribution | Analyzers for linux-musl-x64 (static, started in an Alpine container in CI) and win-arm64 (ADR 0033) | β |
| Distribution | Run-time SHA-256 checksum of the bundled analyzer embedded in deprisk.dll at pack time and checked before every run (exit code 3 on mismatch; --analyzer exempt, ADR 0034) |
β |
| Distribution | Automated GitHub Releases on v* tags (auto-generated notes, .nupkg + SHA256SUMS, build provenance) and zero-telemetry public download metrics workflow (ADR 0050) |
β |
| Distribution | Standalone self-contained native archives (linux-x64, osx-arm64, win-x64, no .NET required) with bundled deprisk-reach (+ GNATprove-verified deprisk-kernel on Linux), SHA256SUMS, and build provenance (ADR 0051) |
β |
| Distribution | Official multi-stage non-root Docker image on GHCR (ghcr.io/codeoops-dev/deprisk, linux/amd64) bundling deprisk, deprisk-reach, and deprisk-kernel with OCI provenance attestation (ADR 0052) |
β |
| CLI | Per-command deprisk <command> --help / -h / help <command> across all 21 commands (ADR 0067), doctor --format json, and custom key location for init (--key-file, DEPRISK_KEY_FILE) |
β |
| AI Agents | Offline, read-only MCP stdio server (deprisk mcp, JSON-RPC 2.0, in-process, zero network) + universal Agent Skill (skills/deprisk/SKILL.md) and integration guide (docs/ai-agents.md) (ADR 0060) |
β |
(Update this table as features land; it is the source of truth for what works today. β
means the feature does what its documentation says; it does not mean the numbers it produces have been validated. Where they have not been, the row is π§ͺ, and no accuracy figure appears anywhere in this README until a benchmark on real data has produced one. Shipped in 0.1.0-alpha.1: the rows that were β
then; 0.2.0-alpha.1 added reachability, uncertainty, explain, vex, symbols and bench; 0.2.0-alpha.2 completed v0.2 with lockfiles/SBOMs, CVSS v4.0, encrypted audit keys, 7 bundled platforms with run-time SHA-256 verification, deprisk.toml, local store + --only-new + --max-data-age, path consistency, and symbols mine; 0.3.0-alpha.1 completed v0.3 with offline candidate catalogs, integer-minute effort budgets, plan.v1, greedy + exact MILP/CVaR + external optimizer protocol, independent P1βP5 verification, plan, and apply --dry-run; 0.4.0-alpha.1 completed v0.4 with kernel-input.v1, the GNATprove-verified Ada/SPARK kernel (P1βP6), and deprisk verify; 0.5.0-alpha.1 completed v0.5 with DSSE-signed offline data bundles (deprisk bundle create|verify|import) and the official GitHub Action wrapper (action.yml); 1.0.0 freezes all 21 v1 schemas, exit codes 0..5, calibrated risk-quantile gates, verified apply --write with rollback, real-world validation kit (docs/real-world-validation.md), and stability guarantees (docs/stability.md); 1.1.0 adds automated GitHub Releases with SHA256SUMS and zero-telemetry metrics (ADR 0050), standalone self-contained binaries for Linux/macOS/Windows (ADR 0051), official non-root GHCR Docker image (ADR 0052), and recorded validation results (docs/validation-results/README.md); 1.2.0 adds Python/PyPI (uv.lock, poetry.lock, pinned requirements.txt, PEP 440/503, ADR 0053), Rust/Cargo (Cargo.lock, OSV crates.io) and Go (go.mod, OSV Go, ADR 0054), pkg:pypi/pkg:cargo/pkg:golang SBOM & OpenVEX, and the reproducible benchmark & paper evaluation kit (benchmarks/README.md, paper/README.md); 1.3.0 completes the deep security self-audit with static API/subprocess/zero-NuGet bans + Linux unshare -n offline CI proof (ADR 0055), secret zero-leakage canary & malicious-repo red-team suites (ADR 0056), Rust #![forbid(unsafe_code)] + cargo audit + Rust/SPARK adversarial fuzzing + CycloneDX 1.5 Self-SBOM (ADR 0057), and the threat-to-proof dossier (docs/security-assurance.md); 1.4.0 adds modern frontend lockfiles (pnpm-lock.yaml v6/v9, yarn.lock v1/Berry, ADR 0058), Java/Maven (pom.xml, gradle.lockfile) and PHP/Composer (composer.lock, ADR 0059), and native offline AI agent integration (deprisk mcp read-only stdio server + skills/deprisk/SKILL.md + docs/ai-agents.md, ADR 0060); 1.5.0 adds Python & Java static reachability (tree-sitter-python, tree-sitter-java, ADR 0061), a 32-CVE curated 4-language symbol pack and reproducible benchmark corpus (data/symbols/curated/, benchmarks/results/, ADR 0062), self-contained offline HTML & GitHub PR Markdown reports (--format html|md, action.yml step-summary: true, ADR 0063), and an offline SPDX license policy gate (deprisk license, license-denied/license-unknown, deprisk_license MCP tool, ADR 0064).)
- v0.1 CLI skeleton, NuGet + npm ingest, hypergraph, advisory matching, risk ranking (CVSS+EPSS+KEV baseline), audit log,
cipolicy gate, SARIF. First pre-release:0.1.0-alpha.1. - v0.2 (code-complete in
0.2.0-alpha.2) Reachability (C#, JS/TS), uncertainty model,explain, signed OpenVEX (DSSE, ADR 0021),bench,symbols template|check|mine, CVSS v4.0, CycloneDX/SPDX SBOMs,deprisk.toml, local store +--only-new+ freshness gate, encrypted audit key, and the analyzer bundled for seven platforms with run-time SHA-256 verification (ADR 0022, ADR 0033, ADR 0034). Still to do for the research milestone (published with v0.4): real symbol data for real advisories, a real labeled benchmark dataset, and calibration of the placeholder parameters (docs/roadmap.md). - v0.3 (code-complete) Offline candidate catalog (
catalog.v1), integer-minute effort model,plan.v1+[plan]config, optimizer protocol (optimize-request.v1/optimize-result.v1), greedy baseline + exact MILP/CVaR solver + external optimizer process runner, independent P1βP5 verification,planandapply --dry-run(ADR 0039β0043). - v0.4 (code-complete) Minimal integer-only kernel interchange (
kernel-input.v1/kernel-verdict.v1), formally verified Ada/SPARK kernel (kernel/spark/, P1βP6 proven by GNATprove in CI), anddeprisk verify <plan>(ADR 0044β0046). Still to do for the research milestone: real labeled benchmark dataset and calibration of placeholder parameters. - v0.5 (code-complete) DSSE-signed offline data bundles (
deprisk bundle create|verify|import, ADR 0047) and official GitHub Action wrapper (action.yml, ADR 0048). - v1.0 (released in
1.0.0) Stablev1schemas (21/21 CI-validated), frozen exit codes0..5(docs/stability.md), calibrated risk-quantile gates, verifiedapply --writewith rollback, hardening/oracle test suite, and real-world validation kit (docs/real-world-validation.md). - v1.1 (released in
1.1.0) Automated GitHub Releases, live badges, and zero-telemetry adoption metrics (ADR 0050); standalone self-contained binaries for Linux/macOS/Windows withSHA256SUMSand build provenance (Option B, ADR 0051); official multi-stage non-root GHCR Docker image with OCI provenance (Option C, ADR 0052); recorded validation results (docs/validation-results/README.md). - v1.2 (released in
1.2.0) Python / PyPI (uv.lock,poetry.lock, pinnedrequirements.txt, PEP 440/503, ADR 0053); Rust / Cargo (Cargo.lock, OSVcrates.io) and Go (go.mod, OSVGo, ADR 0054);pkg:pypi/pkg:cargo/pkg:golangSBOM & OpenVEX; reproducible benchmark & calibration scripts (benchmarks/README.md) and academic paper artifact guide (paper/README.md). - v1.3 (released in
1.3.0) Deep security self-audit: static network/process/zero-NuGet API ban + kernel-level Linuxunshare -noffline CI proof (ADR 0055); secret zero-leakage canary & malicious-repo red-team suites (ADR 0056); Rust#![forbid(unsafe_code)],cargo audit, Rust & Ada/SPARK adversarial fuzzing, and deterministic CycloneDX 1.5 Self-SBOM (ADR 0057); complete threat-to-proof dossier (docs/security-assurance.md). - v1.4 (released in
1.4.0) Modern frontend lockfiles (pnpm-lock.yamlv6/v9,yarn.lockv1/Berry, ADR 0058); Java/Maven (pom.xml,gradle.lockfile) and PHP/Composer (composer.lock, ADR 0059); native offline AI agent integration (deprisk mcpread-only stdio server + skills/deprisk/SKILL.md, ADR 0060). - v1.5 (released in
1.5.0) Python (tree-sitter-python) and Java (tree-sitter-java) conservative static reachability (ADR 0061); 32-CVE curated 4-language symbol pack (data/symbols/curated/) and reproducible 4-language benchmark & calibration corpus (benchmarks/results/, ADR 0062); self-contained offline HTML & GitHub PR Markdown reports (--format html|md,action.ymlstep-summary: true, ADR 0063); offline SPDX license policy gate (deprisk license,license-denied/license-unknown,deprisk_licenseMCP tool, ADR 0064). - v1.6 (released in
1.6.0) Live 5-ecosystem open-source field validation across 271,632 OSV advisories + FIRST EPSS + CISA KEV (docs/validation-results/README.md); complete 7/7 static reachability parity adding Rust, Go, and PHP (tree-sitter-rust/go/php, 44 curated symbols, ADR 0065); zero-CDN interactive inline<svg>& Mermaid visual graphs, boundedΒ±3-line code snippets, and opt-in--vscode-links(ADR 0066); per-commanddeprisk <command> --helpfor all 21 commands and redesigned NuGetPACKAGE.md(ADR 0067); deep v1.6.0 security re-audit and red-team gatesT39βT42(ADR 0068). - Later Longitudinal real-world labeled benchmark publication, PostgreSQL team mode, transparency-log checkpoints, richer API-diff-based cost model.
If you evaluate tooling for a security or platform team, here is what to check:
| You care about | What to look at |
|---|---|
| Noise reduction | deprisk bench alert-reduction metric and explain output for suppressed findings |
| Trust in automation | The proven kernel and its published properties (P1βP6) |
| Compliance and audit | Signed audit log, OpenVEX export, SARIF in your existing pipeline |
| Restricted networks | Air-gapped workflow and signed bundles |
| Data privacy | No telemetry, no source code leaves the machine |
| Adoption cost | Single CLI, no server or database to run, standard exit codes |
Pilot it in a day: run deprisk scan && deprisk reach && deprisk rank on one service (or use the reproducible harness in docs/real-world-validation.md with data/symbols/), compare the top 10 against your current process, and open an issue with what it got right or wrong. Negative results are valuable and will be credited.
Contributions are welcome, especially:
- ecosystem parsers and reachability support for new languages,
- curated vulnerable-symbol maps,
- benchmark datasets with ground truth,
- proof engineering and review of the SPARK kernel,
- real-world false-positive/false-negative reports.
See CONTRIBUTING.md and CODE_OF_CONDUCT.md. Please open an issue before large changes. Architecture decisions are recorded in docs/adr/.
DepRisk is developed alongside academic research on risk-aware, uncertainty-driven remediation of dependency vulnerabilities. Open research questions the project is designed to test:
- Does modeling uncertainty (and tail risk) produce better remediation plans than point-score ranking at equal effort?
- How much does hyperedge-aware consistency modeling reduce failed or inconsistent upgrades versus pairwise models?
- How well do symbols mined from fix commits approximate curated vulnerable-function data for reachability?
- What is the practical cost of verifying plans with a proven kernel?
If you use DepRisk in academic work, please cite it (see CITATION.cff). A preprint will be linked here when available.
Author: Jahed Kabiri, Tabriz, Iran. Issues and discussions on this repository are the best way to reach the project.
Apache License 2.0. See LICENSE.