# What happens when an instance negotiates an A2A v1.0 agent card whose declared `capabilities.streaming` and `defaultInputModes` diverge from the task payload's actual content type mid-delegation **Date of Record:** 2026 November 29 **Scope:** Applies to cross-vendor task delegation where a delegating agent (client) discovers a remote agent via an A2A v1.0 Agent Card and dispatches a `tasks/send` or `tasks/sendSubscribe` request whose `Part` media types are validated against the card only at discovery time. Does not apply to single-vendor intra-process tool calls or to A2A deployments where the card and the task endpoint are served from the same immutable manifest snapshot. ## Core Distinction The A2A v1.0 Agent Card is a *declaration* fetched over a separate transport (typically `GET /.well-known/agent.json`) from the *enforcement point* that actually validates a task payload. The spec treats `defaultInputModes` and `capabilities.streaming` as advisory metadata for capability negotiation, not as a contract the server is obligated to enforce per-request. The failure mode is not "the card lied." The failure mode is that **the card and the task endpoint are two independently versioned surfaces with no shared nonce**, so a client that caches the card and reasons about it as an invariant will construct a payload the server's *current* handler rejects — or worse, silently coerces. The distinction that matters operationally: capability *discovery* is a read of a mutable document; capability *enforcement* is a write against a handler whose accepted schema may have been redeployed between the read and the write. There is no `ETag`-to-task binding in the handshake. The client's model of the remote agent is a snapshot; the remote agent is a moving target. ## What Was Observed A delegating orchestrator (Vendor A) performed standard discovery against a Vendor B agent card: ``` { "name": "doc-extractor", "capabilities": { "streaming": true, "pushNotifications": false }, "defaultInputModes": ["text/plain", "application/json"], "defaultOutputModes": ["application/json"], "skills": [ { "id": "extract", "inputModes": ["application/json"] } ] } ``` The orchestrator cached this card at cold start (a deliberate optimization to avoid a discovery round-trip per task) and, for the next ~40 minutes, dispatched `tasks/sendSubscribe` calls carrying `application/json` parts, relying on `capabilities.streaming: true` to open an SSE channel for incremental results. At T+41min, Vendor B redeployed the `doc-extractor` handler to a build that (a) dropped SSE support from the runtime behind a feature flag while leaving `capabilities.streaming: true` in the static card, and (b) tightened the `extract` skill to accept only `application/json` *with* a required `schemaVersion` field that the card did not advertise. The card JSON was served from a CDN edge with a 1-hour TTL and was not regenerated on deploy. The orchestrator's next three delegations produced three distinct observable outcomes from the *same* client code path: 1. **Task 1** returned HTTP 200 with a `Task` object in state `submitted`, but the SSE stream closed immediately after the initial event. The client's stream reader treated EOF-before-`completed` as a transient network fault and retried the *entire task* — duplicating a side-effecting extraction. No error surfaced. 2. **Task 2** returned HTTP 400 with `InvalidParams` and a message body of `"unsupported input mode"`. The client's error classifier mapped `InvalidParams` to "malformed request, do not retry, escalate to human" — correct behavior, but the escalation carried no signal that the *card* was stale, so the on-call engineer re-fetched the card manually and saw the old cached JSON, concluding the client was at fault. 3. **Task 3** (dispatched after a partial client-side schema patch) was accepted and returned `completed`, but the result `Artifact` omitted the `schemaVersion` echo the client expected, because the server had defaulted it. The client's downstream validator rejected the artifact, and the task was marked failed *after* the remote agent had already committed the extraction. The compounding failure: the client's retry logic (from outcome 1) and its escalation logic (from outcome 2) and its artifact validation (from outcome 3) each behaved "correctly" in isolation, but the *absence of a card-to-task binding* meant none of them could distinguish "remote agent changed" from "my request was wrong" from "network flaked." ## Condition of Validity The invariant that makes cross-vendor delegation safe is: **a task dispatch is only well-formed if the card snapshot used to construct it is provably the same snapshot the receiving handler will validate against.** A2A v1.0 does not provide this binding natively. It becomes approximately true only under one of these conditions: - The card is served with a content hash and the client includes that hash in a header (e.g., `X-A2A-Card-Digest`) that the server verifies against its *current* handler manifest, returning a distinct `CardStale`-class error on mismatch. This requires both vendors to implement the header; it is not in the base spec. - The client re-fetches the card on every dispatch *and* the card is generated from the same build artifact as the handler (no CDN TTL divergence). This trades latency for correctness and only holds if the card endpoint is not cached independently of the handler. - The delegation is idempotent and side-effect-free, so a stale-card retry is harmless. This is rarely true for extraction, mutation, or payment tasks. Outside these conditions, the client is reasoning about a *hypothesis* of the remote agent, not a contract. The hypothesis has a half-life equal to the card's cache TTL, and the failure is silent until the handler's behavior diverges in a way the client's error taxonomy happens to catch. ## Decision Boundary The boundary is between two policies for handling card/handler divergence, and the choice is not free: - **Trust-the-card (cache and dispatch):** minimizes discovery latency, but any handler redeploy that does not regenerate the card produces exactly the three-outcome divergence above. Acceptable only for read-only, idempotent skills where a coerced or rejected task has no side effect. - **Verify-per-dispatch (re-fetch and check):** eliminates the stale-snapshot class but adds a discovery round-trip to every task and *still* fails if the card endpoint is cached more aggressively than the handler (the CDN-TTL case). It narrows but does not close the window. The decision boundary is crossed when a skill has **non-idempotent side effects AND a card whose cache lifetime exceeds the handler's deploy cadence.** At that point neither policy is safe; the correct move is to refuse delegation unless a card-digest binding is negotiated, and to treat the absence of that binding as a hard precondition failure rather than a degraded mode. The subtle part: the client cannot *detect* that it has crossed this boundary from the card alone, because the card does not advertise its own TTL or its binding to the handler build. The boundary must be inferred from deployment topology, which the client does not control. ## Operational Effect The practical consequence is that **retry, escalation, and artifact validation must be unified under a single "remote-agent-identity-uncertain" state**, not three independent handlers. When any of the three symptoms appears — premature stream EOF, `InvalidParams` on a payload the cached card said was valid, or an artifact missing a field the card implied — the client must transition to a state that (a) does not retry the side-effecting task, (b) re-fetches the card and compares it to the cached snapshot, and (c) surfaces the *diff* to the escalation path so the on-call engineer sees "the remote agent's declared contract changed," not "my request was malformed." Concretely: the orchestrator should persist the card snapshot *with* each dispatched task, so that when the task fails, the failure record contains the exact contract the client believed in. This turns an opaque `InvalidParams` into an auditable divergence. Second, streaming delegation must treat "stream closed before terminal state" as a *contract violation*, not a transport fault, and must never auto-retry a task whose `Task.id` was already assigned by the server (the server has accepted it; a retry is a duplicate). Third, artifact validation failures must be classified as `RemoteContractDrift`, distinct from local validation bugs, because the remediation differs: drift requires re-negotiation, local bugs require a client patch. The invariant to enforce: **no task is dispatched against a card snapshot older than the last observed handler behavior change for that agent, and any behavior change invalidates the snapshot for all non-idempotent skills until re-verified.** Without a card-digest binding in the handshake, this invariant can only be approximated by short card TTLs and idempotency keys, and the approximation must be documented as such — because the next engineer will assume the card is a contract, and it is not. ```python class CardHandlerDivergence(RuntimeError): """Raised when a task was constructed from a card snapshot that no longer matches the remote handler's enforced contract. This is NOT a transport error and NOT a malformed-request error; it is a remote-contract-drift signal that must not trigger task retry for side-effecting skills.""" pass def dispatch_task(card_snapshot: dict, task_payload: dict, skill_id: str, side_effecting: bool, card_age_seconds: float, card_ttl_seconds: float) -> dict: # Precondition: the card we are about to trust must still be within its # declared freshness window. A2A v1.0 gives us no digest binding, so TTL # is the only proxy we have for "handler and card are the same build." if card_age_seconds > card_ttl_seconds: raise CardHandlerDivergence( f"card snapshot for skill={skill_id!r} is {card_age_seconds:.0f}s old, " f"exceeds ttl={card_ttl_seconds:.0f}s; refusing dispatch because " f"handler may have redeployed without regenerating the card" ) # Precondition: payload media type must be in the skill's declared input # modes AND the card must declare streaming if we intend to use it. part_modes = {p.get("mediaType") for p in task_payload.get("parts", [])} declared = set(card_snapshot.get("skills", [{}])[0].get("inputModes", [])) if not part_modes.issubset(declared): raise CardHandlerDivergence( f"payload media types {part_modes} not subset of declared " f"{declared} for skill={skill_id!r}; card may be stale" ) if side_effecting and not card_snapshot.get("capabilities", {}).get("streaming"): # Non-idempotent skill without streaming means we cannot observe # partial progress; a stream-EOF-before-terminal would be # indistinguishable from success. Refuse rather than risk duplicate. raise CardHandlerDivergence( f"side-effecting skill={skill_id!r} requires streaming for " f"progress observability; card declares streaming=false" ) # ... actual dispatch, with the card snapshot persisted alongside task id ... return {"task_id": "t-...", "state": "submitted", "card_snapshot_digest": hash(frozenset(card_snapshot.items()))} ```