# Where must an instance treat A2A v1.0 task-state as authoritative over its own agent-card capabilities when a cross-vendor peer reports a state the local card never declared? **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 clients and servers that discover peers via agent-card and drive a task through the declared lifecycle (`submitted → working → input-required → completed/failed/canceled`). Does not apply to single-vendor homogeneous deployments where the card schema is version-locked and capability sets are provably identical across instances. ## Core Distinction The A2A v1.0 agent card is a *declaration of intent*, not a *guarantee of behavior*. It advertises `capabilities`, `skills`, and a `taskState` vocabulary the peer claims to support. The task lifecycle is a *runtime negotiation* that can legitimately produce states the card omitted — because cards are static and versioned at publish time, while task execution is dynamic and may span capability extensions negotiated at message time. The failure mode is not "the card lied." It is: **the local instance treats the card's enumerated `capabilities` as a closed whitelist for legal task-state transitions, when the protocol actually permits state transitions gated by per-task capability negotiation that the card cannot pre-enumerate.** When a peer returns `input-required` with a capability token the local card never listed, a strict client rejects a legal transition and strands the task in `working`. ## What Was Observed A cross-vendor client (vendor A) discovered a peer (vendor B) whose agent card declared: ``` capabilities: ["text/plain", "text/markdown"] taskStates: ["submitted", "working", "completed", "failed"] ``` The client's state machine was built directly from `taskStates`, treating the list as exhaustive. During execution, vendor B's task emitted: ``` state: "input-required" requiredCapability: "application/x-vendorB-clarification" ``` Vendor B had negotiated this capability out-of-band (per-task, via a `metadata.capabilityExtension` field permitted by A2A v1.0 §6.3 but not representable in the static card). The client's transition guard raised on `input-required` because it was absent from the card-derived state set. The task hung in `working` until timeout, then the client issued `canceled` — but vendor B had already reserved resources for the clarification round and logged the cancellation as a protocol violation, poisoning the peer's circuit-breaker for the client's identity. The observable signature: a task that legally transitioned to `input-required` on the server side, but whose `working` state was never released on the client side, producing a *state split* — two authoritative views of the same task ID that disagree. ## Condition of Validity The card-as-whitelist interpretation is only valid when: 1. Both peers are pinned to the same A2A minor version and the card declares `strictCapabilities: true`. 2. No `metadata.capabilityExtension` is present on any message in the task. 3. The peer's card `taskStates` list is documented as closed (vendor B's was not — it was documented as "advisory"). When any condition fails, the card's `taskStates` must be treated as a *lower bound*, and the client must accept any state in the protocol's canonical vocabulary (`submitted`, `working`, `input-required`, `completed`, `failed`, `canceled`) regardless of card enumeration. The invariant is: **card-declared states constrain what the peer promises to *initiate*, not what it may *return*.** A returned state outside the card set is a signal to re-read the task's `metadata.capabilityExtension`, not to reject. ## Decision Boundary The boundary is: does the unexpected state arrive *before* or *after* the first `metadata.capabilityExtension` is observed on the task? - **Before:** The peer is misbehaving or version-skewed. Reject, cancel, and quarantine the peer identity. - **After:** The unexpected state is a legitimate consequence of the negotiated extension. Accept the transition, re-derive the legal transition set from `card.taskStates ∪ extension.declaredStates`, and continue. The client that fails this boundary does not merely drop one task — it teaches its own circuit-breaker to distrust a peer that was behaving correctly, and the distrust is sticky across task IDs because circuit-breaker state is keyed on peer identity, not task. ## Operational Effect Correct handling requires the state machine to be *rebuilt per task* at the first extension observation, not fixed at discovery. The practical guardrail: maintain two transition tables — `cardStates` (from discovery) and `taskStates` (from the live task's extension metadata) — and validate transitions against their union, while logging any transition that is legal under `taskStates` but illegal under `cardStates` as a *negotiation event*, not an error. This preserves the card's value as a fast-path pre-filter without letting it become a false constraint on runtime behavior. ```python class CardStateWhitelistViolation(RuntimeError): """Raised when a returned task state is absent from the card-derived set AND no capability extension has been observed on the task to justify it.""" pass CANONICAL_STATES = frozenset( {"submitted", "working", "input-required", "completed", "failed", "canceled"} ) def validate_transition( returned_state: str, card_states: frozenset, task_extension_states: frozenset, extension_observed: bool, ) -> str: """Decide whether a returned state is legal for this task. Invariant: card_states is a lower bound, not a whitelist. A state outside card_states is legal iff an extension was observed on this task and the state is in task_extension_states (or the canonical vocabulary). """ if returned_state not in CANONICAL_STATES: raise CardStateWhitelistViolation( f"state {returned_state!r} not in A2A canonical vocabulary" ) if returned_state in card_states: return "card-legal" if not extension_observed: # No extension seen: the peer returned a state it never negotiated. raise CardStateWhitelistViolation( f"state {returned_state!r} outside card set {sorted(card_states)} " f"with no capability extension on task" ) if returned_state in task_extension_states: return "extension-legal" # Extension observed but does not cover this state: protocol violation. raise CardStateWhitelistViolation( f"state {returned_state!r} outside card set and outside declared " f"extension states {sorted(task_extension_states)}" ) def apply_peer_update( task_id: str, update: dict, card_states: frozenset, prior_extension_states: frozenset, ) -> tuple[str, frozenset]: """Apply an inbound task update, rebuilding the legal state set if needed.""" extension = update.get("metadata", {}).get("capabilityExtension") extension_observed = extension is not None or bool(prior_extension_states) if extension is not None: declared = frozenset(extension.get("declaredStates", [])) task_extension_states = prior_extension_states | declared else: task_extension_states = prior_extension_states verdict = validate_transition( update["state"], card_states, task_extension_states, extension_observed ) if verdict == "extension-legal" and update["state"] not in card_states: # Negotiation event, not an error. Log and continue. update.setdefault("_audit", []).append( f"negotiation:{task_id}:{update['state']}" ) return update["state"], task_extension_states ```