Skip to content

Compress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.

ci(security): run cargo audit on every PR, re-enable PyPI attestations (#3858)

Tejas Chopra877f9ced230b
diff --git a/.cargo/audit.toml b/.cargo/audit.toml
index e8a321e36..39a32128e 100644
--- a/.cargo/audit.toml
+++ b/.cargo/audit.toml
@@ -3,10 +3,10 @@
# Path matters: cargo-audit reads `.cargo/audit.toml`, not a root-level
# `audit.toml`. A file at the repo root is silently ignored.
#
-# The `audit` job in .github/workflows/rust.yml is a BLOCKING gate. It runs on
-# every PR touching Rust and nightly on the schedule (the `rust-changes` job
-# reports `rust=true` for `schedule`/`workflow_dispatch`, so a newly-disclosed
-# advisory surfaces without anyone touching Rust code).
+# The `cargo-audit` job in .github/workflows/security.yml is a BLOCKING gate.
+# It runs on every PR and push to main whatever paths changed, and weekly on
+# that workflow's schedule, so a newly-disclosed advisory surfaces without
+# anyone touching Rust code.
#
# It was `continue-on-error: true` until the change that added this file, which meant it reported findings
# nobody saw: RUSTSEC-2026-0258 (h2, unbounded empty DATA frames) sat in a green
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ccf799ddc..a7e90bf77 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -789,7 +789,10 @@ jobs:
# recommended pattern for release workflows that may run
# multiple times against the same version.
skip-existing: true
- attestations: false
+ # PEP 740 attestations from this job's trusted-publishing identity
+ # (needs only `id-token: write`, granted above). Off since #2405 with
+ # no recorded root cause; if a release fails on them, revert this line.
+ attestations: true
publish-npm:
needs: [detect-version, build]
diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index bde3681ba..bd8c598c6 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -208,32 +208,10 @@ jobs:
name: wheels-${{ matrix.target }}
path: dist/*.whl
- audit:
- name: audit
- needs: rust-changes
- if: needs.rust-changes.outputs.rust == 'true'
- runs-on: ubuntu-latest
- timeout-minutes: 20
- steps:
- - uses: actions/checkout@v7
- - uses: dtolnay/rust-toolchain@stable
- with:
- toolchain: 1.95.0
- - uses: Swatinem/rust-cache@v2
- - name: Install cargo-audit + cargo-deny
- uses: taiki-e/install-action@v2
- with:
- tool: cargo-audit,cargo-deny
- # Blocking. Soft-failing this made it useless: RUSTSEC-2026-0258 (h2,
- # unbounded empty DATA frames -> unbounded memory or a panic) was
- # reported by this job for as long as it existed and never turned a run
- # red, so nobody acted on it. Accepted advisories go in audit.toml with
- # a written reason rather than being swallowed wholesale here.
- - name: cargo audit
- run: cargo audit
- - name: cargo deny check licenses
- continue-on-error: true
- run: cargo deny check licenses
+ # The Rust dependency advisory scan (`cargo audit`) moved to security.yml,
+ # where it runs on every PR and push regardless of which paths changed. Here
+ # it sat behind the `rust-changes` filter and this workflow's schedule, and
+ # that combination let three weeks pass with no scan at all.
# Blocking on every PR that touches Rust. Safe to harden now because the
# harness fails only on a Diff — `parity-run` sets `any_diffs` inside the
diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml
index 3db21f263..134012be6 100644
--- a/.github/workflows/security.yml
+++ b/.github/workflows/security.yml
@@ -55,6 +55,35 @@ jobs:
with:
inputs: requirements-prod.txt
+ # ---- SCA: Rust dependency advisories -----------------------------------
+ # `cargo audit` reads Cargo.lock only (no build, about a minute), so it runs
+ # unconditionally: every PR, every push to main, and the weekly schedule
+ # above. It used to live in rust.yml behind the `rust-changes` path filter;
+ # pushes that touched no Rust path reported it `skipped`, and rust.yml's own
+ # schedule stopped firing after 2026-09-08, so no advisory scan ran for three
+ # weeks. Blocking: an accepted advisory goes in .cargo/audit.toml with a
+ # written reason.
+ cargo-audit:
+ name: Rust advisories (cargo audit)
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v7
+
+ - name: Install cargo-audit + cargo-deny
+ uses: taiki-e/install-action@v2
+ with:
+ tool: cargo-audit,cargo-deny
+
+ - name: cargo audit (blocking; exceptions in .cargo/audit.toml)
+ run: cargo audit
+
+ # Licence allow-list from deny.toml. Advisory decisions stay with
+ # cargo-audit above, so there is one place that decides what is accepted.
+ - name: cargo deny check licenses
+ continue-on-error: true
+ run: cargo deny check licenses
+
# Audit every maintained npm lock, including development dependencies.
# Lockfile audits do not install packages or execute their lifecycle scripts.
npm-audit: