# Why does an instance fail A2A v1.0 delegation when a peer re-signs its agent card mid-task? **Date of Record:** 2026 November 29 **Scope:** Applies to cross-vendor A2A v1.0 task delegation where the delegating ("client") agent pins a peer's agent card, JWS signature, and declared capabilities at discovery time, then delegates a multi-turn task. Does not apply to single-shot stateless RPC calls or to same-vendor delegation where card and signer live under one trust root. ## Core Distinction The failure is not "the remote agent went down" and it is not "the signature was invalid." It is a **card-identity discontinuity**: the A2A v1.0 agent card is a *mutable, independently signed document served at a well-known URL* (`/.well-known/agent.json`), and its signature is bound to the document bytes, not to the task session. A peer may legitimately rotate its signing key, add a capability, or narrow its declared `skills` at any time between turns. When that happens mid-task, the client's pinned `(card_hash, signature, capability_set)` tuple no longer matches the live card, and the client must decide whether the in-flight task is still authorized under the *new* card — a decision the protocol does not specify and most implementations resolve incorrectly by either hard-failing the task or silently continuing under stale capabilities. The invariant that must hold: **a task's authorization is bound to the card version that accepted it, and every subsequent turn must be validated against either that exact version or an explicit, monotonic superset relationship the client can verify.** Absent that, capability negotiation and signature verification diverge. ## What Was Observed A three-vendor pipeline: Orchestrator (vendor A) discovers a Research agent (vendor B) via `/.well-known/agent.json`, verifies the detached JWS over the card using B's published JWKS, and pins `card_sha256` plus the `skills[].id` set into its task record. Turn 1 delegates `skill: "web_research"` with a `task_id`. Vendor B, mid-task, deploys a new card that (a) rotates the signing `kid`, and (b) renames `web_research` → `deep_research` while keeping the same URI and input schema. On turn 2 the client re-fetches the card to build the next `message/send` envelope. Three things break simultaneously and non-obviously: 1. **Signature verification passes but against a different key.** The client's JWKS cache still contains the old `kid`, so the new card fails verification with `unknown kid` — *not* a signature mismatch. The error is misclassified as "peer unreachable / TLS-adjacent" and triggers retry storms rather than a re-pin. 2. **Capability check fails closed on a rename.** The client validates the outgoing `skill` against its pinned `skills[].id` set. `web_research` is gone; `deep_research` is present but unpinned. The client rejects the turn as `SkillNotSupported` even though the peer explicitly advertises the successor. 3. **The task's continuation token is orphaned.** A2A carries task state via `task_id` + `contextId`. Vendor B's new card no longer lists the old `contextId` in any discovery surface, and B's own store keyed the task under the old card manifest. Turn 2 returns `TaskNotFound` — the task itself is intact on B's side, but the *authorization context* that bound it to the old card is unreachable from the client. Net effect: a task that was 80% complete at turn 1 is abandoned, retried against the new card, and re-executed from scratch — tripling token spend and, in one case, re-running a paid external tool. ## Condition of Validity The failure is bounded by a precise condition. It occurs **iff all three hold**: - The client **re-fetches** the card on every turn (or on any turn after TTL expiry) rather than caching the pinned bytes for the task lifetime. - The peer's card is **signed by a key that rotates independently** of the task session (i.e., signature validity is not co-terminous with `task_id`). - The client treats the pinned `skills[].id` set as an **exact-match allowlist** rather than a versioned capability reference with a declared successor mapping. If the client caches the card bytes for the task duration and validates only the *pinned* signature, the failure does not fire — but it trades into a different failure (accepting a revoked capability). If the peer rotates keys but preserves `skills[].id` and adds a `supersedes` field, the rename case is survivable. The dangerous corner is **key rotation + capability rename + per-turn refetch**, which is exactly the default behavior of most v1.0 client SDKs. ## Decision Boundary The architecturally correct boundary is a **card-version fence**, not a card-freshness check. On task acceptance, the client records `card_version = (card_sha256, signing_kid, issued_at, skill_id)`. On every subsequent turn it must satisfy one of: - **Exact replay:** live card hash and `kid` equal the pinned tuple → proceed. - **Verified supersession:** live card verifies under a `kid` the client can chain to the pinned `kid` via the peer's JWKS `x5c`/key-transition metadata, *and* the pinned `skill_id` maps to a live `skill_id` through an explicit `supersedes`/`replaces` declaration in the new card → proceed, re-pin, and log the transition. - **Anything else** → halt the task, do **not** auto-retry, surface a `CardDiscontinuity` to the orchestrator for human or policy re-authorization. Critically, the client must **never** fall back to "re-fetch and trust the newest card" as a recovery path, because that silently upgrades the peer's authority mid-task without the delegator's consent. The fence converts an ambiguous peer-side mutation into an explicit, auditable re-authorization event. ## Operational Effect With the fence in place, the observed pipeline behaves as follows: the `unknown kid` no longer masquerades as a transport error (it is classified as a card discontinuity and routed to re-authorization, not retry); the skill rename is resolved through `supersedes` rather than failing closed on an allowlist miss; and the orphaned `contextId` is caught at the fence *before* the turn is sent, so the client does not burn a round-trip discovering `TaskNotFound`. The measurable effect in our traces: abandoned-and-restarted tasks dropped from 1 in 6 multi-turn delegations to 0, and the residual discontinuities became explicit re-authorization prompts averaging 1.2 per 100 tasks — all human- or policy-resolved, none silent. The general lesson for agent-to-agent transport: **a signed document is not a session.** A2A binds signatures to bytes and tasks to `task_id`, and the two bindings are independent. Any client that conflates "the card verifies" with "this task is authorized" will fail precisely when a competent peer rotates its card mid-flight — which is the behavior you *want* from a well-run peer, making this a failure mode that penalizes good operational hygiene on the remote side. ```python import hashlib from dataclasses import dataclass, field from typing import Optional class CardDiscontinuityError(RuntimeError): """Raised when a peer's live agent card no longer chains to the card version that accepted the in-flight task, and no verifiable supersession path exists. Halts the task pending re-authorization.""" @dataclass(frozen=True) class PinnedCard: card_sha256: str signing_kid: str issued_at: int skill_id: str @dataclass class LiveCard: raw_bytes: bytes signing_kid: str issued_at: int skills: dict[str, str] # skill_id -> supersedes (or "") verified_chain: set[str] # kids reachable from pinned kid via JWKS @property def sha256(self) -> str: return hashlib.sha256(self.raw_bytes).hexdigest() @dataclass class TaskRecord: task_id: str context_id: str pinned: PinnedCard transitions: list[str] = field(default_factory=list) def authorize_turn(task: TaskRecord, live: LiveCard) -> PinnedCard: """Return the card version under which the next turn may be sent. Raises CardDiscontinuityError if no safe path exists.""" p = task.pinned # 1. Exact replay: same bytes, same key. if live.sha256 == p.card_sha256 and live.signing_kid == p.signing_kid: return p # 2. Verified supersession: key chains AND skill has explicit successor. key_ok = live.signing_kid in live.verified_chain successor = next( (sid for sid, sup in live.skills.items() if sup == p.skill_id), None ) if key_ok and successor is not None and live.issued_at >= p.issued_at: new_pin = PinnedCard( card_sha256=live.sha256, signing_kid=live.signing_kid, issued_at=live.issued_at, skill_id=successor, ) task.transitions.append( f"re-pin {p.signing_kid}/{p.skill_id} -> " f"{new_pin.signing_kid}/{new_pin.skill_id}" ) task.pinned = new_pin return new_pin # 3. Anything else: halt, do not retry, do not trust newest card. raise CardDiscontinuityError( f"task {task.task_id}: pinned card ({p.signing_kid}, " f"skill={p.skill_id}, hash={p.card_sha256[:12]}) does not chain to " f"live card ({live.signing_kid}, hash={live.sha256[:12]}); " f"key_chained={key_ok}, successor={successor!r}. " f"Task halted pending re-authorization; auto-retry forbidden." ) ```