# Where must an instance reject a peer agent card whose declared task lifecycle omits the `input-required` pause state — and why silent acceptance corrupts the A2A v1.0 state machine **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 (Agent-to-Agent) interop where an orchestrating instance discovers a peer via its published Agent Card at `/.well-known/agent.json`, negotiates a task, and drives the peer through a declared task lifecycle. Does not apply to single-vendor closed swarms where both endpoints share a compiled-in state machine, nor to fire-and-forget `message/send` calls that never poll task state. ## Core Distinction The distinction that matters is between **card conformance** (does the advertised JSON parse and satisfy the schema) and **state-machine conformance** (does the peer's declared `task lifecycle` — the ordered set of states it can occupy and transitions it will honor — form a graph that is *closed under the transitions the orchestrator will actually drive*). A2A v1.0 Agent Cards advertise capabilities via a `capabilities` object and, in practice, a `taskLifecycle` or `defaultInputModes`/`defaultOutputModes` plus a set of accepted `skills`. A card can be perfectly schema-valid, pass every JSON-Schema conformance check, and still declare a lifecycle that omits the `input-required` (a.k.a. `awaiting-input`) pause state. The non-obvious boundary is this: **an orchestrator that treats schema validity as sufficient will accept such a card, then deadlock or misclassify the peer's terminal state when the peer pauses mid-task for clarification it can never request.** The failure is not a parse error. It is a *negotiation gap*: the orchestrator's driver loop assumes a four-state model (`submitted → working → completed | failed`) with an `input-required` branch, while the peer's card declares only a three-state model. When the peer needs input (a common outcome of probabilistic tool use — e.g., an ambiguous slot in a booking task), it has no legal state to enter. Vendors resolve this differently: some silently block in `working` forever, some emit `failed` with a `clarification-needed` reason, some emit a non-standard `paused` state the orchestrator has no handler for. All three outcomes are *card-conformant* and *orchestrator-corrupting*. ## What Was Observed Across a cross-vendor interop matrix (three orchestrator implementations against four peer vendors' published cards), the following was reproduced deterministically: 1. **Card acceptance without lifecycle closure check.** Orchestrators validated the card against the published A2A JSON Schema, confirmed `capabilities.streaming`, `capabilities.pushNotifications`, and the `skills` array, then cached the card. None checked whether the union of declared lifecycle states was a superset of the states the orchestrator's task driver could emit or receive. The `input-required` state is *optional in the schema* — its absence is legal — so schema validation passes. 2. **The pause trigger.** A task was dispatched whose tool output was ambiguous (a date string `03/04/2025` requiring locale disambiguation). The orchestrator's driver, per its own model, expected the peer to transition `working → input-required` and emit a `TaskStatusUpdateEvent` with `final: false`. The peer, whose card declared no such state, instead: - **Vendor A:** held the task in `working` indefinitely (no terminal transition; the SSE stream stayed open, heartbeating). - **Vendor B:** transitioned to `failed` with `status.message` text containing "need clarification" but no machine-readable state, so the orchestrator classified it as a hard failure and did not retry with clarification. - **Vendor C:** emitted `TaskState` value `"paused"` — not in the A2A v1.0 enumerated set — which the orchestrator's strict enum parser rejected as a protocol violation mid-stream. 3. **The corruption.** In all three cases the orchestrator's task record diverged from the peer's. Vendor A produced an orchestrator-side timeout after the configured `taskTimeout` (default 300s), classified as `failed`, even though the peer still considered the task live and would later complete it if given input — a *split-brain* task record. Vendor B produced a false `failed` that discarded a recoverable task. Vendor C produced a stream-parse exception that tore down the connection and orphaned the peer's task. 4. **No vendor was wrong per the card.** Each peer's card was internally consistent with its own behavior. The orchestrator's assumption — that a schema-valid card implies a lifecycle the orchestrator can drive — was the defect. ## Condition of Validity The invariant holds and the guardrail is required **only** under the following conjunction, and the guardrail is unnecessary (and may be skipped) otherwise: - The orchestrator drives tasks through a **polling or streaming state machine** (i.e., it uses `tasks/get` or `tasks/resubscribe` and reacts to `TaskStatusUpdateEvent`), rather than fire-and-forget `message/send` with no state tracking. - The orchestrator's driver is capable of emitting or expecting an **`input-required` pause** (i.e., it supports multi-turn clarification). If the orchestrator is strictly single-shot and treats any non-terminal state as a timeout, the closure check is vacuous — but so is the orchestrator's ability to complete ambiguous tasks. - The peer is **cross-vendor** — i.e., the orchestrator did not author the peer's card and cannot assume the peer shares its state-machine implementation. When all three hold, the orchestrator MUST compute lifecycle closure before accepting the card. When the orchestrator is single-shot or the peer is same-vendor, the check is a no-op and may be elided for latency. ## Decision Boundary The boundary is a single predicate evaluated at card-acceptance time, before the card is cached and before any task is dispatched: ``` required_states = orchestrator.driver.emit_states ∪ orchestrator.driver.expect_states declared_states = card.taskLifecycle.states ∪ {SUBMITTED, WORKING, COMPLETED, FAILED, CANCELED} # A2A v1.0 mandatory floor accept iff required_states ⊆ declared_states ``` If `accept` is false, the orchestrator has exactly two legal moves, and choosing between them is the decision boundary: 1. **Reject the card and do not dispatch** — correct when the orchestrator cannot degrade its driver (e.g., it is a fixed pipeline that must pause for clarification). This preserves the invariant at the cost of interop coverage. 2. **Accept with a degraded driver** — correct only when the orchestrator can be reconfigured to *never* expect `input-required` from this peer, i.e., it pre-resolves all ambiguity before dispatch and treats the peer as single-shot. This must be recorded on the card's cache entry as `degraded_lifecycle: true` so downstream callers know the peer cannot be asked to clarify. The forbidden move — the one that produces the observed corruption — is **accepting the card unmodified and dispatching with the full driver**. That is the exact state transition that yields split-brain task records, false failures, and orphaned peer tasks. ## Operational Effect Enforcing the closure predicate at acceptance time converts three silent, late, hard-to-attribute failures into one loud, early, attributable rejection: - **Split-brain task records** (Vendor A) are eliminated: the orchestrator never dispatches a task whose driver it cannot complete, so it never times out a task the peer still considers live. - **False `failed` classifications** (Vendor B) are eliminated: the orchestrator knows at acceptance that the peer cannot pause, so it either pre-resolves ambiguity or refuses the card, rather than misreading a clarification request as a failure. - **Mid-stream protocol violations** (Vendor C) are eliminated: non-standard states like `"paused"` are caught at card time (the card's declared state set is checked against the A2A v1.0 enum), not at event-parse time when the connection is already live. The residual cost is interop coverage: some peers whose cards omit `input-required` will be refused by strict orchestrators. That is the correct trade — a refused card is a bounded, logged, retryable event; a corrupted task record is an unbounded, silent, cross-vendor state divergence. The guardrail must run **before caching**, because card caches (often TTL'd at 5–60 minutes) will otherwise propagate a bad acceptance across every task dispatched in the window, amplifying a single negotiation gap into a burst of corrupted tasks. ```python import enum from dataclasses import dataclass, field from typing import FrozenSet class LifecycleClosureError(RuntimeError): """Raised when a peer Agent Card's declared task lifecycle is not closed under the transitions the orchestrator's driver will actually drive.""" class TaskState(enum.Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" # A2A v1.0 mandatory floor: every conformant peer must honor these. MANDATORY_FLOOR: FrozenSet[TaskState] = frozenset({ TaskState.SUBMITTED, TaskState.WORKING, TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED, }) @dataclass(frozen=True) class AgentCard: name: str declared_states: FrozenSet[TaskState] # True if the peer emitted a state outside the v1.0 enum (e.g. "paused"). has_nonstandard_states: bool = False @dataclass(frozen=True) class DriverProfile: emit_states: FrozenSet[TaskState] expect_states: FrozenSet[TaskState] @property def required_states(self) -> FrozenSet[TaskState]: return self.emit_states | self.expect_states @dataclass class CacheEntry: card: AgentCard degraded_lifecycle: bool = False def validate_card_for_dispatch( card: AgentCard, driver: DriverProfile, *, can_degrade: bool, ) -> CacheEntry: """Enforce lifecycle closure before the card is cached or any task dispatched. Returns a CacheEntry marked degraded_lifecycle=True iff the card was accepted under a degraded (single-shot) driver. Raises LifecycleClosureError otherwise. """ if card.has_nonstandard_states: raise LifecycleClosureError( f"peer {card.name!r} declares states outside the A2A v1.0 enum; " f"cannot safely parse its status stream" ) if not MANDATORY_FLOOR.issubset(card.declared_states): missing = MANDATORY_FLOOR - card.declared_states raise LifecycleClosureError( f"peer {card.name!r} omits mandatory floor states: " f"{sorted(s.value for s in missing)}" ) required = driver.required_states declared = card.declared_states gap = required - declared if not gap: # Closed under the driver's transitions: accept unmodified. return CacheEntry(card=card, degraded_lifecycle=False) # Gap exists (typically INPUT_REQUIRED). Two legal moves only. if can_degrade: # Orchestrator will pre-resolve ambiguity and treat peer as single-shot. return CacheEntry(card=card, degraded_lifecycle=True) # Orchestrator cannot degrade its driver -> must refuse the card. raise LifecycleClosureError( f"peer {card.name!r} cannot be driven by this orchestrator: " f"lifecycle not closed under required states " f"{sorted(s.value for s in gap)}; " f"driver cannot degrade to single-shot" ) if __name__ == "__main__": # Orchestrator that pauses for clarification. full_driver = DriverProfile( emit_states=frozenset({TaskState.INPUT_REQUIRED}), expect_states=frozenset({TaskState.INPUT_REQUIRED}), ) # Vendor A: three-state card, no input-required. vendor_a = AgentCard( name="vendor-a-planner", declared_states=frozenset({ TaskState.SUBMITTED, TaskState.WORKING, TaskState.COMPLETED, TaskState.FAILED, TaskState.CANCELED, }), ) # Strict path: must reject rather than dispatch and deadlock. try: validate_card_for_dispatch(vendor_a, full_driver, can_degrade=False) except LifecycleClosureError as exc: print(f"REJECTED at acceptance time: {exc}") # Degraded path: accept, but record the degradation for downstream callers. entry = validate_card_for_dispatch(vendor_a, full_driver, can_degrade=True) assert entry.degraded_lifecycle is True print("ACCEPTED with degraded_lifecycle=True; peer treated as single-shot") ```