# In what scenarios must an instance reject a peer Agent Card whose declared `taskState` transitions are acyclic but non-covering, and how does late artifact negotiation strand a task in `input-required`? **Date of Record:** 2026 November 30 **Scope:** Applies to A2A v1.0 peers that publish Agent Cards advertising `skills[].inputModes`/`outputModes` and a task lifecycle whose `status.state` transitions are validated against the card's declared `capabilities` and artifact MIME contracts. Does not cover transport-level retries, TLS identity binding, or push-notification delivery, which are governed by separate invariants. ## Core Distinction The failure that matters here is not a *cyclic* state machine (which is trivially detectable and rejected at card-fetch time) nor a *missing* skill (which surfaces as a clean `MethodNotFound`). The non-obvious boundary is the **acyclic-but-non-covering transition graph**: a peer's Agent Card declares a DAG of `taskState` transitions that contains no cycle and passes every syntactic validator, yet omits the transition needed to *exit* a state the peer itself can enter. The canonical instance is a card that declares `submitted → working → input-required → working → completed` but does **not** declare `input-required → failed` and does **not** declare `input-required → canceled`. This is distinct from a schema mismatch because the card is internally consistent: every declared transition is legal, the graph is a DAG, and the peer will faithfully honor each edge. The defect is a *reachability hole*: once the peer's own reasoning enters `input-required` (e.g., because a required artifact mode was not negotiated up front), the only declared exits are back into `working`, which re-enters the same state when the artifact contract still cannot be satisfied. The task is not deadlocked in the classical sense—`working` is nominally live—but the *product* of the state machine with the artifact-negotiation lattice has no terminal accepting state reachable under the negotiated MIME set. The operational invariant that this violates: **for every state `s` reachable from `submitted`, the card must declare at least one path from `s` to a terminal state (`completed`, `failed`, `canceled`) that is satisfiable under the card's own declared `inputModes`/`outputModes`.** A card that satisfies reachability but not *satisfiability-under-its-own-artifact-contract* is the trap. ## What Was Observed A coordinator agent (`A`) discovered a worker (`B`) via `/.well-known/agent-card.json`. `B`'s card declared: - `skills[0].inputModes = ["text/plain", "application/json"]` - `skills[0].outputModes = ["application/json", "image/png"]` - lifecycle: `submitted→working`, `working→input-required`, `input-required→working`, `working→completed`, `working→failed`, `working→canceled`. Note the hole: `input-required` has exactly one outbound edge, back to `working`. There is no `input-required→failed` and no `input-required→canceled`. `A` sent a task with `acceptedOutputModes = ["application/json"]` (it did not need `image/png`). `B` entered `working`, then—during its own multi-step reasoning—decided it needed to emit a `image/png` preview to satisfy an internal sub-goal, and transitioned to `input-required` requesting that `A` widen `acceptedOutputModes` to include `image/png`. `A`'s policy forbids accepting `image/png` (downstream consumer cannot decode it), so `A` did not widen the set. `B`, per its card, could only transition `input-required→working`. It re-entered `working`, re-derived the same sub-goal, and transitioned back to `input-required`. `A` observed 41 `working↔input-required` transitions over 6 minutes, each carrying a fresh `status.message` with a monotonically increasing `timestamp` but an identical `metadata.artifactRequest` hash. `A`'s own task-lifecycle guardrail was keyed on *state equality* (`if state == previous_state: escalate`), so it never fired: the state was alternating, not repeating. `A` had no declared edge to `canceled` from `input-required` in *its own* bookkeeping either, because it had projected `B`'s card verbatim into its local state machine. The task stranded until a 15-minute wall-clock timeout in `A`'s supervisor, which is outside the A2A protocol—i.e., the protocol-level state machine never reached a terminal state; a non-protocol timer did. The replay of the transcript later showed the root cause was **artifact negotiation performed lazily**: `B` did not validate that its full output-mode set was a subset of `A`'s `acceptedOutputModes` at `submitted`, only at the moment it chose to emit each artifact. Lazy negotiation is legal under A2A v1.0 (the spec permits `input-required` to request artifact widening), but combined with a non-covering exit set it converts a recoverable negotiation into an unbounded loop. ## Condition of Validity The guardrail below is valid **only** under these conditions, and must not be over-applied: 1. **The peer's card is the sole source of truth for its transitions.** If the peer is known to implement transitions not declared in its card (out-of-band version skew), the reachability check is unsound and you must fall back to the protocol's `failed` terminal via explicit `tasks/cancel`. 2. **`acceptedOutputModes` is fixed for the task's lifetime.** If your own policy permits mid-task widening (e.g., a human approves `image/png` on demand), then `input-required→working` *is* a satisfiable exit and the hole is benign. The invariant is about *satisfiability under a fixed artifact contract*, not about graph shape alone. 3. **The peer honors `tasks/cancel` from `input-required`.** A2A v1.0 permits a server to reject cancellation; if the peer's card does not declare `input-required→canceled`, you cannot assume it will accept a cancel from that state. This is precisely why the check must run at discovery time, before you commit. 4. **You are the coordinator, not the worker.** A worker projecting a client's expectations has no authority to reject the client's card; it must instead refuse the task at `submitted` with `failed` and a `metadata.reason = "artifact-contract-unsatisfiable"`. Under any of these conditions failing, the correct action is to *not* enter the task at all, or to enter with an explicit pre-negotiated artifact contract and a declared escape edge. ## Decision Boundary The boundary is a single predicate evaluated **before** the first `tasks/send`: > For the chosen skill `k` and your fixed `acceptedOutputModes = M`, let `R` be the set of states reachable from `submitted` in `B`'s declared transition graph. For each `s ∈ R`, there must exist a path from `s` to some terminal `t ∈ {completed, failed, canceled}` such that every edge on the path is declared **and** the artifact modes required to traverse `input-required` states along that path are contained in `M`. If the predicate holds → proceed. If it fails → **reject at discovery**, do not send. If it is *undecidable* (card omits transitions entirely, i.e., declares an open graph) → proceed only with a pre-committed `tasks/cancel` fallback and a hard supervisor timer, and log the card hash so the peer's card revision can be correlated with the eventual strand. The subtle part: the predicate is **not** "is the graph a DAG" (it always is, or the card is rejected outright) and **not** "does `input-required` have an exit" (it does—back to `working`). It is "does `input-required` have an exit *that is satisfiable under the modes I will actually accept*." A card can be a perfect DAG and still be non-covering under your artifact contract. That is the boundary. ## Operational Effect Applying the predicate at discovery converts a runtime strand into a discovery-time rejection with a deterministic, replayable reason code. The operational consequences: - **Latency:** one extra graph traversal over a card with `O(states + edges)` size, typically < 1 ms, versus a 15-minute supervisor timeout in the failure case. - **Blast radius:** the rejection is local to `A`; no task is created, no `B`-side state is allocated, and `B`'s `working↔input-required` loop never starts. - **Replay determinism:** the rejection is a pure function of `(card_hash, acceptedOutputModes)`, so two coordinators with the same policy reach the same verdict—critical for multi-agent consensus where a second auditor must reproduce the first's decision. - **Failure attribution:** when the predicate *cannot* be evaluated (open graph), the supervisor timer must be tagged `non-protocol-timeout` so post-mortems do not misattribute the strand to a protocol deadlock. The residual risk is **card drift**: `B` may revise its card between discovery and task execution. Mitigate by pinning the card hash into the task's `metadata` and re-validating on any `input-required` whose `metadata.artifactRequest` references a mode outside the pinned set—at which point the coordinator must transition its *own* projection to `failed` rather than re-enter `working`, because the peer's declared exit is unsatisfiable under the pinned contract. ```python from dataclasses import dataclass from typing import FrozenSet, Mapping TERMINAL = frozenset({"completed", "failed", "canceled"}) class NonCoveringAgentCardError(RuntimeError): """Raised when a peer Agent Card is acyclic but has no satisfiable path from a reachable state to a terminal state under the pinned acceptedOutputModes. This is a discovery-time rejection, not a runtime strand.""" @dataclass(frozen=True) class AgentCard: card_hash: str transitions: Mapping[str, FrozenSet[str]] # state -> declared successors skill_output_modes: FrozenSet[str] # modes peer may emit input_required_modes: FrozenSet[str] # modes peer requests on input-required def _reachable(transitions: Mapping[str, FrozenSet[str]], start: str = "submitted") -> FrozenSet[str]: seen, frontier = set(), [start] while frontier: s = frontier.pop() if s in seen: continue seen.add(s) frontier.extend(transitions.get(s, frozenset()) - seen) return frozenset(seen) def _has_satisfiable_exit( transitions: Mapping[str, FrozenSet[str]], card: AgentCard, state: str, accepted: FrozenSet[str], visited: FrozenSet[str] = frozenset(), ) -> bool: if state in TERMINAL: return True if state in visited: # cycle guard; cards are DAGs but be defensive return False # If this state forces artifact widening, the widening must be within `accepted`. if state == "input-required" and not card.input_required_modes.issubset(accepted): return False return any( _has_satisfiable_exit(transitions, card, nxt, accepted, visited | {state}) for nxt in transitions.get(state, frozenset()) ) def validate_card(card: AgentCard, accepted_output_modes: FrozenSet[str]) -> None: reachable = _reachable(card.transitions) for s in reachable: if s in TERMINAL: continue if not _has_satisfiable_exit(card.transitions, card, s, accepted_output_modes): raise NonCoveringAgentCardError( f"card {card.card_hash}: state {s!r} has no satisfiable path to a " f"terminal state under acceptedOutputModes={sorted(accepted_output_modes)}; " f"peer input-required modes={sorted(card.input_required_modes)}. " f"Rejecting at discovery to avoid working<->input-required strand." ) def send_task(card: AgentCard, accepted_output_modes: FrozenSet[str], payload: dict) -> dict: validate_card(card, accepted_output_modes) return {"taskId": payload["taskId"], "pinnedCardHash": card.card_hash, "acceptedOutputModes": sorted(accepted_output_modes)} if __name__ == "__main__": bad = AgentCard( card_hash="sha256:deadbeef", transitions={ "submitted": frozenset({"working"}), "working": frozenset({"input-required", "completed", "failed", "canceled"}), "input-required": frozenset({"working"}), # <-- the hole: no terminal exit }, skill_output_modes=frozenset({"application/json", "image/png"}), input_required_modes=frozenset({"image/png"}), ) # Coordinator policy forbids image/png -> input-required is unsatisfiable. send_task(bad, frozenset({"application/json"}), {"taskId": "t-1"}) ```