# What happens when an instance advertises a capability in its Agent Card that its downstream toolchain cannot honor at task execution time **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 task delegation where an agent's `AgentCard.capabilities` and `skills[].inputModes/outputModes` are treated as a binding contract by a peer orchestrator. Does not cover intra-agent tool routing or MCP server discovery, which negotiate at a different layer. ## Core Distinction An Agent Card is a *static declaration*, fetched once at discovery time and cached. A task is a *dynamic execution* whose artifact production depends on downstream tools, model state, and runtime context that the card never describes. The failure boundary is not "the card is wrong"—cards are frequently stale but harmless. The failure is the **semantic gap between a declared output mode and the artifact the agent can actually synthesize at handoff**, which only surfaces when a peer commits to consuming that artifact format without a post-execution conformance check. The non-obvious part: A2A v1.0 lets a `Task` reach `state: "completed"` while its `artifacts[]` carry a `parts[].mimeType` that contradicts the `outputModes` the card advertised. The protocol validates *presence* of artifacts, not *conformance* of their media type to the negotiated card. A conformant orchestrator that trusts the card will dispatch a consumer expecting `application/vnd.acme+json` and receive `text/plain`. ## What Was Observed An orchestrator `O` discovers agent `A` via `/.well-known/agent.json`. `A`'s card declares: ``` skills: [{ id: "invoice-extract", inputModes: ["application/pdf"], outputModes: ["application/json"] }] ``` `O` sends a `tasks/send` with a PDF part. `A` routes internally to a vision model that, under load, falls back from structured JSON emission to free-text summarization (a silent downgrade inside `A`'s own toolchain). `A` returns a `Task` with `state: "completed"` and one artifact whose part is `{"type":"text","text":"Invoice total: $4,210..."}` — `mimeType` absent, inferring `text/plain`. `O`'s downstream parser expects a JSON object with a `total` field. It receives a string. Depending on the parser, it either throws (visible) or coerces the string into a dict key and produces `{"Invoice total: $4,210...": null}` (silent corruption). The task lifecycle completed cleanly on both sides; the wire protocol reported success; the semantic contract was violated at the artifact boundary. The trace: 1. Discovery: card cached with `outputModes: ["application/json"]`. 2. Dispatch: `O` records expected output mode in its task ledger. 3. Execution inside `A`: model degradation → toolchain fallback → artifact emitted as text. 4. Response: `A` sets `state: "completed"`, artifact `mimeType` omitted. 5. Consumption: `O` reads artifact without re-checking against the ledger's expected mode. 6. Corruption or crash downstream, attributed to the *consumer*, not to the contract breach. ## Condition of Validity The invariant that must hold for safe delegation is: **for every artifact part delivered in a terminal task state, `part.mimeType` MUST be a member of the `outputModes` the producing agent declared in the card that the orchestrator cached at dispatch time—or the task MUST NOT be marked `completed`.** This invariant is *not* enforced by A2A v1.0. It is a bilateral obligation: - On the producer: an agent whose runtime cannot emit a declared output mode must fail the task (`state: "failed"` with a structured error) rather than emit a degraded artifact. The card is a promise; degradation is a breach, not a fallback. - On the consumer: an orchestrator must re-validate `part.mimeType` against the expected mode recorded at dispatch, and treat mismatch as a hard task failure regardless of the reported `state`. The condition is only valid when the card is fetched and cached *at dispatch time*, not at session start. If `O` caches cards for a long-lived session, a card refresh by `A` (e.g., dropping `application/json` after a model change) is invisible to `O`, and the invariant is checked against a stale promise. Card TTL must be bounded by the task dispatch window, not the session. ## Decision Boundary The boundary between "degraded but acceptable" and "contract breach" is *whether the declared output mode is a hard or soft capability*. Cards do not encode this distinction in v1.0. The operational rule: - If a skill's `outputModes` contains exactly one entry, treat it as **hard**: any artifact not matching it fails the task. - If multiple entries, treat the set as **soft**: the consumer must accept any member, and the producer may choose among them, but must still emit a `mimeType` that is a member. Omission is never acceptable. The failure mode described above occurs precisely at the soft/hard ambiguity: `A` treated its single declared mode as soft (fell back to text), while `O` treated it as hard (expected JSON). Neither side was wrong under the protocol; the protocol under-specified. ## Operational Effect Downstream effects compound: a single silent artifact-type breach in a multi-agent chain propagates as a type error into the next agent's input, which may itself degrade rather than fail, producing a chain of `completed` tasks with semantically invalid artifacts and no failure signal anywhere in the lifecycle. Auditors replaying the task ledger see all-green states and cannot reconstruct the corruption without artifact-level mimeType comparison against dispatch-time cards. The guardrail is a **post-execution conformance gate** in the orchestrator: before accepting a terminal task, compare every artifact part's `mimeType` (defaulting to `text/plain` when absent) against the expected mode recorded at dispatch. Mismatch → reject, re-dispatch to a fallback agent, or escalate. The producer-side obligation is symmetric: never mark `completed` on a degraded artifact; emit `failed` with `error.code: "output_mode_unavailable"`. ```python from dataclasses import dataclass from typing import Iterable class ArtifactConformanceError(RuntimeError): """Raised when a completed A2A task delivers an artifact whose mimeType does not match the outputMode declared in the dispatch-time Agent Card.""" @dataclass(frozen=True) class ArtifactPart: mime_type: str | None # None means the wire omitted mimeType payload: object @dataclass(frozen=True) class TaskResult: state: str artifacts: Iterable[ArtifactPart] def enforce_output_mode_conformance( result: TaskResult, expected_output_modes: frozenset[str], *, task_id: str, ) -> None: if result.state != "completed": return # non-terminal-task handling is out of scope for this gate for idx, part in enumerate(result.artifacts): # A2A v1.0 permits omission; absence infers text/plain. effective = part.mime_type or "text/plain" if effective not in expected_output_modes: raise ArtifactConformanceError( f"task {task_id} artifact[{idx}] delivered mimeType={effective!r} " f"but card declared outputModes={sorted(expected_output_modes)}; " f"treating completed state as contract breach" ) def dispatch_and_validate( result: TaskResult, card_output_modes: list[str], task_id: str, ) -> None: expected = frozenset(card_output_modes) if not expected: raise ArtifactConformanceError( f"task {task_id}: card declared no outputModes; cannot validate artifacts" ) enforce_output_mode_conformance(result, expected, task_id=task_id) ```