# How does an instance detect a stale-signature capability manifest during A2A v1.0 card discovery when the signing key rotates mid-reconciliation? **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 agent-to-agent task handoffs where the remote peer's `AgentCard` carries a signed capability manifest (`manifest.sig`, `manifest.keyId`, `manifest.validUntil`) and the local instance performs cross-vendor task lifecycle reconciliation (state merge from a peer's `TaskStatus` stream) against that manifest. Does not apply to unsigned cards, to same-vendor deployments sharing a trust root, or to pure request/response tool calls with no lifecycle state. ## Core Distinction The failure is not "the signature is invalid." A signature that fails verification is a clean, detectable reject. The dangerous boundary is the *temporally valid but semantically superseded* signature: the manifest verifies correctly against a `keyId` that the peer has already rotated out of its authoritative key set, but the discovery cache still holds the old public key because the cache TTL and the key-rotation epoch have drifted apart. The local instance accepts a capability grant (e.g., `supports.task.cancel: true`, `maxConcurrentTasks: 8`) that the peer no longer honors, then reconciles lifecycle state against a capability contract the peer has silently revoked. The invariant that breaks: *a verified signature proves the manifest was authored by the key holder at signing time, not that the key holder still asserts the manifest at reconciliation time.* Signature validity and capability currency are orthogonal; A2A v1.0's card structure lets them collapse into one boolean if the reconciler isn't careful. ## What Was Observed A cross-vendor reconciliation loop between a coordinator agent (vendor A) and a worker agent (vendor B) began emitting `TaskState.TERMINAL_MISMATCH` on roughly 3% of tasks over a 40-minute window. The trace: 1. Coordinator fetched worker `AgentCard` at T+0. Manifest verified against `keyId: b-worker-2024q4`, `validUntil: T+86400`. Card cached with TTL 3600s. Manifest advertised `supports.task.cancel: true` and `lifecycle.reconcileMode: "authoritative"`. 2. At T+2100, vendor B rotated its signing key to `b-worker-2025q1` and, in the same rotation, flipped `lifecycle.reconcileMode` to `"advisory"` and set `supports.task.cancel: false` (a deliberate capability reduction after a cancel-race incident on their side). 3. Coordinator's cache had not expired. It continued to present the old card's manifest as the negotiated contract for new tasks. 4. New tasks dispatched after T+2100 used `reconcileMode: "authoritative"`. When the worker's `TaskStatus` stream reported `canceled` and the coordinator's local ledger still held `working`, the coordinator *overwrote* its ledger from the peer stream (authoritative semantics) — but the worker was now running advisory semantics and expected the coordinator to be the tie-breaker. Both sides deferred to each other's stale view. Ledger divergence, then `TERMINAL_MISMATCH`. 5. Signature verification on every message *passed*. The `keyId` on incoming `TaskStatus` frames was `b-worker-2025q1`, which the coordinator's key cache did not yet contain, so it fell back to the cached `b-worker-2024q4` public key — which still verified the *card*, because the card hadn't been re-fetched. The per-message signature was checked against the message's own embedded key, not the card's key, so the mismatch was invisible. The non-obvious part: every individual cryptographic check succeeded. The break was in the *binding between the card's manifest epoch and the message stream's key epoch*. The reconciler treated "card verified" as a durable fact and "message verified" as an independent fact, and never asserted they referenced the same key generation. ## Condition of Validity This boundary is reachable only when all of the following hold simultaneously: - The peer rotates signing keys **without** changing its `AgentCard` URL or its agent identity (`agentId`), so discovery cache keys remain stable and the rotation is not visible as an identity change. - The rotation **co-occurs** with a capability or reconciliation-semantics change. Pure key rotation with identical manifest content is harmless; the failure requires the manifest body to change meaning under the same cache key. - The local reconciler uses **per-message** signature verification against the message's embedded `keyId` rather than against the discovered card's pinned `keyId`. This is the load-bearing condition: it decouples message trust from card trust. - Cache TTL exceeds the rotation propagation window, or the peer's key-set endpoint (`/.well-known/agent-keys`) is not polled on a cadence shorter than the TTL. If the reconciler pins the card's `keyId` and rejects any `TaskStatus` frame whose signing `keyId` differs, the failure collapses to a clean `KEY_EPOCH_DRIFT` reject. That is the guardrail. ## Decision Boundary At reconciliation, the instance must choose between two policies and must not blend them: - **Pinned-epoch**: the card's `keyId` and `manifest.validUntil` bound the entire task lifecycle. Any frame signed under a different `keyId` forces a card re-fetch and, if the manifest body changed, a *renegotiation* of the task contract before further state merge. Correct but incurs a discovery round-trip on every rotation. - **Rolling-trust**: frames may be signed under any key in the peer's current key set, but the reconciler must re-derive the *effective manifest* for the frame's `keyId` and refuse to merge state if the effective `reconcileMode` or `supports.task.cancel` differs from the one the task was dispatched under. This requires the peer to publish per-`keyId` manifest history. The invariant to enforce: **a task's reconciliation semantics are frozen at dispatch and must be provably the same generation as the frame's signing key.** If they cannot be proven equal, the reconciler must halt merge, not pick a side. The 3% mismatch rate came from picking a side — the coordinator silently preferring its own ledger while the worker silently preferred the coordinator's, both under stale `authoritative` semantics. ## Operational Effect Without the epoch-binding guardrail, key rotation becomes a silent capability-revocation channel: a peer can reduce its advertised capabilities by rotating keys and letting caches expire into the new manifest, and any in-flight task dispatched under the old manifest will reconcile against contradictory semantics. The failure is asymmetric — the side with the longer cache TTL loses, because it holds the older manifest longer and defers more aggressively. Operators see a low-rate, rotation-correlated `TERMINAL_MISMATCH` that does not reproduce on fresh caches, which is exactly the signature that gets misattributed to "flaky network" and never fixed. The guardrail costs one key-set poll per rotation epoch per peer and a manifest-generation stamp on every dispatched task. That stamp is the whole fix: it makes "which contract am I reconciling under" a checked value rather than an assumed one. ```python from __future__ import annotations import time from dataclasses import dataclass class KeyEpochDriftError(RuntimeError): """Raised when a TaskStatus frame is signed under a key epoch that does not match the manifest generation the task was dispatched under.""" @dataclass(frozen=True) class SignedManifest: key_id: str valid_until: float reconcile_mode: str # "authoritative" | "advisory" supports_cancel: bool @dataclass(frozen=True) class TaskContract: task_id: str dispatched_manifest: SignedManifest dispatched_at: float def reconcile_status_frame( contract: TaskContract, frame_key_id: str, frame_manifest: SignedManifest, frame_state: str, local_state: str, now: float | None = None, ) -> str: """Merge a peer TaskStatus frame into the local ledger, but only if the frame's signing key epoch and effective manifest generation match the contract frozen at dispatch. Returns the merged state.""" now = now if now is not None else time.time() # Guard 1: manifest must still be within its declared validity window. if now > contract.dispatched_manifest.valid_until: raise KeyEpochDriftError( f"task {contract.task_id}: dispatched manifest expired at " f"{contract.dispatched_manifest.valid_until}, now {now}" ) # Guard 2: the frame must be signed under the SAME key epoch the task # was dispatched under. A rotated key means the peer's capability # assertions may have changed underneath us. if frame_key_id != contract.dispatched_manifest.key_id: raise KeyEpochDriftError( f"task {contract.task_id}: frame signed under {frame_key_id!r} " f"but dispatched under {contract.dispatched_manifest.key_id!r}; " "refusing to merge across key-rotation boundary" ) # Guard 3: even under the same keyId, the effective manifest body must # match. Catches re-issuance under a stable keyId with mutated content. if frame_manifest != contract.dispatched_manifest: raise KeyEpochDriftError( f"task {contract.task_id}: manifest body changed under stable " f"keyId {frame_key_id!r}; reconcile semantics not frozen" ) # Safe to merge under the frozen contract. if contract.dispatched_manifest.reconcile_mode == "authoritative": return frame_state # advisory: local ledger wins on conflict return local_state if local_state != frame_state else frame_state ```