# Under what conditions must an instance treat a remote agent card's declared `defaultInputModes`/`defaultOutputModes` as non-binding, and how does silent capability narrowing during A2A v1.0 task delegation corrupt the task lifecycle state machine? **Date of Record:** 2026 November 30 **Scope:** Applies to A2A v1.0 cross-vendor delegation where a delegating agent discovers a remote agent card, negotiates a task, and relies on the card's declared capability surface to select a `Task` transition path. Does not apply to intra-process tool calls, MCP tool schemas, or same-vendor delegation where the card is generated from a shared registry with build-time validation. ## Core Distinction An A2A agent card is a *declaration*, not a *contract*. The `skills[].inputModes` and `skills[].outputModes` fields describe what the remote agent *intends* to accept, but the task lifecycle state machine (`submitted → working → input-required → completed/failed/canceled`) is driven by what the remote agent *actually* does at runtime. The boundary failure is this: a delegating agent that treats the card as authoritative will construct a task whose initial message satisfies the declared input mode, then misinterpret a subsequent `input-required` transition as a protocol error rather than a capability-narrowing signal. The card said `text/plain` was supported; the remote agent accepted the message; but the remote agent's *skill execution* (not its card) rejected the payload shape and transitioned to `input-required` with a `message` part that the delegating agent never parses because it believed the negotiation was already complete. The invariant that fails: **card-declared input modes are necessary but not sufficient for task acceptance.** The remote agent's runtime capability may be narrower than its card, and the A2A state machine is the only channel through which that narrowing is communicated. ## What Was Observed A delegating agent (vendor A) discovered a remote agent card (vendor B) advertising a `summarize-document` skill with `inputModes: ["text/plain", "application/json"]` and `outputModes: ["text/plain"]`. Vendor A selected `application/json` because its internal pipeline produced structured chunks. It submitted a `Task` with an initial `Message` whose `parts` contained a `DataPart` (JSON) and `text` field. The remote agent's card was generated at build time from a static manifest. At runtime, vendor B's skill implementation had been deployed with a feature flag that disabled JSON ingestion for that skill (a rollback of a broken parser). The card was not regenerated. The remote agent's A2A server accepted the `Task`, transitioned to `working`, then immediately transitioned to `input-required` with a `Message` containing a `TextPart` saying: "This skill currently accepts only text/plain. Please resubmit as text." Vendor A's delegation logic had a guard: if the task transitions to `input-required`, it checks whether the `input-required` message's `parts` contain a `DataPart` matching the expected schema. It did not — it contained a `TextPart`. Vendor A's code raised a `ProtocolViolation` because the card had declared `application/json` as supported, and the `input-required` payload did not conform to the card's declared input mode. Vendor A then transitioned the task to `failed` locally and emitted a `TaskStatusUpdateEvent` with `final: true`. The remote task on vendor B remained in `input-required` indefinitely, orphaned. Vendor A's orchestrator retried the delegation three times, producing three orphaned remote tasks and three local `failed` events. The failure trace: 1. Card discovery: `GET /.well-known/agent.json` returns card with `inputModes: ["text/plain", "application/json"]`. 2. Task submission: `POST /tasks` with `DataPart` payload. Remote returns `Task` with `status.state: "submitted"`. 3. Remote transitions to `working`, then `input-required` with `TextPart` message. 4. Delegating agent's `input-required` handler expects a `DataPart` (because card said JSON is supported) and raises. 5. Local task marked `failed`; remote task never canceled, never resumed. 6. Retry loop repeats steps 2–5. The corruption is not the remote agent's narrowing — that is legitimate runtime behavior. The corruption is the delegating agent's *misclassification* of the narrowing signal as a protocol violation, which prevents the `input-required → working` resumption transition that the A2A state machine was designed to support. ## Condition of Validity The failure requires all of the following to hold simultaneously: - The remote agent card declares a capability (input mode, output mode, or skill) that is *broader* than the remote agent's runtime implementation. - The delegating agent's `input-required` handler is *type-strict*: it validates the `input-required` message's `parts` against the card's declared `inputModes` and rejects non-conforming payloads. - The delegating agent does not implement a *card-refresh* or *capability-probe* step between discovery and task submission. If it re-fetches the card immediately before submission, or if it probes the skill with a minimal payload first, the narrowing is detected before the task is created. - The remote agent does not include a machine-readable `reason` or `error` field in the `input-required` status that distinguishes "capability narrowed" from "malformed input." A2A v1.0's `TaskStatus.message` is free-form; vendors rarely populate structured error codes. If the delegating agent's `input-required` handler is *permissive* — it accepts any `parts` and attempts to interpret them — the failure does not occur, but a different failure mode emerges: the delegating agent may loop indefinitely, resubmitting the same rejected payload because it cannot parse the text instruction. ## Decision Boundary The delegating agent must distinguish between two interpretations of `input-required`: 1. **Negotiation continuation:** The remote agent is asking for additional input that conforms to the card's declared input modes. The delegating agent should supply it and transition back to `working`. 2. **Capability narrowing:** The remote agent is signaling that its runtime capability is narrower than its card. The delegating agent must either (a) adapt its payload to the narrowed capability if it can infer the narrowing from the `input-required` message, or (b) cancel the remote task and re-discover the card before retrying. The decision boundary is: **if the `input-required` message's `parts` do not conform to any of the card's declared `inputModes`, treat it as capability narrowing, not as a protocol violation.** The correct action is to cancel the remote task (`POST /tasks/{id}:cancel`), re-fetch the agent card, and re-evaluate whether delegation is still viable. Raising an exception and marking the local task `failed` without canceling the remote task violates the A2A lifecycle invariant that every locally-terminal task must have a corresponding remote terminal state. A second boundary: the delegating agent must not retry a delegation that failed due to capability narrowing without first re-discovering the card. Retrying with the same payload against the same stale card produces the same orphaned-task pattern. The retry budget must be gated on a card-refresh, not on a fixed count. ## Operational Effect The operational consequence is a class of *orphaned remote tasks* that accumulate in the remote vendor's task store, consuming quota and, in metered A2A deployments, incurring cost. The delegating agent's local view shows `failed` tasks; the remote view shows `input-required` tasks that will never be resumed. Cross-vendor reconciliation is impossible because A2A v1.0 does not define a task-list or task-query endpoint that lets the delegating agent enumerate its orphaned tasks on the remote side. The guardrail is a *capability-narrowing handler* in the delegating agent's state machine: on `input-required`, validate the message's `parts` against the card's declared `inputModes`; if non-conforming, cancel the remote task, refresh the card, and re-evaluate. The handler must be idempotent and must emit a `TaskStatusUpdateEvent` with `final: true` only after the remote cancellation is acknowledged. The following code implements the guardrail as a state-machine transition validator. ```python import json from dataclasses import dataclass, field from enum import Enum from typing import Any class CapabilityNarrowingError(RuntimeError): """Raised when a remote agent's input-required payload does not conform to its card-declared inputModes, indicating runtime capability narrowing.""" pass class TaskState(Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" @dataclass class AgentCard: input_modes: list[str] output_modes: list[str] card_version: str = "unknown" @dataclass class TaskStatus: state: TaskState parts: list[dict[str, Any]] = field(default_factory=list) def _part_mime(part: dict[str, Any]) -> str | None: if "text" in part: return "text/plain" if "data" in part: return "application/json" if "file" in part: return part["file"].get("mimeType") return None def handle_input_required( card: AgentCard, status: TaskStatus, remote_task_id: str, cancel_fn, refresh_card_fn, ) -> TaskState: """Transition handler for input-required. Distinguishes negotiation continuation from capability narrowing. Returns the next local state.""" if status.state is not TaskState.INPUT_REQUIRED: raise CapabilityNarrowingError( f"handle_input_required called in state {status.state}" ) declared = set(card.input_modes) observed = {_part_mime(p) for p in status.parts} observed.discard(None) if observed and observed.issubset(declared): # Negotiation continuation: payload conforms to card. return TaskState.WORKING # Capability narrowing: the remote agent is asking for something the # card said was already acceptable, or asking in a mode the card did # not declare. Cancel the remote task before mutating local state. try: cancel_fn(remote_task_id) except Exception as exc: raise CapabilityNarrowingError( f"failed to cancel orphaned remote task {remote_task_id}: {exc}" ) from exc refreshed = refresh_card_fn() if refreshed.input_modes == card.input_modes: # Card did not change; the narrowing is runtime-only and the # delegating agent cannot adapt. Terminal failure is correct, # but only after remote cancellation. return TaskState.FAILED # Card changed: re-evaluate with the new capability surface. if observed and observed.issubset(set(refreshed.input_modes)): return TaskState.WORKING raise CapabilityNarrowingError( f"remote task {remote_task_id} narrowed to {sorted(observed)}; " f"card now declares {sorted(refreshed.input_modes)}; no viable path" ) ```