Skip to content

fix(zk-tls): give each prover its own copy of the policy's rules and headers - #292

Merged
lolaaimar merged 1 commit into
fix/zk-tls-prover-error-textfrom
fix/zk-tls-prover-request-copy
Nov 25, 2026
Merged

lolaaimar merged 1 commit into
fix/zk-tls-prover-error-textfrom
fix/zk-tls-prover-request-copy

Conversation

@nicolasLuduena

@nicolasLuduena nicolasLuduena commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Part of #211, split out of #248. Stack: #291 → #292 → #293 → #294; merge in that order. Based on #291.

copyRequest gave each prover its own secretHeaders and context, but the rule arrays and publicHeaders were the client's own objects. A prover that edited them changed the policy for every later prove.

 copyRequest(request) = {
   ...request,
+  publicHeaders: copy,
   secretHeaders: copy,
   context: copy,
+  responseMatches: copy of each entry,
+  responseRedactions: copy of each entry,
 }

Values nested inside context are still shared; that is #236.

Evidence

  • Before: a prover that rewrote its responseMatches, responseRedactions and publicHeaders changed what the next prover received.
    After: this passes in pipeline.test.ts. One prover edits all three on two proveReq calls, and all six prover calls still see the original rules and headers:

    keeps the policy's rules and the caller's headers out of a prover's reach
    

Build, types, Biome and the full suite pass with the stack up to this PR: 769 passed, 4 skipped (the opt-in live checks).

No verification skill in this repo.

Merge Danger

Door: two-way

Blast Radius: none

A prover that relied on editing the policy through its request stops affecting later proves. Nothing in the repo does that.

@nicolasLuduena nicolasLuduena left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lolaaimar lolaaimar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@lolaaimar
lolaaimar merged commit 93e8679 into main Nov 25, 2026
2 checks passed
@lolaaimar
lolaaimar deleted the fix/zk-tls-prover-request-copy branch November 25, 2026 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants