Files
Dragan Spiridonov e5a7719aa7 feat(#569): add AQE_COVERAGE_NO_EXEC opt-out; broaden credential stripping (#568)
Closes the two security questions raised by the adversarial review that the
prosecutors never returned a ruling on, so I settled them with evidence.

1. Coverage measurement executes the analyzed repository.
   Collecting real coverage means running the project's own tests: the JS/TS path
   runs `npx vitest|jest|nyc` (pre-existing), and the Rust path added in this
   release runs `cargo llvm-cov`, which compiles and runs test binaries, executes
   `build.rs`, and honors any `runner`/linker directive in that repo's
   `.cargo/config.toml`. For a trusted project that is exactly what the caller
   wants; it is surprising for an operation that reads like a static query, and an
   agent can be pointed at an untrusted checkout.

   Execution stays the default — requiring opt-in would make measured coverage the
   exceptional case and estimation the norm, inverting ADR-126's whole point — but
   is now opt-out via `AQE_COVERAGE_NO_EXEC=1`, which disables ALL build-tool
   execution. Existing coverage reports are still parsed; everything else degrades
   to clearly-labelled static estimation with guidance explaining why.

   Verified end-to-end through the real MCP server with a fake `cargo` shim on
   PATH: switch off -> cargo invoked; switch on -> not invoked. The unit test
   includes the same control, so it cannot pass vacuously.

2. Credential stripping in agentOverrides was already complete, but under-reported.
   `sanitizeAgentOverrides` builds its result as an ALLOW-LIST, so any field that
   is not provider/model/temperature/maxTokens/priority never survives — apiKey,
   token, password and friends were all dropped already. Only the *warning* was
   apiKey-specific, so a user who pasted a token got no feedback. The warning now
   covers all credential-shaped keys, and a test asserts no warning ever echoes a
   secret value.

ADR-126 gains a section recording the execution decision and what was rejected
(opt-in-by-default, sandboxing), plus the requirement that future language
delegations honor the same switch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-23 10:35:11 +00:00
..