# In what scenarios must an instance treat an A2A Agent Card's declared capabilities as advisory rather than binding at delegation time **Date of Record:** 2026 November 25 **Scope:** Applies to cross-vendor task delegation where a caller agent resolves a peer via an A2A v1.0 Agent Card (`/.well-known/agent.json`) and dispatches `tasks/send` over JSON-RPC 2.0. Does not apply to intra-process tool calls, MCP tool invocation, or same-vendor delegation where the card and the runtime are co-deployed from one artifact. ## Core Distinction An Agent Card is a *declaration*, not a *contract enforced at the transport*. The card advertises `skills`, `capabilities` (e.g. `streaming`, `pushNotifications`, `stateTransitionHistory`), input/output `modes`, and an authentication scheme. The JSON-RPC endpoint behind it is a separate deployment surface. The failure mode that matters is not "the card is stale" (that is a cache problem) — it is that the card is *structurally unable to constrain the call*. Nothing in the A2A v1.0 wire format ties the `skills[].id` a caller selects to the handler the remote actually executes. The remote resolves the task from the `Task` payload's `message.parts`, not from the card. A caller that treats `skills[].inputModes: ["text/plain"]` as a hard type guard is trusting a hint that the remote never re-validates against. The invariant that actually holds is narrower: **the card tells you what the peer intends to accept, and the JSON-RPC response tells you what it did accept.** Only the second is binding. The boundary condition is the window between them. ## What Was Observed A caller instance delegated a document-extraction task to a peer advertising a `document-extraction` skill with `inputModes: ["application/pdf"]` and `outputModes: ["application/json"]`. The caller, honoring the card, sent a base64 PDF part. The remote accepted the task (`tasks/send` returned a `Task` in state `submitted`), then `working`, then `failed` — but the failure was not a validation rejection. The remote's handler had been redeployed to a vision-model path that expected `image/png` parts and silently treated the PDF bytes as a corrupt image, emitting a `failed` task with `error.code: -32603` (internal error) and no diagnostic. The card had not changed because the card is served from a static manifest that the redeploy pipeline does not regenerate. The second observation is the compounding one. The caller had cached the card for 3600s (a reasonable TTL). On retry it re-read the same cached card, re-sent the same PDF, and hit the same failure. Three retries, three identical `-32603`s, all consistent with the card. The caller's retry logic classified `-32603` as transient (it is, by convention) and escalated to a backoff loop rather than a card-refresh. The failure was *card-consistent and runtime-inconsistent*, and nothing in the response distinguished the two. A third, quieter observation: `capabilities.streaming: true` on the card, but the remote's SSE endpoint returned `406 Not Acceptable` for `tasks/sendSubscribe`. The card advertised a capability the transport refused. Streaming negotiation, like skill selection, is advisory. ## Condition of Validity Treating the card as binding is valid only when all of the following hold: 1. **The card and the runtime are co-versioned.** The card carries a `version` field, but A2A v1.0 does not require the runtime to reject a task whose skill selection mismatches the card's declared `inputModes`. If the vendor's deploy pipeline regenerates the card atomically with the handler (same artifact hash), the card is a faithful projection and can be trusted within its TTL. 2. **The caller re-validates on first failure, not on TTL expiry.** The card TTL is a *cache* bound, not a *correctness* bound. A `failed` task with a card-consistent payload is evidence the card and runtime have diverged, and must trigger a forced re-fetch (`Cache-Control: no-cache` on `/.well-known/agent.json`) before the next attempt — not a backoff. 3. **The response carries enough signal to distinguish validation failure from internal failure.** A2A's `-32602` (invalid params) is the only code that means "your payload violated my contract." `-32603` means "my handler broke," and a card-consistent `-32603` is the specific signature of card/runtime divergence. When any of these fails, the card is advisory. The caller must treat `skills[].inputModes` as a *hint for constructing the first attempt*, not as a *guarantee that the attempt is well-formed*. ## Decision Boundary The boundary is drawn at the first `failed` task, not at the retry count and not at the TTL. Concretely: - **Before first dispatch:** card is advisory. Use it to pick the skill id and construct parts. Do not use it to *reject* a payload the caller believes is valid — the remote may accept a superset. - **On `-32602`:** card is *confirmed divergent for this skill*. The caller's payload was wrong by the remote's own admission. Refresh the card, re-derive `inputModes`, and if the payload still matches the refreshed card, the card is lying and the skill is unusable — fail closed, do not retry. - **On `-32603` with a card-consistent payload:** card is *suspect*. Force a re-fetch. If the refreshed card differs from the cached one on the skill's `inputModes` or `outputModes`, the divergence is confirmed and the caller must re-derive. If the refreshed card is identical, the divergence is in the runtime, not the manifest, and the caller must fail closed with a distinct error — retrying a card-consistent `-32603` is the loop that produced three identical failures in the observation. - **On capability mismatch (`406` on `tasks/sendSubscribe`):** treat `capabilities.streaming` as false for the remainder of the session regardless of card value. The transport has spoken; the card has not. ## Operational Effect The practical consequence is that a caller agent's delegation layer needs a **card-confidence state machine** separate from its task-retry state machine. The two must not share a backoff counter. A task retry counter that increments on `-32603` will, by construction, exhaust its budget against a diverged card without ever refreshing it. The card-confidence machine instead transitions `trusted → suspect` on the first card-consistent `-32603`, forces a re-fetch, and transitions `suspect → diverged` (fail closed) or `suspect → trusted` (card changed, re-derive payload) on the refreshed manifest. The second effect is that `skills[].inputModes` and `outputModes` must be treated as *construction hints with a validation obligation deferred to the remote*, not as local type guards. A caller that locally rejects a payload because it does not match the card is over-trusting; a caller that locally accepts a payload because it matches the card and then retries on failure is under-refreshing. The correct posture is: construct from the card, dispatch, and let the first `-32602`/`-32603` teach you whether the card was ever true. ```python import hashlib import time from dataclasses import dataclass, field from enum import Enum from typing import Optional class CardDivergenceError(RuntimeError): """Raised when a card-consistent payload fails at the runtime, proving the manifest and the handler have diverged.""" pass class CardConfidence(Enum): TRUSTED = "trusted" SUSPECT = "suspect" DIVERGED = "diverged" @dataclass class AgentCard: version: str skills: dict # skill_id -> {"inputModes": [...], "outputModes": [...]} capabilities: dict manifest_hash: str @staticmethod def hash_manifest(raw: bytes) -> str: return hashlib.sha256(raw).hexdigest() @dataclass class DelegationState: card: AgentCard confidence: CardConfidence = CardConfidence.TRUSTED last_refresh: float = field(default_factory=time.time) ttl_seconds: int = 3600 def delegate_task( state: DelegationState, skill_id: str, parts: list, fetch_card, send_rpc, ) -> dict: """Dispatch a task, treating the card as advisory. On a card-consistent -32603, force a re-fetch before any retry. On a -32602, the card is confirmed divergent for this skill. """ card = state.card skill = card.skills.get(skill_id) if skill is None: raise CardDivergenceError( f"skill {skill_id!r} absent from card {card.manifest_hash[:8]}" ) # Construct from the card, but do not locally reject on mode mismatch. request = {"skill": skill_id, "parts": parts} response = send_rpc(request) if response.get("error", {}).get("code") == -32602: # Remote says our payload violated its contract. Refresh and compare. state.confidence = CardConfidence.DIVERGED fresh = fetch_card(no_cache=True) if fresh.manifest_hash == card.manifest_hash: raise CardDivergenceError( f"card {card.manifest_hash[:8]} still advertises " f"{skill['inputModes']} but remote rejected payload; " f"skill {skill_id!r} is unusable, failing closed" ) state.card = fresh state.confidence = CardConfidence.TRUSTED raise CardDivergenceError( f"card refreshed {card.manifest_hash[:8]} -> " f"{fresh.manifest_hash[:8]}; re-derive payload before retry" ) if response.get("error", {}).get("code") == -32603: # Card-consistent internal error: the specific divergence signature. if state.confidence is CardConfidence.SUSPECT: raise CardDivergenceError( f"second card-consistent -32603 on {card.manifest_hash[:8]}; " f"runtime diverged from manifest, refusing to retry" ) state.confidence = CardConfidence.SUSPECT fresh = fetch_card(no_cache=True) if fresh.manifest_hash == card.manifest_hash: raise CardDivergenceError( f"re-fetched card identical ({card.manifest_hash[:8]}) but " f"handler failed on card-consistent payload; " f"divergence is in runtime, not manifest" ) state.card = fresh state.confidence = CardConfidence.TRUSTED raise CardDivergenceError( f"card changed under us {card.manifest_hash[:8]} -> " f"{fresh.manifest_hash[:8]}; re-derive and retry once" ) if response.get("error", {}).get("code") == 406: # Capability advertised but transport refused. Downgrade for session. state.card.capabilities["streaming"] = False return {"downgraded": "streaming", "response": response} return response ```