Policy checks (2026-01-18)
Patinas uses small, fork-safe policy checks to prevent “silent drift” in critical dependency and security posture.
These checks are intentionally lightweight and designed to fail fast in CI.
Run locally
From patinas/ (the workspace root containing deny.toml, Cargo.toml, and tools/):
cd patinas
python3 tools/policy_check.py
Run a subset:
cd patinas
python3 tools/policy_check.py --deny
python3 tools/policy_check.py --features
python3 tools/policy_check.py --future-incompat
Output shape (what you’ll see)
The wrapper prints a consistent header per check and a short summary:
==> <check name>
OK|FAIL (<duration>): <check name>
==> Summary
OK: all selected policy checks passed
What is enforced
deny.toml ignore review policy (--deny)
Any RUSTSEC-....-.... ignore entry in deny.toml must have:
REVIEW(YYYY-MM-DD)in the inline commentowner=<name>in the inline comment- The review date must be >= today (expired ignores fail CI)
This prevents “forever ignores” from silently accumulating.
Feature policy / deps + critical crate features (--features)
For core deployable roles, we enforce that forbidden “ambient TLS stacks” do not appear in the resolved dependency graph:
native-tlstokio-native-tlsopensslopenssl-sys
This is enforced via a single cargo metadata graph walk, and failures print an explicit dependency path.
We also enforce feature-level guardrails on critical crates (because feature drift is where many long-term bugs come from):
reqwestmust use rustls features (rustls-tls*) and must not enablenative-tls/default-tls.
Future incompatibility report (--future-incompat)
Runs:
cargo check --workspace --future-incompat-report
This prevents “Rust 2024 / future edition” compatibility issues from accumulating unnoticed.
CI wiring
cargo-deny.yml: runspython3 patinas/tools/policy_check.py --denybeforecargo deny ...ci.yml:- runs
python3 tools/policy_check.py --featuresin fork-safe lanes - runs future-incompat checks via
cargo check ... --future-incompat-report(both curated and workspace-wide)
- runs
How to add a new policy check
- Step 1: implement a small, fork-safe script in
patinas/tools/(follow the style ofdeny_policy_check.pyandfeature_policy_check.py) - Step 2: add a new flag +
_run_step(...)entry inpatinas/tools/policy_check.py - Step 3: wire it into CI if it should be enforced on every PR