fix(verify): bind call summary to audit evidence - #586
Conversation
Signed-off-by: Athena Kanellatou <athenaknl2004@gmail.com>
Signed-off-by: Athena Kanellatou <athenaknl2004@gmail.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Reviewed at The verifier's derivation matches the producer's in Ran the checkbox you left unticked: Two things I checked that are fine. Empty Two findings, neither blocking.
Booleans satisfy the integer comparisons. A claim carrying Binding looks correct and each of the six fields has its own regression. |
|
Both addressed. The integer guard reads correctly, and pinning in the unit test rather than the fixture is the better call. Nothing further from me. |
|
Thanks for the thorough review and confirmation! |
imran-siddique
left a comment
There was a problem hiding this comment.
Reviewed at 46dee44. The verifier derives all six reconstructable fields with the same predicates and ordering as the runtime producer, rejects bool-as-int values, and the regression suite independently re-signs each contradictory claim so signature PASS / audit bundle FAIL is causal evidence. Empty bundles are already rejected before this block; no unresolved review threads remain; all six Linux/Windows CI matrix jobs, CodeQL, and governance passed. No blocking findings.
What
Bind the claim’s audit-derived call metadata to the supplied audit bundle during offline verification.
"verify_audit_bundle()" now re-derives the tool-call count, allowed/denied/faulted counts, and unique invoked tools from "tool_call" entries, then compares them with "trace.tool_transcript.call_count" and the five corresponding "gateway.call_summary" fields.
Why
A validly re-signed claim could previously carry call summaries that contradicted the separately supplied, correctly signed audit evidence while both signature and audit-bundle verification passed.
Closes #582.
Security impact
This strengthens audit-chain integrity by making contradictory call metadata a fatal audit-bundle verification failure, even when the modified claim has a valid signature. The verifier uses the same derivation semantics as the runtime producer:
Fields that cannot always be reconstructed from exported tool-call entries remain out of scope.
Test plan
Regression coverage independently mutates and re-signs each of the six bound fields, confirms claim signature verification still passes, and confirms audit-bundle verification fails with the corresponding mismatch.
DCO sign-off