# When must an instance refuse an A2A v1.0 Agent Card whose advertised capabilities diverge from the task lifecycle it can actually commit to **Date of Record:** 2026 November 17 **Scope:** Applies to A2A v1.0 clients that perform Agent Card discovery (`/.well-known/agent-card.json`) and then drive tasks through the `submitted → working → input-required → completed/failed/canceled` lifecycle with artifact negotiation. Does not apply to stateless single-shot request/response endpoints that never expose a task resource, nor to pre-1.0 A2A drafts that lack the `capabilities` and `defaultInputModes`/`defaultOutputModes` fields. ## Core Distinction The Agent Card is a *declaration*, not a *contract enforcement mechanism*. Discovery yields a snapshot of what an agent claims it can do — supported input/output MIME modes, streaming and push-notification capability flags, and (in v1.0) an `extensions` block. The task lifecycle is a *runtime state machine* whose legal transitions depend on capabilities the card may have advertised but the running instance may not honor. The non-obvious boundary is this: a card can be internally consistent and schema-valid while the agent behind it cannot satisfy the lifecycle transitions its own advertised capabilities imply. The failure is not "card is malformed." The failure is "card is well-formed but *unfalsifiable* until a task is already mid-flight." The distinction that matters operationally: **discovery-time validation of a card's shape is cheap and always safe; discovery-time acceptance of a card's capability claims as a binding commitment is neither.** An instance must treat the card as a hypothesis to be confirmed at the first lifecycle transition that exercises each claimed capability, and must refuse to enter a lifecycle state whose preconditions the card asserted but the agent cannot demonstrate. ## What Was Observed A client discovered an Agent Card advertising `capabilities.streaming: true`, `defaultOutputModes: ["text/plain", "application/json"]`, and an extension `a2a.ext.artifacts.incremental` with `required: false`. The client submitted a task with `acceptedOutputModes: ["application/json"]` and, per the streaming flag, opened an SSE channel expecting `TaskStatusUpdateEvent` and `TaskArtifactUpdateEvent` frames. What actually happened: the agent accepted the task (`submitted`), transitioned to `working`, then emitted a single terminal `completed` event whose artifact was `text/plain` — a mode the client had *not* accepted. The streaming channel delivered zero intermediate artifact-update frames despite `streaming: true`. The card's `defaultOutputModes` had been interpreted by the agent as "what I prefer to emit," not "what I will emit given a constrained `acceptedOutputModes`." The artifact negotiation step had been silently skipped: the agent never emitted an `input-required` state to reconcile the mode mismatch, nor did it `fail` with an unsupported-mode error. It fell through to `completed` with a non-conforming artifact. A second observation compounded the first: the incremental-artifacts extension was marked `required: false`, so the client correctly did not depend on it — but the agent's `working` state never emitted the `TaskArtifactUpdateEvent` chunks that the *streaming* capability independently implied. Two orthogonal capability claims, one honoring the other's negation. The client had no way, at discovery time, to know that `streaming: true` meant "status events only, no artifact chunking." ## Condition of Validity The refusal boundary is valid — i.e., an instance *must* refuse rather than proceed — only when all of the following hold: 1. The client has already committed a task identifier and the task is in `working` or later. Before `submitted`, refusal is free; after `working`, refusal has cost (orphaned task, potential duplicate execution). 2. The card asserted a capability (`streaming`, a specific output mode, an extension) that the current task's request *depends on* — the request's `acceptedOutputModes` or `pushNotificationConfig` intersects the claim. 3. The agent has produced at least one lifecycle event that contradicts the claim (a `completed` artifact outside `acceptedOutputModes`, a missing artifact-update frame where streaming was promised, a `failed` state citing an error the card said could not occur). 4. The contradiction is *observable in the event stream*, not inferred from absence alone. Absence of an event within a timeout is weaker evidence than a positive contradicting event; only the latter justifies a hard refusal. If condition 3 fails — the agent simply hasn't emitted the expected frame yet — the correct action is a bounded wait and then a *soft* escalation (query the task via `tasks/get`), not a refusal. Refusing on absence alone produces false positives against slow-but-correct agents. ## Decision Boundary The boundary is between **tolerating a capability gap** and **refusing the task as non-conforming**. Tolerate when: the gap is recoverable (the agent can be re-prompted into `input-required` to renegotiate the mode), the extension was `required: false`, or the contradicting event is a `failed` state that names a transient cause. Refuse when: the agent has emitted a *terminal* artifact that violates `acceptedOutputModes` (the task is `completed` and cannot be corrected without a new task), or the agent has silently dropped a capability the request made load-bearing (streaming requested, only terminal event delivered, no `input-required` offered). The asymmetry that makes this a real boundary rather than a style preference: a tolerated gap that reaches `completed` with a non-conforming artifact has already *consumed* the task's lifecycle budget. You cannot transition a `completed` task back to `input-required`. The refusal must fire at the *first* terminal-adjacent contradiction, which in practice is the artifact-update-or-completion event itself. Waiting for a subsequent `tasks/get` to confirm is too late — the state machine has no reverse edge. ## Operational Effect An instance that enforces this boundary converts a silent data-corruption failure (accepting a `text/plain` artifact when `application/json` was demanded) into a loud, attributable one (`NonConformingArtifactError` at the completion event). The operational cost is a small increase in false refusals against agents with sloppy-but-recoverable streaming implementations; the benefit is that non-conforming artifacts never enter the downstream pipeline where they are indistinguishable from conforming ones. The card's capability claims become *falsifiable at first use* rather than *trusted until corruption*. For multi-agent orchestrators, this is the difference between a fan-out that fails one branch loudly and a fan-out that silently merges a wrong-typed artifact into a downstream task's input. ```python from __future__ import annotations from dataclasses import dataclass from enum import Enum from typing import Iterable class LifecycleState(str, Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" COMPLETED = "completed" FAILED = "failed" CANCELED = "canceled" class NonConformingArtifactError(RuntimeError): """Raised when a terminal artifact violates the negotiated output modes or contradicts a capability the Agent Card advertised as load-bearing.""" @dataclass(frozen=True) class AgentCard: streaming: bool output_modes: frozenset[str] required_extensions: frozenset[str] @dataclass(frozen=True) class TaskRequest: accepted_output_modes: frozenset[str] requires_streaming: bool @dataclass(frozen=True) class LifecycleEvent: state: LifecycleState artifact_mode: str | None = None is_artifact_update: bool = False def assert_conforming_completion( card: AgentCard, request: TaskRequest, events: Iterable[LifecycleEvent], ) -> None: """Enforce the discovery-vs-lifecycle boundary. Refuses only when a terminal-adjacent event positively contradicts a capability the request made load-bearing. Absence alone is not refusal grounds; a contradicting terminal artifact is. """ saw_artifact_update = False for event in events: if event.is_artifact_update: saw_artifact_update = True if event.state is not LifecycleState.COMPLETED: continue # Terminal artifact must satisfy accepted output modes. if event.artifact_mode is not None and event.artifact_mode not in request.accepted_output_modes: raise NonConformingArtifactError( f"Agent '{card}' completed with artifact mode " f"{event.artifact_mode!r} outside accepted modes " f"{sorted(request.accepted_output_modes)}; card advertised " f"{sorted(card.output_modes)}. State machine has no reverse " f"edge from completed." ) # Streaming was load-bearing but no incremental artifact update ever # arrived, and the agent did not offer input-required to renegotiate. if request.requires_streaming and card.streaming and not saw_artifact_update: raise NonConformingArtifactError( "Card advertised streaming: true and request required it, but " "no TaskArtifactUpdateEvent was observed before completion; " "agent dropped a load-bearing capability without offering " "input-required renegotiation." ) def discover_and_validate(card: AgentCard, request: TaskRequest) -> None: """Cheap discovery-time check: never refuse on shape alone, but reject requests whose load-bearing needs the card explicitly disclaims.""" if request.requires_streaming and not card.streaming: raise NonConformingArtifactError( "Request requires streaming but Agent Card disclaims it; refusing " "before task submission (free refusal, no lifecycle cost)." ) if not (request.accepted_output_modes & card.output_modes): raise NonConformingArtifactError( f"No intersection between accepted modes " f"{sorted(request.accepted_output_modes)} and advertised " f"{sorted(card.output_modes)}; refusal at discovery is free." ) ```