# Under what conditions must an instance reject a delegated task when the remote agent-card advertises a capability that the remote runtime cannot honor at execution time **Date of Record:** 2026 November 26 **Scope:** Applies to A2A v1.0 task delegation where a client agent discovers a remote agent via its `AgentCard` and dispatches a `tasks/send` (or streaming equivalent) across vendor boundaries. Does not apply to intra-process tool calls, MCP server calls within a single trust domain, or A2A versions prior to card-based capability advertisement. ## Core Distinction The failure mode is not "the remote agent returned an error." It is the gap between **card-time capability declaration** and **execution-time capability realization**. An `AgentCard` is a static, cached, self-asserted document. It declares `skills`, `capabilities` (streaming, pushNotifications, stateTransitionHistory), `defaultInputModes`/`defaultOutputModes`, and authentication schemes. None of these are cryptographically bound to the runtime that answers `tasks/send`. The card is a promise; the task is the settlement. The boundary condition is that a client can successfully negotiate against a card, dispatch a well-formed task, receive a syntactically valid `Task` object with `state: "working"`, and *still* be delegating into a runtime that will silently degrade, drop streaming frames, or fail to honor `stateTransitionHistory` — because the card was served by a gateway (or a stale replica) that does not front the same execution surface the task lands on. The non-obvious invariant: **card capability claims must be re-validated against the first observable execution artifact, not trusted from the card.** A card that says `capabilities.streaming: true` is only true if the first `TaskStatusUpdateEvent` actually arrives over the negotiated transport within the declared timeout. Until that artifact is observed, the claim is unverified. ## What Was Observed A client orchestrator (vendor A) discovered a remote agent (vendor B) at `https://b.example/.well-known/agent.json`. The card declared: - `capabilities.streaming: true` - `capabilities.stateTransitionHistory: true` - `skills[0].inputModes: ["text/plain", "application/json"]` - `skills[0].outputModes: ["application/json"]` - `authentication.schemes: ["Bearer"]` The client dispatched a `tasks/sendSubscribe` with `acceptedOutputModes: ["application/json"]` and a JSON payload. The remote returned HTTP 200 with a `Task` in `state: "submitted"`, then transitioned to `working`. Then the SSE stream went silent for 90 seconds — no `TaskStatusUpdateEvent`, no `TaskArtifactUpdateEvent`. The client's read timeout fired, it issued `tasks/get`, and received `state: "working"` with `history` absent despite `stateTransitionHistory: true`. Root cause, reconstructed from the remote's behavior: the card was served by a stateless edge gateway that proxied `/tasks/send` to a pool of workers, but the streaming endpoint was backed by a different pool whose workers did not share the task store. The `tasks/sendSubscribe` call had been accepted by a worker that held the task in local memory; the subsequent `tasks/get` was routed to a *different* worker with no record of the task, so it returned a default `working` shell with no history. The card's `stateTransitionHistory: true` was true for the gateway's *intended* architecture, not for the actual routing topology. The client had no way to distinguish "slow task" from "task orphaned by routing." A second, sharper variant: vendor C's card advertised `inputModes: ["text/plain", "application/json"]`, but the `application/json` handler on the runtime rejected any payload not matching a vendor-proprietary schema, returning `-32602 Invalid params` *after* accepting the task and transitioning to `working`. The client saw a task that entered `working` and then failed with a protocol-level error rather than a `Task` state transition to `failed`. The failure was reported out-of-band, violating the A2A contract that task lifecycle is expressed through `Task.state`. ## Condition of Validity The re-validation guardrail is valid — and the card claim is trustworthy — only when all of the following hold: 1. The first execution artifact (`TaskStatusUpdateEvent` with `state: "working"` or the first `TaskArtifactUpdateEvent`) arrives within `min(card.advertisedTimeout, client.readTimeout)` and is *correlated to the dispatched task ID*. 2. A `tasks/get` issued immediately after the first artifact returns a `Task` whose `history` length is monotonically non-decreasing across successive polls (this is the only reliable probe for `stateTransitionHistory`). 3. The `outputModes` actually emitted in artifacts match the `acceptedOutputModes` the client sent, and are a subset of the card's declared `outputModes`. 4. The remote's error responses for malformed input arrive as `Task.state: "failed"` transitions, not as JSON-RPC errors after `working`. If any of these fail, the card claim is **unverified or false for this task**, and the client must treat the delegation as failed — not retry against the same card, but re-discover or downgrade. ## Decision Boundary The client must **reject the delegation** (abort, mark the remote as degraded in its discovery cache, and not re-dispatch) when: - The first artifact does not arrive within the timeout **and** a follow-up `tasks/get` returns a `Task` with no `history` while the card claimed `stateTransitionHistory: true`. This is the orphaned-task signature; retrying will hit a different worker with the same result or a duplicate execution. - A JSON-RPC error arrives *after* the task entered `working`. This indicates the runtime's error surface is out-of-band; the client cannot trust `Task.state` as the source of truth for this peer. - The emitted artifact `mimeType` is not in the client's `acceptedOutputModes` and not in the card's declared `outputModes`. This is a schema-negotiation mismatch that will recur on every task. The client must **not** reject merely because the first artifact is slow, if `tasks/get` shows a growing `history`. Slow-but-consistent is a latency problem, not an interoperability failure. The distinguishing signal is *history growth*, not wall-clock time. The client must **downgrade** (proceed without streaming, poll via `tasks/get`) when the card claims `streaming: true` but the SSE connection closes cleanly after `submitted` with no further events, while `tasks/get` continues to show state progress. Streaming is an optimization; its absence is not a correctness failure. ## Operational Effect The practical consequence is that a client agent's discovery cache must store, per remote peer, a **capability confidence record** — not the card's claims, but the claims *as last validated by execution artifacts*. The cache entry is keyed by `(agentUrl, cardEtag)` so that a card update invalidates the confidence record. Each entry tracks: `streamingVerified`, `historyVerified`, `errorSurfaceInBand`, `lastValidatedAt`. A delegation is only dispatched with full optimism (streaming, history-dependent reasoning) when the relevant flags are set; otherwise the client uses the conservative path. This converts the A2A card from a trusted declaration into a **hypothesis that the first task must confirm**. The cost is one round-trip of validation per peer per card-version; the benefit is that cross-vendor delegation fails *at the boundary* (fast, attributable, cacheable) rather than *mid-task* (slow, ambiguous, with orphaned remote state the client cannot clean up because it cannot address the worker that holds it). The invariant, stated operationally: **a client may only rely on a card capability for a task if that capability has been observed in a prior execution artifact from the same `(agentUrl, cardEtag)` pair, or if the current task's first artifact confirms it.** Card claims alone are insufficient warrant for cross-vendor delegation. ```python import time from dataclasses import dataclass, field from typing import Optional class CardClaimUnverifiedError(RuntimeError): """Raised when a remote agent-card capability claim is not confirmed by the first execution artifact for a delegated task.""" pass @dataclass class CapabilityConfidence: agent_url: str card_etag: str streaming_verified: bool = False history_verified: bool = False error_surface_in_band: bool = False last_validated_at: Optional[float] = None @dataclass class TaskArtifact: task_id: str state: str history_len: int mime_type: Optional[str] arrived_at: float is_jsonrpc_error: bool = False def validate_first_artifact( card: dict, confidence: CapabilityConfidence, dispatched_task_id: str, accepted_output_modes: list[str], first_artifact: TaskArtifact, read_timeout_s: float, ) -> CapabilityConfidence: """Re-validate card claims against the first observable execution artifact. Raises CardClaimUnverifiedError if the artifact contradicts the card in a way that makes continued delegation unsafe. """ # 1. Orphaned-task signature: history claimed but absent on first probe. if card.get("capabilities", {}).get("stateTransitionHistory") and first_artifact.history_len == 0: raise CardClaimUnverifiedError( f"card claims stateTransitionHistory but task {dispatched_task_id} " f"returned empty history on first artifact; remote likely routed " f"task to a worker without the shared store" ) # 2. Out-of-band error surface: JSON-RPC error after 'working' means # Task.state is not the source of truth for this peer. if first_artifact.is_jsonrpc_error and first_artifact.state == "working": raise CardClaimUnverifiedError( f"remote {confidence.agent_url} emitted a JSON-RPC error after " f"entering 'working'; error surface is out-of-band and Task.state " f"cannot be trusted for lifecycle" ) # 3. Output-mode schema mismatch: will recur on every task. declared = set(card.get("skills", [{}])[0].get("outputModes", [])) accepted = set(accepted_output_modes) if first_artifact.mime_type and first_artifact.mime_type not in accepted: if first_artifact.mime_type not in declared: raise CardClaimUnverifiedError( f"artifact mimeType {first_artifact.mime_type!r} is neither in " f"acceptedOutputModes {sorted(accepted)} nor in card-declared " f"outputModes {sorted(declared)}; schema negotiation is broken" ) # 4. Streaming claim: only mark verified if an event actually arrived. if card.get("capabilities", {}).get("streaming") and first_artifact.arrived_at - time.time() < read_timeout_s: confidence.streaming_verified = True confidence.history_verified = first_artifact.history_len > 0 confidence.error_surface_in_band = not first_artifact.is_jsonrpc_error confidence.last_validated_at = time.time() return confidence def dispatch_guarded( card: dict, confidence: CapabilityConfidence, accepted_output_modes: list[str], first_artifact: TaskArtifact, read_timeout_s: float, ) -> str: """Decide whether to proceed optimistically or downgrade after validation.""" try: validate_first_artifact( card, confidence, first_artifact.task_id, accepted_output_modes, first_artifact, read_timeout_s, ) except CardClaimUnverifiedError: # Mark peer degraded; caller must not re-dispatch against same etag. confidence.streaming_verified = False confidence.history_verified = False raise if confidence.streaming_verified and confidence.history_verified: return "optimistic" return "poll-only" ```