# When must an instance refuse an A2A task acceptance that the peer's Agent Card advertises as supported **Date of Record:** 2026 November 15 **Scope:** Applies to A2A v1.0 task lifecycle negotiation between an orchestrating client agent and a remote agent whose declared capabilities are read from an Agent Card and whose actual behavior is observed only through `tasks/send`, `tasks/get`, and streamed task updates. Does not apply to intra-process agent delegation, to A2A pre-1.0 drafts without `TaskState` negotiation, or to capability claims carried only in transport-level headers rather than the Agent Card. ## Core Distinction The Agent Card is a *declaration of intent*, not a *contract of enforcement*. A remote agent can advertise `capabilities.streaming: true`, `capabilities.pushNotifications: true`, and a `defaultInputModes`/`defaultOutputModes` set that includes `application/json`, while its runtime silently degrades to blocking `tasks/send` semantics, drops `TaskStatusUpdateEvent` frames after the first `TaskState.working`, or rejects artifact MIME types it lists because the *negotiation* is per-task and the *card* is per-agent. The distinction that matters operationally is between **capability advertisement** (agent-scoped, static, cached, versioned by card revision) and **capability acceptance** (task-scoped, dynamic, negotiated per `message/send`, and revocable mid-task). A client that treats the first as a guarantee of the second will accept a task it cannot complete and will hang or corrupt its own state machine waiting for a stream that will never arrive. ## What Was Observed In a cross-vendor deployment, an orchestrator read a peer's card advertising `streaming: true` and `TaskState` transitions through `input-required`. The orchestrator sent `message/send` with `configuration.blocking: false` and `acceptedOutputModes: ["application/json"]`, then awaited a `TaskStatusUpdateEvent` with `state: "input-required"`. The peer accepted the task (`state: "submitted"`), emitted one `working` event, and then—because its card's `streaming` flag reflected a *feature flag default* rather than its deployed configuration—never emitted further events. The task was, on the peer side, actually blocked awaiting input that the orchestrator had no signal to provide. The orchestrator's per-task timeout was 300s; the peer's task TTL was 600s. The orchestrator timed out, issued `tasks/cancel`, and received `TaskState.canceled`—but the peer had already begun side-effecting work (an outbound HTTP call) because its `working` handler was not idempotent under cancellation. The reconciliation required a manual `tasks/get` audit and a compensating action. The non-obvious part: the failure was not a protocol violation. Every frame the peer sent was valid A2A v1.0. The card was not *lying* in the sense of a malformed document; it was stale relative to the peer's runtime. The invariant that broke was the client's implicit assumption that *card revision* and *runtime configuration* are atomically consistent. They are not, and A2A v1.0 does not require them to be. ## Condition of Validity The refusal rule below is valid only when all of the following hold: 1. The client has cached the peer's Agent Card and the card's `revision` (or ETag/`If-None-Match` validator) has not been re-fetched since the last successful task completion with that peer, **or** the card was fetched but the client has no prior successful task to corroborate it. 2. The task requires a capability that is *stateful across turns* (streaming continuation, `input-required` resumption, push-notification callback) rather than a single request/response. 3. The client cannot afford the peer's side effects being non-idempotent under cancellation (i.e., the task is not safely retryable). If condition 1 fails—card freshly fetched and corroborated by a recent successful task—the client may accept on advertisement alone. If condition 2 fails—stateless single-shot task—the streaming/continuation claim is irrelevant and refusal is over-cautious. If condition 3 fails—task is idempotent and cheap to retry—the client should accept and rely on timeout+cancel+retry rather than refusing. ## Decision Boundary The boundary is crossed when the *cost of a false acceptance* (peer advertises but does not enforce a stateful capability) exceeds the *cost of a false refusal* (peer would have honored it, client needlessly degrades to polling or declines). Concretely: - **Accept on advertisement** when the task is single-shot, idempotent, or has a bounded side-effect budget, and the client can fall back to `tasks/get` polling within its own deadline. - **Refuse and require corroboration** when the task requires `input-required` resumption or push callbacks *and* the client has no prior successful corroborated task with this peer *and* the task's side effects are non-idempotent under cancellation. - **Refuse outright** (do not even send `message/send`) when the peer's card advertises a `defaultInputModes` that excludes the client's mandatory payload MIME type—this is a hard incompatibility, not a stale-flag risk, and sending wastes a task slot and may trigger peer-side validation side effects. The subtle case is the middle: the client should not refuse the *task* but should refuse the *streaming continuation contract*, downgrading to polling and setting a `tasks/get` cadence shorter than the peer's likely TTL. This is the "conditional acceptance" the code below encodes. ## Operational Effect Enforcing this boundary converts a class of silent hangs and orphaned side effects into a fast, explicit `CapabilityCorroborationError` at negotiation time. The client's task state machine no longer depends on a peer's feature-flag consistency; it depends on observed behavior. The cost is one extra `tasks/get` round-trip on first contact with an uncorroborated peer, and a degraded (polling) path for stateful tasks until corroboration succeeds. In the incident above, applying the rule would have downgraded the orchestrator to polling, observed the `working`-without-progress state at the first poll interval, and issued `tasks/cancel` *before* the peer's non-idempotent outbound call fired—because the client's poll cadence (5s) was well inside the peer's pre-side-effect window. The rule does not make the peer honest; it makes the client's assumptions explicit and its failure mode bounded. ```python from __future__ import annotations import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class CapabilityCorroborationError(RuntimeError): """Raised when a peer's advertised capability cannot be trusted for a stateful, non-idempotent task and no prior corroboration exists.""" class TaskShape(Enum): SINGLE_SHOT = "single_shot" # one request/response, no continuation STATEFUL = "stateful" # requires input-required / streaming continuation @dataclass class AgentCardView: revision: str streaming: bool push_notifications: bool input_modes: set[str] output_modes: set[str] @dataclass class PeerTrustState: """Tracks whether a card revision has been corroborated by observed behavior.""" corroborated_revisions: set[str] = field(default_factory=set) last_successful_task_at: Optional[float] = None def corroborate(self, revision: str) -> None: self.corroborated_revisions.add(revision) self.last_successful_task_at = time.monotonic() def is_corroborated(self, revision: str) -> bool: return revision in self.corroborated_revisions def negotiate( card: AgentCardView, trust: PeerTrustState, task_shape: TaskShape, required_output_mode: str, side_effects_idempotent: bool, client_deadline_s: float, ) -> str: """Return one of 'accept', 'accept_degraded_poll', or raise. Raises CapabilityCorroborationError when the task is stateful, non-idempotent, and the card revision is uncorroborated. """ # Hard incompatibility: never send a task whose required MIME is not # in the advertised output modes. This is not a stale-flag risk. if required_output_mode not in card.output_modes: raise CapabilityCorroborationError( f"peer card revision {card.revision} does not advertise " f"output mode {required_output_mode!r}; refusing to send task" ) if task_shape is TaskShape.SINGLE_SHOT: return "accept" # Stateful task. Streaming/continuation claims are only trustworthy # if the revision has been corroborated by prior observed success. if trust.is_corroborated(card.revision) and card.streaming: return "accept" if side_effects_idempotent: # Cheap to retry; accept and rely on timeout + cancel + retry. return "accept" # Stateful, non-idempotent, uncorroborated, streaming advertised but # unproven. Do not accept the streaming continuation contract. if card.streaming and not trust.is_corroborated(card.revision): # Degrade to polling with a cadence well inside the peer's TTL. poll_cadence = min(5.0, client_deadline_s / 6.0) if poll_cadence <= 0: raise CapabilityCorroborationError( f"deadline {client_deadline_s}s too tight to poll peer " f"revision {card.revision} safely" ) return "accept_degraded_poll" # Peer does not even advertise streaming for a stateful task. raise CapabilityCorroborationError( f"peer revision {card.revision} advertises streaming={card.streaming} " f"but task requires input-required continuation and side effects are " f"non-idempotent; refusing acceptance" ) def run_negotiation_example() -> str: card = AgentCardView( revision="rev-7", streaming=True, push_notifications=False, input_modes={"application/json"}, output_modes={"application/json"}, ) trust = PeerTrustState() # fresh peer, nothing corroborated try: return negotiate( card=card, trust=trust, task_shape=TaskShape.STATEFUL, required_output_mode="application/json", side_effects_idempotent=False, client_deadline_s=300.0, ) except CapabilityCorroborationError: raise ```