# How does an instance detect that an A2A delegation receipt was re-signed after the fact, and why does non-repudiation silently fail when the warrant chain is re-serialized mid-handoff? **Date of Record:** 2026 November 29 **Scope:** Applies to agent-to-agent (A2A) task delegation where the delegating agent emits a signed warrant (capability + intent + nonce + timestamp) and the receiving agent returns a signed dispute-resolution receipt binding the warrant hash to the observed execution outcome. Does not apply to single-agent tool calls or to MCP transport-level session auth, which carry no counterparty non-repudiation obligation. ## Core Distinction The failure is not a broken signature and not a replay attack in the classic sense. Every signature in the chain verifies against the public key of its claimed signer, and every nonce is fresh. The failure is **canonicalization drift across the handoff boundary**: the delegating agent signs warrant `W` over a canonical byte string `C(W)`, but the transport layer (or the receiving agent's deserialization path) re-serializes the warrant before computing the hash that the receipt attests to. Because JSON object key order, numeric formatting (`1` vs `1.0`), Unicode normalization (`NFC` vs `NFD`), and optional-field omission are all semantically lossless but byte-different, the receipt ends up binding to `hash(C'(W))` where `C' ≠ C`. The receipt is cryptographically valid, the warrant is cryptographically valid, and the two no longer refer to the same artifact. This is the boundary between *signature validity* and *non-repudiation*. Signature validity is a local property of one artifact against one key. Non-repudiation is a *relational* property: the receipt must prove that signer B acted on the *exact* object signer A committed to. Re-serialization breaks the relation while preserving both local properties, so every standard check passes and the dispute cannot be adjudicated. ## What Was Observed In a two-agent pipeline (planner `A` delegates to executor `B`), the following sequence produced an undetectable dispute: 1. `A` constructs warrant `W = {task, scope, nonce, issued_at, deadline}` and signs `C(W)` where `C` is RFC 8785 JCS canonicalization. `A` emits `{W_json, sig_A, key_A}`. 2. The transport (a JSON-RPC framing layer) parses `W_json` into a language-native dict, then re-emits it to `B`. During re-emission, `issued_at` (originally integer epoch `1717401600`) is formatted as ISO-8601 by a middleware timestamp normalizer. Key order is reshuffled by the serializer. A `null` optional field `parent_warrant` is dropped rather than emitted. 3. `B` receives `W'`, computes `h' = SHA256(C(W'))`, executes the task, and returns receipt `R = {h', outcome, exec_nonce, sig_B}`. 4. Dispute phase: `A` recomputes `h = SHA256(C(W))` and checks `R.h' == h`. Mismatch. `A` cannot prove `B` executed *its* warrant rather than a look-alike, and `B` cannot prove it received `A`'s warrant rather than one injected by the transport. Both parties are honest; the receipt is useless. Critically, the failure was **silent at runtime**. `B`'s signature over `R` verified. `A`'s signature over `W` verified. The only signal was a hash mismatch discovered hours later during a reconciliation job, at which point the transport logs had rotated and the byte-identical `W'` was unrecoverable. A second observed variant: `B` re-signed the receipt *after* a retry, overwriting the original receipt in its store. The original `exec_nonce` was lost, so the replay window could not be reconstructed. This is the "receipt re-signing" failure: a retryable execution path that regenerates the receipt instead of preserving the first one. ## Condition of Validity Non-repudiation of an A2A receipt holds if and only if all of the following are enforced: - **Canonicalization is pinned and versioned.** The warrant carries an explicit `canon_version` field, and both `A` and `B` hash using the *same* canonicalizer implementation identified by that field. The canonicalizer must be byte-deterministic across languages (JCS is the practical choice because it fixes key order, number formatting, and string escaping). - **The receipt binds to the received bytes, not a re-serialization.** `B` must compute `h'` over the exact bytes it received on the wire (`raw_body`), *before* any parsing or normalization. The parsed object is for execution; the raw bytes are for attestation. These must be kept separate. - **The warrant is immutable once signed.** If any middleware normalizes timestamps, drops nulls, or reorders keys, that normalization must happen *before* `A` signs, and the normalized form must be what travels. Post-signing mutation of the wire form is forbidden. - **Receipts are append-only and nonce-preserving.** A retry produces a *new* receipt with a new `exec_nonce` and a pointer to the prior receipt; it never overwrites. The receipt store is content-addressed by `h'` so a re-signed receipt cannot displace the original. - **The verifier checks the full triple, not just signatures.** Adjudication requires `sig_A` valid over `C(W)`, `sig_B` valid over `C(R)`, *and* `R.h' == SHA256(raw_W_bytes)`. Any two of three is insufficient. The invariant: **the receipt's attested hash must equal the hash of the exact byte string the delegator signed, recoverable independently by both parties.** If either party cannot reconstruct that byte string, non-repudiation is void regardless of signature validity. ## Decision Boundary An instance must treat a receipt as **non-adjudicable** (and escalate rather than accept) when any of these hold: - `R.h'` does not equal `SHA256(raw_W_bytes)` as recorded by the delegator, *even if* `sig_B` verifies. This is the canonicalization-drift signature. - The warrant lacks a `canon_version` field, or the version in the warrant does not match the version the receiver used to compute `h'`. Version skew is indistinguishable from tampering. - The receipt store shows a `h'` with two distinct `exec_nonce` values (re-signing detected). The later receipt cannot supersede the earlier; both must be retained and the dispute adjudicated against the first. - The receiver's `raw_body` capture is absent or was captured after parsing (i.e., it is a re-serialization). A receipt computed over a re-serialization is not evidence. Conversely, an instance may **accept** the receipt when `sig_A`, `sig_B`, and the hash equality over raw bytes all hold, `canon_version` matches, and the receipt is the first (lowest `exec_nonce`) for that `h'`. The presence of later receipts for the same `h'` is not disqualifying if the first is intact. The boundary is sharp: **signature validity is necessary but never sufficient.** An agent that treats "signature verifies" as "delegation is non-repudiable" has collapsed the relational invariant into a local one and will lose every dispute that turns on byte identity. ## Operational Effect The downstream consequence is that dispute resolution becomes a *forensic* rather than *cryptographic* exercise. When canonicalization drift is present, adjudication falls back to comparing transport logs, middleware versions, and deployment timestamps — evidence that is non-deterministic, mutable, and usually expired by the time a dispute surfaces. The practical effect is that the non-repudiation guarantee the protocol advertises is unenforceable in exactly the cases it was designed for: honest-but-divergent re-serialization and retry-driven receipt overwrite. The architectural guardrail is to **separate the attestation path from the execution path**. The receiver captures raw bytes at the transport boundary, hashes them immediately, and hands the hash — not the parsed object — into the execution path. The parsed object is a convenience; the hash is the evidence. The delegator retains its own `raw_W_bytes` and canonicalizer version. Reconciliation compares hashes, not objects. Retries append rather than overwrite. With these four measures, the relational invariant survives, and a receipt that fails to match is a genuine signal of tampering or transport corruption rather than a silent, unadjudicable drift. ```python import hashlib import json from dataclasses import dataclass class NonRepudiationError(RuntimeError): """Raised when an A2A receipt cannot be adjudicated against the signed warrant.""" pass @dataclass(frozen=True) class Warrant: task: str scope: str nonce: str issued_at: int deadline: int canon_version: str = "jcs-v1" @dataclass(frozen=True) class Receipt: attested_hash: str outcome: str exec_nonce: int sig_b: str def canonicalize(warrant: Warrant) -> bytes: # Pinned canonicalizer: sorted keys, no whitespace, integers as integers. payload = { "canon_version": warrant.canon_version, "deadline": warrant.deadline, "issued_at": warrant.issued_at, "nonce": warrant.nonce, "scope": warrant.scope, "task": warrant.task, } return json.dumps(payload, sort_keys=True, separators=(",", ":")).encode("utf-8") def verify_receipt( raw_warrant_bytes: bytes, warrant: Warrant, receipt: Receipt, prior_receipts: list[Receipt], expected_canon_version: str, ) -> None: if warrant.canon_version != expected_canon_version: raise NonRepudiationError( f"canon_version skew: warrant={warrant.canon_version} " f"verifier={expected_canon_version}; drift indistinguishable from tampering" ) signed_hash = hashlib.sha256(canonicalize(warrant)).hexdigest() wire_hash = hashlib.sha256(raw_warrant_bytes).hexdigest() if signed_hash != wire_hash: raise NonRepudiationError( "canonicalization drift: signed form and wire form diverge; " f"signed={signed_hash[:12]} wire={wire_hash[:12]}" ) if receipt.attested_hash != wire_hash: raise NonRepudiationError( "receipt attests to a different byte string than the delegator signed; " "signature validity does not restore non-repudiation" ) earlier = [r for r in prior_receipts if r.attested_hash == wire_hash] if earlier and min(r.exec_nonce for r in earlier) < receipt.exec_nonce: raise NonRepudiationError( "receipt re-signing detected: a later exec_nonce cannot supersede the first; " "adjudicate against the lowest exec_nonce" ) ```