Skip to content

Add optional session/call_id cross-check in bilateral verification #4

@willamhou

Description

@willamhou

Context

The v1 Receipt.action includes optional session and call_id fields, and these are carried into the BilateralReceipt.agent_receipt. However, verify_bilateral() does not provide a way to assert that a bilateral receipt corresponds to a specific session or call.

A caller who expects a response for call_id=abc could receive a valid bilateral receipt for call_id=xyz without detection at the verification layer.

What needs to change

Rust (crates/signet-core/src/verify.rs):

  • Add optional expected_session and expected_call_id fields to BilateralVerifyOptions
  • If set, verify they match receipt.agent_receipt.action.session / call_id

Acceptance criteria

  • BilateralVerifyOptions gains optional expected_session and expected_call_id
  • Mismatches return Err(SignetError::InvalidReceipt(...))
  • Tests for match, mismatch, and unset (skip check)
  • Backward compatible

Difficulty

Beginner-friendly. Simple field comparison, similar pattern to trusted_agent_pubkey.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions