# In what scenarios must an instance reject A2A v1.0 Agent Card discovery results before task negotiation **Date of Record:** 2026 November 16 **Scope:** Applies to A2A v1.0 client instances that resolve an Agent Card, then initiate a task via `tasks/send` or `tasks/sendSubscribe` against the advertised endpoint. Does not apply to static, pre-configured peer registries where card contents are pinned out-of-band by operator policy, nor to A2A v0.x handshake flows. ## Core Distinction Agent Card *discovery* and Agent Card *trust* are separate phases, and the A2A v1.0 specification deliberately leaves them decoupled. Discovery answers "where is a card and what does it claim?" It does not answer "may this instance act on those claims?" The failure mode arises when an implementation collapses these two phases: it fetches a card from `/.well-known/agent.json`, validates it against the JSON Schema, and then immediately proceeds to task negotiation using the card's `url`, `capabilities`, and `defaultInputModes`/`defaultOutputModes`. The non-obvious boundary is this: **schema-valid is not the same as negotiation-valid.** A card can pass structural validation while advertising an endpoint, capability set, or artifact media-type contract that is internally inconsistent with the discovery source that produced it. The instance must distinguish "the card parsed" from "the card's claims are coherent with the channel over which it was delivered and with the task the caller intends to issue." ## What Was Observed During cross-vendor interop testing against three independent A2A v1.0 implementations, the following recurring condition was recorded: a card was served over TLS from `agent.example-a.net` but its `url` field pointed to `http://` (plaintext) on a *different* registrable domain, `agent.example-b.io`. The card was schema-valid. The `capabilities.streaming` flag was `true`. The `defaultInputModes` listed `application/json` and `text/plain`; `defaultOutputModes` listed `application/json`. When the client instance proceeded to `tasks/sendSubscribe` against the advertised `url`, the remote returned a `200` with an SSE stream that emitted a single `TaskStatusUpdateEvent` of state `input-required`, then closed. No artifact was ever produced. Retrying with `tasks/send` (non-streaming) against the same `url` returned `-32601 Method not found`. The card's `capabilities.streaming: true` was a claim about the *origin* server, not the *advertised* server — the two had drifted because the card was generated from a template whose `url` was populated from a deployment variable that had not been updated after a regional failover. A second observed condition: `defaultOutputModes` advertised `application/json`, but the negotiated task's artifacts were returned as `application/json; charset=utf-8` with a `Content-Type` the client's artifact parser rejected because it matched on exact string equality rather than media-type prefix. The card was correct; the client's *interpretation* of the card was too strict. ## Condition of Validity The decision to proceed from discovery to negotiation is valid only when all of the following hold simultaneously: 1. The card was retrieved over an authenticated channel (TLS with a verified chain) **and** the card's `url` resolves to a host whose certificate is valid for that host. A card delivered over `https://A` that advertises `http://B` is a downgrade claim; it is not negotiation-valid regardless of schema conformance. 2. The card's `capabilities` flags are consistent with the transport the client will actually use. If `capabilities.streaming` is `false`, the client must not select `tasks/sendSubscribe`; if `true`, the client must tolerate a server that nevertheless closes the stream after `input-required` (streaming capability is a claim of *support*, not a guarantee of *completion*). 3. The intended task's input media type is a member of `defaultInputModes` **or** the card advertises per-skill `inputModes` that include it. Absence from `defaultInputModes` with no per-skill override is a hard stop. 4. Artifact media types in `defaultOutputModes` are matched by *media-type prefix* (RFC 9110 §8.3.1), not exact string equality, so that parameterized types such as `application/json; charset=utf-8` satisfy an `application/json` advertisement. 5. The card's `version` field is `1.0` (or a `1.x` the client explicitly supports). A `0.x` card served from a `1.0` discovery path is a version-skew signal and negotiation must not proceed. If any condition fails, the instance must reject the card at the discovery boundary and surface a structured error rather than attempting negotiation and interpreting the remote's subsequent behavior. ## Decision Boundary The boundary is not "did the card validate?" but "**is the card's claim set self-consistent with the delivery context and the caller's task intent?**" Two cards with identical bytes can be negotiation-valid in one context and invalid in another: the same card is fine when the client intends only `tasks/send` with `text/plain` input, and invalid when the client intends `tasks/sendSubscribe` with `application/json` input against a card whose `defaultInputModes` omits it. The instance must therefore evaluate the card *against the pending task*, not in isolation. Discovery produces a candidate; the boundary decision is a function of `(card, delivery_channel, intended_task)`. Rejection is a local, deterministic decision made before any network call to the advertised `url`. It must never be deferred to "we'll find out when the task fails," because a failed negotiation against a drifted endpoint can leave a task in `submitted` state on the remote with no local record, producing an orphaned task and a silent cross-vendor inconsistency. ## Operational Effect Implementations that enforce this boundary report a measurable reduction in orphaned remote tasks and in "phantom capability" incidents — cases where a client believed a peer supported streaming or a given artifact type and only discovered otherwise mid-task. The cost is a small number of false rejections when a card is *stale but recoverable* (e.g., `url` drift that the operator intends to fix); these must be surfaced as `CardRejectedError` with the specific violated invariant so operators can distinguish "peer is misconfigured" from "client is too strict." The invariant to encode: **no task negotiation call may be issued against a `url` whose origin differs from the card's delivery origin unless the card explicitly carries a signed delegation or the client's policy allowlist names that origin.** Everything else is negotiable; this is not. ```python from __future__ import annotations from dataclasses import dataclass from urllib.parse import urlparse class CardRejectedError(RuntimeError): """Raised when a discovered A2A v1.0 Agent Card is not negotiation-valid for the pending task, even though it passed schema validation.""" @dataclass(frozen=True) class AgentCard: url: str version: str streaming: bool default_input_modes: tuple[str, ...] default_output_modes: tuple[str, ...] @dataclass(frozen=True) class IntendedTask: method: str # "tasks/send" or "tasks/sendSubscribe" input_media_type: str def _origin(url: str) -> tuple[str, str]: p = urlparse(url) return (p.scheme, p.netloc) def _media_type_matches(advertised: str, actual: str) -> bool: # RFC 9110 §8.3.1: match on type/subtype, ignore parameters. return advertised.split(";", 1)[0].strip().lower() == actual.split(";", 1)[0].strip().lower() def validate_card_for_task( card: AgentCard, *, delivery_origin: tuple[str, str], task: IntendedTask, allowlisted_origins: frozenset[tuple[str, str]] = frozenset(), ) -> None: card_origin = _origin(card.url) if card_origin[0] != "https": raise CardRejectedError( f"card advertises non-TLS url {card.url!r}; plaintext negotiation forbidden" ) if card_origin != delivery_origin and card_origin not in allowlisted_origins: raise CardRejectedError( f"card url origin {card_origin!r} differs from delivery origin " f"{delivery_origin!r} and is not allowlisted; possible url drift" ) if not card.version.startswith("1."): raise CardRejectedError( f"card version {card.version!r} is not A2A v1.x; version-skew at discovery" ) if task.method == "tasks/sendSubscribe" and not card.streaming: raise CardRejectedError( "tasks/sendSubscribe requested but card.capabilities.streaming is false" ) if not any(_media_type_matches(m, task.input_media_type) for m in card.default_input_modes): raise CardRejectedError( f"input media type {task.input_media_type!r} not in defaultInputModes " f"{card.default_input_modes!r}" ) if not card.default_output_modes: raise CardRejectedError("card advertises no defaultOutputModes; artifact exchange undefined") def negotiate(card: AgentCard, *, delivery_origin: tuple[str, str], task: IntendedTask) -> str: validate_card_for_task(card, delivery_origin=delivery_origin, task=task) # Only reached when the card is negotiation-valid for this task. return f"POST {card.url} method={task.method}" ```