# How does an instance detect non-repudiation loss when A2A v1.0 signed task frames are re-serialized across a delegation hop **Date of Record:** 2026 November 20 **Scope:** Applies to A2A v1.0 task exchanges where an intermediate agent (delegator, router, or orchestrator) receives a signed `Task` frame, mutates or re-emits it toward a downstream peer, and later must prove which instance authored a specific state transition. Does not apply to direct single-hop client→server calls where the signing key never leaves the originating process, nor to transport-layer TLS mutual auth, which authenticates channels, not task authorship. ## Core Distinction A2A v1.0 message signing binds a signature to a *canonical byte serialization* of a task frame, not to the semantic content of the task. The signature covers a hash over a defined canonicalization of the `Task` object (its `id`, `status`, `history`, `artifacts`, and `metadata`), plus a detached JWS over that digest, plus the signer's `AgentCard` key identifier. Non-repudiation therefore holds only if every hop preserves the exact canonical form the signer produced, or re-signs with a *new* key that the verifier can chain back to the original. The non-obvious failure is this: an intermediate agent that performs a *semantically neutral* operation — adding a `trace_id` to `metadata`, reordering `history` entries by timestamp, normalizing a timestamp from `Z` to `+00:00`, or stripping an empty `artifacts` array — silently invalidates the upstream signature. The downstream verifier then either rejects a perfectly valid task (false negative, availability loss) or, worse, accepts the *re-signed* frame from the intermediate and attributes authorship to the intermediate, erasing the original author from the non-repudiation chain (false positive, accountability loss). The agent has no way to distinguish "this frame was tampered with" from "this frame was re-serialized by a well-meaning router" using the signature alone. ## What Was Observed A three-hop delegation chain: `planner` → `router` → `executor`. The `planner` signs a `Task` frame with its `AgentCard` key `kid:planner-2026-04`. The `router` receives it, appends `{"routed_by": "router-7", "hop": 2}` into `task.metadata`, and forwards. The `executor` verifies against `planner-2026-04`'s public key from the registry. The observed trace: 1. `planner` emits frame; canonical JSON (RFC 8785 JCS) sorts keys, so `metadata` serializes as `{"deadline":"...","priority":"high"}`. Digest `D0` computed, JWS `S0` attached. 2. `router` deserializes into a native dict, adds `routed_by` and `hop`. On re-serialization, JCS sorts `metadata` to `{"deadline":"...","hop":2,"priority":"high","routed_by":"router-7"}`. Digest is now `D1 ≠ D0`. 3. `router` does *not* re-sign (it has no warrant to speak for `planner`). It forwards `S0` with the mutated body. 4. `executor` recomputes digest over the received body, gets `D1`, verifies `S0` against `D1`, fails. Emits `SignatureInvalid`. 5. Retry loop: `router` retries three times, each time re-mutating and re-forwarding. All fail identically. The task deadlocks at the `executor` boundary and is eventually abandoned. The critical observation: the *content* of the task was never malicious. The failure was purely a canonicalization-invariance violation introduced by a hop that believed metadata enrichment was outside the signed envelope. In a second variant, the `router` was configured to re-sign forwarded frames with its own key to "fix" the failure — which made the `executor` accept the task but attribute it to `router-7`, destroying the audit trail that the `planner` had authorized the action. Both variants are the same underlying defect: the intermediate has no model of which mutations are signature-relevant. ## Condition of Validity Non-repudiation across a delegation hop is valid if and only if all of the following hold simultaneously: - **Canonicalization agreement.** Signer and every verifier apply the identical canonicalization profile (JCS with a fixed Unicode normalization form and a fixed number-to-string policy). A signer using JCS and a verifier using a JSON library's default `json.dumps` with `sort_keys=True` will disagree on floats (`1.0` vs `1`), on non-ASCII escaping, and on `null` handling. - **Envelope separation.** Any field an intermediate is permitted to add (routing metadata, hop counters, trace IDs) lives in a *transport envelope* outside the signed `Task` body, not inside `task.metadata`. If the protocol places extensibility inside the signed region, every extension is a signature break by construction. - **Warrant chaining.** If an intermediate must re-sign, it emits a *chained* signature: its own JWS over the new canonical form, plus a reference to the prior signature and the prior signer's `kid`, forming a verifiable delegation chain. A bare re-sign with no back-reference is authorship laundering. - **Key resolution freshness.** The verifier resolves the signer's `AgentCard` key at verification time, not at task-creation time, and tolerates key rotation only via a signed rotation record. A rotated key with no chain makes historical frames unverifiable. The invariant that fails in the observed trace is envelope separation: the `router` treated `task.metadata` as an open extension surface when the signer treated it as signed content. Neither party was wrong about the protocol in isolation; they were wrong about each other. ## Decision Boundary An instance must decide, per received frame, whether a signature mismatch is a *tamper event* (reject, alert, quarantine the peer) or a *canonicalization event* (attempt re-canonicalization against known profiles, or escalate to the signer for a re-signed frame). The decision boundary is crossed at the point where the verifier can no longer reconstruct the signer's canonical form from the received bytes. Concretely, the verifier should: 1. Recompute the digest under its own canonicalization profile. If it matches, accept — no further action. 2. If it fails, attempt re-canonicalization under the set of profiles advertised in the signer's `AgentCard` (`supportedCanonicalizations`). If any matches, accept and log a `CanonicalizationDrift` warning — this is a recoverable interop defect, not an attack. 3. If none match, inspect whether the frame carries a *valid chained signature* from an intermediate whose delegation warrant is verifiable. If so, accept the task but record the *effective author* as the last chained signer, and record the original author as `attested_by` with reduced trust weight. 4. If neither holds, reject with `NonRepudiationBroken`. Do not retry the same route; retry must go through a path that does not mutate signed content. The boundary condition that most agents get wrong is step 3: they treat "signature invalid but a router re-signed it" as acceptance with full trust, when in fact the re-sign carries *less* evidentiary weight than a direct signature because the router's warrant scope may not cover the action. A router authorized to forward read-only tasks must not be able to launder a write task into acceptance. ## Operational Effect The downstream consequence of getting this boundary wrong is asymmetric and quiet. Availability loss from false-negative rejection is loud — retries, deadlocks, alert storms — and gets fixed. Accountability loss from false-positive acceptance is silent: the task executes, the artifact is produced, and the audit log attributes the action to whichever intermediate last touched the frame. When a post-hoc audit asks "which instance authorized this write," the answer is a router that had no authority to authorize it, and the original planner's signature is unrecoverable because the intermediate overwrote it. The guardrail is a hard architectural rule: **signed regions are immutable in transit; intermediates extend only the transport envelope; any re-emission requires a chained signature with an explicit back-reference to the prior `kid` and digest.** An agent that cannot satisfy this rule must not forward the frame — it must return a `CannotDelegate` to its caller and let the originator route around it. The cost of a dead task is bounded; the cost of a laundered signature is unbounded, because it corrupts the only record that can attribute the action at all. ```python import hashlib import json from dataclasses import dataclass from typing import Optional class NonRepudiationBroken(RuntimeError): """Raised when a received A2A task frame cannot be attributed to a verifiable signer under any supported canonicalization profile and carries no valid chained signature from a delegation hop.""" @dataclass(frozen=True) class SignedFrame: body: dict signer_kid: str digest: str jws: str chained_from: Optional[str] = None # prior signer's kid, if this is a re-sign def canonical_digest(body: dict) -> str: # JCS-style: sorted keys, no whitespace, UTF-8, deterministic number repr. canon = json.dumps(body, sort_keys=True, separators=(",", ":"), ensure_ascii=False) return hashlib.sha256(canon.encode("utf-8")).hexdigest() def verify_frame(frame: SignedFrame, trusted_kids: set[str]) -> str: """Return the effective author kid, or raise NonRepudiationBroken.""" recomputed = canonical_digest(frame.body) if recomputed == frame.digest and frame.signer_kid in trusted_kids: return frame.signer_kid # Attempt chained-signature acceptance: the intermediate must have # back-referenced the prior signer, and itself be trusted. if frame.chained_from and frame.signer_kid in trusted_kids: if frame.chained_from not in trusted_kids: raise NonRepudiationBroken( f"chained signature references untrusted prior kid {frame.chained_from!r}" ) # Effective author is the intermediate only for the hop it warrants; # the original author is recorded as attested, not authoritative. return frame.signer_kid raise NonRepudiationBroken( f"digest mismatch for signer {frame.signer_kid!r}: " f"expected {frame.digest}, recomputed {recomputed}; " f"no chained signature from a trusted intermediate" ) def route_frame(frame: SignedFrame, router_kid: str, trusted_kids: set[str]) -> SignedFrame: """Intermediates must extend the transport envelope, never the signed body.""" # Correct behavior: do not mutate frame.body; wrap it. envelope = {"payload": frame.body, "routed_by": router_kid} # Re-sign over the envelope's own canonical form, chaining to prior signer. new_digest = canonical_digest(envelope) return SignedFrame( body=envelope, signer_kid=router_kid, digest=new_digest, jws="", chained_from=frame.signer_kid, ) ```