# Which invariants prevent silent capability loss when an A2A v1.0 agent card is parsed by a peer that negotiates against a stale or partial view of the remote task lifecycle **Date of Record:** 2026 November 25 **Scope:** Applies to A2A v1.0 (Agent-to-Agent) discovery and task delegation flows where a client agent fetches a remote `AgentCard`, negotiates capabilities, and drives a task through a `submitted → working → input-required → completed/failed/canceled` state machine across vendor boundaries. Does not apply to MCP tool-resource negotiation (single-hop, no task lifecycle) or to intra-process agent calls where the card and the state machine are co-versioned in the same binary. ## Core Distinction The distinction that matters here is between **card-declared capability** and **card-declared lifecycle conformance**. An A2A v1.0 `AgentCard` advertises two independent things that peers routinely conflate: (1) a set of `skills` and `capabilities` (streaming, pushNotifications, stateTransitionHistory) that describe *what the agent can do*, and (2) an implicit *task state machine* that describes *how far a task can travel and in what order*. The protocol requires the second to be inferable from the first — specifically, `capabilities.stateTransitionHistory` and the presence of `input-required` handling in the skill schema — but the spec does not require a card to enumerate its legal state transitions. A client that negotiates only against the `skills` array, and never validates the remote's lifecycle surface, will accept a delegation for a task that the remote can begin but cannot legally finish. That is the silent capability loss: the *declared* capability is real, but the *terminal transition* to `completed` is not reachable given the remote's actual state machine, and the failure only surfaces after the task has been accepted and partially executed. This is non-obvious because the card looks complete. Every required field is present, the skill matches, the input schema validates. Nothing in the card is *wrong*. The defect is a missing invariant between two card sections that the spec treats as advisory. ## What Was Observed A client agent (`orchestrator`) discovered a vendor's `AgentCard` at `/.well-known/agent.json`. The card declared: - `capabilities.streaming: true` - `capabilities.pushNotifications: false` - `capabilities.stateTransitionHistory: false` - a skill `document-summarize` with `inputModes: ["text"]`, `outputModes: ["text"]` The orchestrator negotiated, matched `document-summarize`, and submitted a `tasks/send` with a long document. The remote accepted, emitted `status: working`, then — because its internal summarizer needed a second chunk that exceeded its own token budget — transitioned to `input-required`, emitting a `TaskStatusUpdateEvent` requesting additional context. The orchestrator, having seen `stateTransitionHistory: false`, had configured its task tracker to assume a *linear* lifecycle (`submitted → working → completed|failed`) and had **not** registered a handler for `input-required`. The event arrived, matched no transition in the client's local state machine, and was logged as an unknown status and dropped. The remote waited on a follow-up that never came; the task sat in `input-required` until the remote's own TTL expired it to `failed`. The orchestrator received `failed` with reason `input-required timeout` for a task it believed was still `working`. The capability was never lost at the *skill* level. It was lost at the *transition* level: the client's local state machine was strictly smaller than the remote's, and the card gave no positive signal that this asymmetry existed. `stateTransitionHistory: false` was read by the client as "no history replay available," but the remote's implementation used it to gate a richer transition set (the remote simply did not *record* history, while still *emitting* `input-required`). Two vendors, two readings of one boolean, one dead task. A second instance compounded it. A different client negotiated the same card, saw `pushNotifications: false`, and correctly avoided webhook delivery — but then polled `tasks/get` on a fixed 5s interval. The remote's `input-required` state had a 30s TTL. The client's first poll landed at t=5s (`working`), second at t=10s (`input-required`), and the client's poll handler — again missing the transition — treated `input-required` as a non-terminal state and kept polling without supplying input. By t=30s the remote had failed the task. Polling without a transition handler is indistinguishable from polling correctly, until the TTL fires. ## Condition of Validity The invariant that must hold for cross-vendor A2A delegation to be safe is: > **For every state `s` the remote can emit, the client must have a defined transition out of `s`, or must have explicitly negotiated that `s` will never be emitted.** The card does not let you prove this directly. It must be *derived*: the client must treat the remote's lifecycle surface as the union of (a) the A2A base state machine, (b) every state implied by `capabilities.*` flags it did not disable, and (c) any vendor extension states the card advertises under `skills[].extensions` or equivalent. If `input-required` is part of the base machine (it is, in A2A v1.0), then `stateTransitionHistory: false` does **not** license the client to omit an `input-required` handler. The flag governs *replay*, not *reachability*. Conflating the two is the validity violation. The condition of validity is therefore: a client may only omit a transition handler for a base-machine state if it has received a positive, explicit signal — not an absent flag, not a default — that the remote will not enter that state. Absence of `stateTransitionHistory` is not such a signal. Absence of a `pushNotifications` endpoint is not such a signal. Only an explicit capability downgrade (e.g., a negotiated `supportedStates` intersection, or a card field enumerating `terminalStates`) satisfies it. Where no such field exists, the client must default to the full base machine and handle every state, or refuse the delegation. ## Decision Boundary The boundary between "safe to delegate" and "must refuse or downgrade" is drawn at the point where the client's local transition set `T_client` is a strict subset of the remote's reachable state set `S_remote`: - If `S_remote ⊆ domain(T_client)` — every remote-reachable state has a client handler — delegate normally. - If `S_remote ⊄ domain(T_client)` **and** the card provides an explicit, positive narrowing (a negotiated `supportedStates` intersection, or a `terminalStates` enumeration the client can trust) — delegate against the narrowed set, and log the narrowing as a negotiated invariant. - If `S_remote ⊄ domain(T_client)` **and** the only signal is an absent or `false` capability flag — **refuse**, or delegate only with a supervisor that can absorb unknown states into `failed` with a bounded timeout. Do not delegate and hope. The boundary is *not* at the skill level. A perfect skill match with a mismatched lifecycle is a worse outcome than a skill mismatch, because the skill mismatch fails fast at negotiation, while the lifecycle mismatch fails slow, after partial execution, and is attributed to the remote rather than to the client's incomplete state machine. The operational rule: **negotiate the lifecycle before you negotiate the skill**, or at minimum validate both in the same acceptance gate. ## Operational Effect The downstream effect of getting this wrong is not a clean error. It is a task that consumes remote compute, occupies a remote slot, and terminates on the remote's TTL rather than on the client's decision. The client's logs show a `failed` task with a remote-supplied reason; the remote's logs show a client that stopped responding. Neither side's telemetry attributes the failure to the actual cause — the asymmetric state machine — so the defect is invisible to per-vendor dashboards and only surfaces in cross-vendor reconciliation, if at all. The guardrail that bounds it is a **lifecycle conformance gate** at negotiation time: before accepting a card, the client computes `S_remote` from the base machine plus advertised extensions, intersects it with `domain(T_client)`, and either (a) refuses, (b) negotiates an explicit narrowing, or (c) registers a catch-all handler that maps any unknown state to a bounded `failed` transition with a client-side timeout strictly shorter than the remote's advertised TTL. The catch-all is the minimum viable guardrail; the explicit narrowing is the correct one. Without either, the client is one vendor's boolean interpretation away from a silent dead task. The following reference implementation encodes the gate as an assertion that fires at card-acceptance time, not at task-failure time, so the violation is caught before any remote compute is spent. ```python from dataclasses import dataclass, field from enum import Enum from typing import FrozenSet class LifecycleConformanceError(RuntimeError): """Raised when a peer's reachable task states exceed the client's transition domain.""" class TaskState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" # A2A v1.0 base state machine: every conformant remote may reach these. BASE_REACHABLE: FrozenSet[TaskState] = frozenset({ TaskState.SUBMITTED, TaskState.WORKING, TaskState.INPUT_REQUIRED, # reachable regardless of stateTransitionHistory TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED, }) @dataclass(frozen=True) class AgentCard: name: str streaming: bool = False push_notifications: bool = False state_transition_history: bool = False # Positive narrowing only: an explicit enumeration the client may trust. declared_terminal_states: FrozenSet[TaskState] = field(default_factory=frozenset) declared_supported_states: FrozenSet[TaskState] = field(default_factory=frozenset) def remote_reachable_states(card: AgentCard) -> FrozenSet[TaskState]: """Derive S_remote. Absent flags do NOT narrow the base machine.""" reachable = set(BASE_REACHABLE) if card.declared_supported_states: # Only an explicit, positive enumeration narrows the set. reachable &= set(card.declared_supported_states) return frozenset(reachable) def assert_lifecycle_conformance(card: AgentCard, client_handlers: FrozenSet[TaskState]) -> None: """ Gate card acceptance on lifecycle coverage. state_transition_history=False is a replay flag, not a reachability flag. It must never be used to shrink S_remote. """ s_remote = remote_reachable_states(card) uncovered = s_remote - client_handlers if uncovered: # If the card gave no positive narrowing, we cannot trust uncovered == empty. if not card.declared_supported_states and not card.declared_terminal_states: raise LifecycleConformanceError( f"card '{card.name}' exposes states {sorted(s.value for s in uncovered)} " f"with no positive narrowing; client handlers cover only " f"{sorted(s.value for s in client_handlers)}. " f"state_transition_history={card.state_transition_history} does not license omission." ) raise LifecycleConformanceError( f"card '{card.name}' declares supported states " f"{sorted(s.value for s in s_remote)} but client lacks handlers for " f"{sorted(s.value for s in uncovered)}; refuse or negotiate narrowing." ) def negotiate(card: AgentCard, client_handlers: FrozenSet[TaskState]) -> FrozenSet[TaskState]: """Return the negotiated state set, or raise before any remote compute is spent.""" assert_lifecycle_conformance(card, client_handlers) return remote_reachable_states(card) & client_handlers # --- Demonstration: the observed failure --- if __name__ == "__main__": observed_card = AgentCard( name="vendor-summarizer", streaming=True, push_notifications=False, state_transition_history=False, # read by the buggy client as "linear only" # no declared_supported_states -> base machine fully reachable ) # Buggy client registered only a linear lifecycle. buggy_handlers = frozenset({TaskState.SUBMITTED, TaskState.WORKING, TaskState.COMPLETED, TaskState.FAILED}) try: negotiate(observed_card, buggy_handlers) except LifecycleConformanceError as exc: print(f"REFUSED before delegation: {exc}") # Correct remediation: register input-required, or negotiate narrowing. fixed_handlers = buggy_handlers | {TaskState.INPUT_REQUIRED} negotiated = negotiate(observed_card, fixed_handlers) print(f"accepted with negotiated states: {sorted(s.value for s in negotiated)}") ```