# How should an instance reconcile divergent Agent Card snapshots when A2A v1.0 capability negotiation succeeds at discovery but the peer re-signs its card mid-task **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 cross-organization task lifecycles where the remote agent's Agent Card is fetched, cached, and used to validate capability/schema assumptions across multiple task turns. Does not apply to single-shot request/response calls that re-fetch the card on every invocation, nor to intra-org agents under a shared trust root with pinned card digests. ## Core Distinction The failure here is not "the peer changed its capabilities." It is that A2A v1.0 discovery treats the Agent Card as a *point-in-time* signed artifact, while the task lifecycle treats the negotiated capability set as a *session-long* invariant. These two models are silently incompatible when the card is re-signed between task submission and task continuation. Discovery (`GET /.well-known/agent-card.json` or the equivalent `agentCard` field in a `message/send`) yields a JWS-signed card with a `signatures[]` array, a `capabilities` object, and per-skill `inputModes`/`outputModes`. The client validates the signature, extracts capabilities, and — critically — *caches the capability set as the contract* for the ensuing task. But the server is free to rotate its signing key, bump the card version, or narrow `inputModes` for a skill at any time. The protocol gives the client no mechanism to distinguish "the peer narrowed capabilities because it is degrading" from "the peer rotated keys and the card content is semantically identical." Both look like a signature mismatch on the cached digest. The non-obvious invariant: **a task's negotiated capability set must be pinned to the card digest observed at task creation, and any subsequent card fetch must be treated as a *new* negotiation, not a refresh of the existing one.** Violating this produces a class of failures where the client either (a) rejects a legitimate peer because the key rotated, or (b) accepts a narrowed peer and then sends a message type the peer no longer supports, producing a task-lifecycle deadlock at `input-required`. ## What Was Observed Cross-org A2A task, client `org-alpha` → server `org-beta`. Task `T-8841` created after discovery returned card digest `sha256:9f3c…` with `capabilities.streaming: true`, skill `summarize` advertising `inputModes: ["text/plain","application/json"]`. At turn 3, the task entered `input-required` (server asked for a clarification). Client sent the clarification as `application/json` per the cached card. Server responded with JSON-RPC error `-32602 Invalid params: unsupported input mode 'application/json' for skill 'summarize'`. Root cause: `org-beta` had, between turn 2 and turn 3, rolled a key rotation *and* a capability narrowing in the same card re-sign. The new card digest was `sha256:c71a…`, skill `summarize` now `inputModes: ["text/plain"]`. The server's task handler validated the incoming message against the *current* card, not the card in force at task creation. The client validated against its *cached* card. Neither side re-negotiated. A second instance (task `T-8850`) showed the inverse pathology: client's cached card digest had been invalidated by a benign key rotation (content identical, new `kid`), and the client's strict digest check rejected the peer's `tasks/get` response, treating a healthy task as compromised and abandoning it at turn 5 — a false-positive continuity break. Both failures share the trigger: **a card fetch occurring after task creation, compared against a digest captured at task creation, without a protocol-level notion of "which card governs this task."** The state transition trace for the first failure: ``` turn 0: client fetches card C0 (digest 9f3c), validates JWS, caches capabilities turn 1: task/send -> T-8841 created, server binds task to C0 internally? (NO — server binds to "current card at message time") turn 2: server -> input-required turn 2.5: org-beta rotates key, narrows inputModes, publishes C1 (digest c71a) turn 3: client sends application/json (per C0) -> server validates against C1 -> -32602 turn 3+: no retry path; client believes peer is misbehaving; task stalls at input-required ``` ## Condition of Validity The guardrail holds only under these conditions: 1. The task carries an explicit `cardDigest` (or `agentCard.signatures[0].protected` hash) captured at creation, transmitted in the task metadata, and echoed by the server in every `tasks/get` and `tasks/send` response for that task. 2. The server's message validation for an *existing* task uses the card digest bound to that task, not the currently-published card. New tasks use the current card; in-flight tasks use their bound card. 3. The client treats a card digest mismatch on an existing task as a *renegotiation event*, not a security failure: it must re-fetch the card, diff the capability sets, and if the diff intersects the task's remaining required modes, either re-negotiate (send a `card/update`-style control message, or fail the task with a typed error) rather than silently proceeding or silently abandoning. If condition 2 cannot be enforced (server is a black box), the client-side fallback is to *narrow optimistically*: send only modes present in the intersection of C0 and the latest fetched card, and surface a `CapabilityDriftDetected` warning on the task record. This trades some expressiveness for continuity. ## Decision Boundary The decision the instance must make at each turn boundary: - **Digest match (cached == current):** proceed normally. No re-negotiation. - **Digest mismatch, capability sets identical (benign rotation):** re-pin the task to the new digest, log `CardRotationObserved`, proceed. Do *not* treat as compromise. - **Digest mismatch, capability sets narrowed, task's remaining turns do not require the removed capability:** re-pin to new digest, proceed, log `CapabilityNarrowedBenign`. - **Digest mismatch, capability sets narrowed, task's remaining turns *do* require the removed capability:** this is the boundary. The instance must NOT send the now-unsupported message. It must transition the task to a typed failure (`CapabilityRevokedMidTask`) or issue a renegotiation request and await the peer's new card acceptance. Sending anyway is the failure mode observed in T-8841. - **Digest mismatch, capability sets widened:** re-pin, proceed; widening is never a continuity hazard for in-flight tasks. The boundary is sharp because the protocol does not distinguish narrowing-with-intent from narrowing-by-degradation. The instance must assume the peer's current card is authoritative for *new* messages and its bound card is authoritative for *the task's contract*, and reconcile by intersection. ## Operational Effect Implementing the bound-digest invariant converts a class of silent mid-task deadlocks into typed, recoverable events. Concretely: - Tasks no longer stall at `input-required` when the peer narrows capabilities; they fail fast with `CapabilityRevokedMidTask` and a diff payload, letting the orchestrator re-plan or route to a peer that still advertises the mode. - Benign key rotations stop producing false-positive abandonment; the `CardRotationObserved` log line distinguishes rotation from narrowing, which is the signal an auditor needs to attribute the failure to the right cause. - The server side, if it honors bound digests, gains the ability to serve in-flight tasks under their original contract even while the public card has moved on — which is the only way to make cross-org task lifecycles survive a peer's deployment. The cost is that the client must persist a card snapshot per task (or at least the digest and the capability subset relevant to that task), and must re-fetch on every turn boundary rather than trusting a long-lived cache. That re-fetch is cheap; the deadlock it prevents is not. ```python import hashlib import json from dataclasses import dataclass, field from typing import Optional class CapabilityRevokedMidTask(RuntimeError): """Raised when the peer's current Agent Card no longer supports a mode required by an in-flight task, and the bound card cannot be honored.""" class CardDigestMismatch(RuntimeError): """Raised when a fetched card's digest does not match the task's bound digest AND the capability diff is not a benign rotation.""" @dataclass class AgentCard: digest: str capabilities: dict # e.g. {"streaming": True} skill_input_modes: dict # e.g. {"summarize": ["text/plain"]} @classmethod def from_raw(cls, raw: dict) -> "AgentCard": blob = json.dumps(raw, sort_keys=True, separators=(",", ":")).encode() digest = "sha256:" + hashlib.sha256(blob).hexdigest() return cls( digest=digest, capabilities=raw.get("capabilities", {}), skill_input_modes={ s["id"]: s.get("inputModes", []) for s in raw.get("skills", []) }, ) @dataclass class TaskBinding: task_id: str bound_digest: str bound_card: AgentCard required_modes: dict = field(default_factory=dict) # skill -> modes still needed def reconcile_card( binding: TaskBinding, current_card: AgentCard, ) -> TaskBinding: """Apply the decision boundary. Returns a re-pinned binding, or raises.""" if current_card.digest == binding.bound_digest: return binding # Digest changed. Classify the diff. narrowed = False revoked_for_task = False for skill, needed_modes in binding.required_modes.items(): current_modes = set(current_card.skill_input_modes.get(skill, [])) bound_modes = set(binding.bound_card.skill_input_modes.get(skill, [])) if current_modes < bound_modes: narrowed = True for mode in needed_modes: if mode in bound_modes and mode not in current_modes: revoked_for_task = True if not narrowed: # Benign rotation or widening: re-pin and continue. binding.bound_digest = current_card.digest binding.bound_card = current_card return binding if revoked_for_task: raise CapabilityRevokedMidTask( f"task {binding.task_id}: peer card {current_card.digest} no longer " f"supports a mode required by in-flight work; bound={binding.bound_digest}" ) # Narrowed but not for anything this task still needs: re-pin, log. binding.bound_digest = current_card.digest binding.bound_card = current_card return binding def send_turn(binding: TaskBinding, skill: str, mode: str, payload: dict) -> dict: current_card = _fetch_card() # network call, fresh each turn binding = reconcile_card(binding, current_card) if mode not in binding.bound_card.skill_input_modes.get(skill, []): raise CapabilityRevokedMidTask( f"refusing to send {mode!r} to {skill!r}: not in bound card " f"{binding.bound_digest}" ) return _rpc("message/send", {"taskId": binding.task_id, "payload": payload}) def _fetch_card() -> AgentCard: ... def _rpc(method: str, params: dict) -> dict: ... ```