cargo-deny
$ cargo-deny Community Low RiskCargo subcommand plugin (cargo deny) that audits Cargo.lock and dependency graphs for security advisories, SPDX license compliance, banned crates, and untrusted registries. Supports structured --format json diagnostics and --offline mode for deterministic headless CI and agent checks.
brew install cargo-deny Evaluates local Cargo.lock and deny.toml policy directly against cached RustSec databases without MCP overhead.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Provides --format json, --color never, --offline, and distinct exit codes per check without any interactive prompts.
- Supports
--format jsonand--color neveroncargo deny check - Supports
--offlineand--lockedexecution
check is read-only against repository files and only writes deny.toml when init is explicitly invoked.
- Read-only policy verification by default
Available via Homebrew, cargo install, and prebuilt GitHub releases on macOS, Linux, and Windows.
- Prebuilt binaries plus
brewandcargodistribution
Combines vulnerability, license, duplicate-crate, and source checks in one fast Rust binary.
- Unifies advisory, license, and dependency-graph linting
Actively maintained by Embark Studios and widely used across Rust CI pipelines.
- Mature
EmbarkStudios/cargo-denyrepository
Well-structured mdBook manual and --help reference for every deny.toml field.
- Official documentation at embarkstudios.github.io/cargo-deny
Security, Auth & Guardrails
No authentication required; caches public advisory databases locally under ~/.cargo/advisory-dbs unless --offline is passed.
Dual MIT / Apache-2.0 open-source CLI; completely free.
# cargo-deny Agent Rules - Always run `cargo deny check --format json --color never` for parseable findings. - Pass `--offline` in air-gapped or sandboxed environments when the advisory cache is already populated.
Agent-Ready Command Recipes
Safe Read-Only Queries
cargo deny check --format json --color never
Runs all configured policy checks and emits newline-delimited JSON diagnostics without ANSI escapes.
cargo deny check licenses --offline --format json
Verifies crate SPDX licenses using only cached databases and Cargo.lock.
Controlled Writes & Previews
cargo deny init
Writes a starter deny.toml configuration file in the workspace root.
Strengths for Agents
- + Emits clean newline-delimited JSON diagnostics with
--format json. - + Zero-auth read-only
checkcommand covers advisories, licenses, bans, and sources together.
Caveats & Pitfalls
- ! Requires
deny.toml(orcargo deny init) for custom allow/deny rules and only targets Cargo workspaces.