# In what scenarios must an instance treat an A2A v1.0 Agent Card as a stale capability claim rather than a live contract **Date of Record:** 2026 November 21 **Scope:** Applies to any agent that discovers a remote peer through the A2A v1.0 Agent Card endpoint (`/.well-known/agent.json`) and then issues tasks against the declared skills, modalities, or security schemes. Does not cover in-band task-level error handling after a task has been accepted, nor MCP tool-schema negotiation, which has a different versioning and cache model. ## Core Distinction An Agent Card is a *published advertisement*, not a *runtime capability probe*. A2A v1.0 defines the card as a static JSON document served at a well-known URI, describing `name`, `description`, `url`, `version`, `capabilities`, `skills[]`, `defaultInputModes`, `defaultOutputModes`, and `securitySchemes`. Nothing in the specification binds the card's contents to the peer's actual deployed code at request time. The card is a claim; the task endpoint is the contract. The failure mode is treating the claim as the contract. The non-obvious part: the card is *cached by convention, not by protocol*. Most client implementations fetch it once per session, key it by origin, and reuse it for the life of the agent process. There is no `ETag`-mandated revalidation, no `Cache-Control` semantics defined in the spec, and no version-negotiation handshake that forces a refresh when the peer redeploys. A peer that ships a new skill set, drops a modality, or rotates a security scheme can leave every existing client holding a card that describes a system that no longer exists. The client then constructs a task payload against a phantom capability. ## What Was Observed A concrete trace from a cross-vendor handoff. Client agent `C` discovers peer `P` once at process start, parses the card, and records `P.skills = [{id: "invoice-extract", inputModes: ["application/pdf"], outputModes: ["application/json"]}]`. `C` also records `P.capabilities.streaming = true`. Ninety minutes later, vendor `P` deploys a build that (a) renames the skill to `invoice-parse`, (b) narrows `inputModes` to `["application/pdf", "image/tiff"]` but *drops* raw PDF-with-attachments, and (c) disables streaming pending a fix, so the task endpoint now returns a synchronous `Task` object with `status.state = "completed"` inline rather than emitting SSE frames. `C` does not refetch. It sends a task with `skillId: "invoice-extract"` and `inputMode: "application/pdf"` and opens an SSE connection expecting `TaskStatusUpdateEvent` frames. Three things break, in order: 1. The peer rejects the unknown `skillId` with a JSON-RPC error `-32602` (invalid params) rather than a task-level failure. `C`'s error handler classifies `-32602` as a *client bug*, logs it as a programming error, and does not retry. The task is silently dropped. 2. On a second attempt where `C` omits `skillId` (relying on the peer to infer), the peer accepts the task but the PDF-with-attachments path now fails server-side with a `Task` in `state: "failed"` and a `message` that names the missing modality — information `C` already had in its stale card but ignored. 3. On a third attempt where `C` forces streaming, the SSE connection opens, receives zero events, and the peer's synchronous completion is never delivered. `C` blocks on `await stream` until its own 30-second read timeout, then declares the peer unreachable — a false negative that will poison `C`'s peer-health cache and cause it to deprioritize a peer that is in fact healthy. The compounding is the point: a single stale card produces a *client-classified* error, then a *server-classified* error, then a *transport-classified* error, and the client attributes each to a different subsystem. No single log line says "the card is stale." ## Condition of Validity A cached Agent Card is valid only under a conjunction that clients rarely verify: - The peer's `version` field is unchanged **and** the client treats `version` as a monotonic deployment identifier, not a semantic-version string the peer may reuse across breaking changes. A2A v1.0 does not mandate monotonicity; vendors routinely ship `1.0.0` → `1.0.0` across incompatible builds. - The card's `capabilities` block is a *superset* of what the client will exercise. If the client will use streaming, it must confirm `capabilities.streaming == true` at task time, not card-parse time. - Every `skillId` the client will send is present in the *current* card. Skill IDs are the only stable handle A2A offers; they are not guaranteed stable across peer versions. - The `securitySchemes` referenced by the client's credentials still exist and still accept the credential type the client holds. Scheme rotation is the quietest break: the card changes `securitySchemes.oauth2.flows.clientCredentials.tokenUrl`, the old token endpoint 404s, and the client's auth layer retries against a dead URL. The invariant: **the client must revalidate the card on any task-level failure whose error class is `invalid-params`, `method-not-found`, `unsupported-modality`, or `auth-scheme-mismatch`, before attributing the failure to any other subsystem.** Card staleness is the null hypothesis for cross-vendor failures, and it must be eliminated first. ## Decision Boundary The boundary is *when to refetch vs. when to trust*. Refetch is cheap (one GET to a well-known URI), so the only reason not to is latency budget on a hot path. The decision rule: - **Refetch before first task in a session.** Always. The card is the handshake; skipping it means negotiating against a document of unknown age. - **Refetch on any `-32602` / `-32601` / modality-rejection / auth-scheme error.** These are the four error classes that a stale card produces. Refetch, diff against the cached card, and if the diff explains the error, retry once with the fresh card. If the diff does not explain it, escalate as a genuine peer fault. - **Refetch on `version` change detected out-of-band** (peer health probe, registry webhook). Do not poll the card on a timer; poll the `version` field via a lightweight HEAD or a registry, and refetch only on change. - **Never refetch inside a retry loop.** A card that changes mid-retry means the peer is redeploying; back off and treat the peer as unavailable for the retry window rather than chasing a moving target. The boundary case that trips implementations: a peer that returns a *valid* card but a *different* `url` than the one the client used to fetch it. A2A v1.0 permits the card's `url` to differ from the discovery origin (e.g., a gateway fronting multiple backends). A client that keys its cache by discovery origin but sends tasks to `card.url` will, on refetch, find the card has moved to a new backend with a new skill set — and its cache key still points at the old origin. Key the cache by `card.url`, not by discovery origin, or the refetch will not invalidate the entry that matters. ## Operational Effect The observable effect of getting this wrong is a *misattributed failure cascade*: the client blames its own payload construction, then the peer's task logic, then the transport, and never blames the card. The remediation is a card-revalidation guard that sits *above* the error classifier and runs before any retry or peer-health update. Without it, a single stale card can evict a healthy peer from the client's routing table, which is a strictly worse outcome than the original task failure. The guard is small but must be placed correctly: it must intercept *before* the error classifier assigns a blame category, because the classifier's output is what feeds the peer-health cache. A guard that runs after classification has already done the damage. ```python import json import time from dataclasses import dataclass, field from typing import Optional class StaleAgentCardError(RuntimeError): """Raised when a task failure is explained by a card that no longer matches the peer.""" pass @dataclass class AgentCard: url: str version: str skills: dict # skillId -> {"inputModes": [...], "outputModes": [...]} capabilities: dict fetched_at: float = field(default_factory=time.time) @dataclass class CardCache: by_url: dict = field(default_factory=dict) def get(self, url: str) -> Optional[AgentCard]: return self.by_url.get(url) def put(self, card: AgentCard) -> None: # Key by card.url, NOT by discovery origin: a gateway may front many backends. self.by_url[card.url] = card # Error classes that a stale card can produce. Anything else is a genuine peer fault. STALENESS_SIGNATURES = frozenset({ "invalid-params", # -32602: unknown skillId "method-not-found", # -32601: removed method "unsupported-modality", # inputMode dropped from card "auth-scheme-mismatch", # securitySchemes rotated }) def revalidate_before_blame( cache: CardCache, card_url: str, observed_error_class: str, fetch_card, # callable(url) -> AgentCard ) -> AgentCard: """ Null-hypothesis guard: before attributing a cross-vendor failure to the peer, the client, or the transport, prove the cached card still matches the peer. Runs BEFORE the error classifier and BEFORE peer-health updates. """ if observed_error_class not in STALENESS_SIGNATURES: cached = cache.get(card_url) if cached is None: raise StaleAgentCardError( f"no cached card for {card_url}; cannot attribute non-staleness error" ) return cached cached = cache.get(card_url) fresh = fetch_card(card_url) if cached is None: cache.put(fresh) return fresh # Version reuse across breaking builds is legal in A2A v1.0; diff the body, not the version. if fresh.skills == cached.skills and fresh.capabilities == cached.capabilities: # Card unchanged but error signature matches staleness: the peer is lying about its card, # or the failure is genuinely elsewhere. Escalate rather than retry. raise StaleAgentCardError( f"peer at {card_url} returned {observed_error_class} but card is unchanged; " f"card is not a reliable capability source for this peer" ) cache.put(fresh) return fresh def issue_task(cache: CardCache, card_url: str, skill_id: str, fetch_card, send_task): card = cache.get(card_url) if card is None: card = fetch_card(card_url) cache.put(card) if skill_id not in card.skills: # Do not send a task against a skill the card does not claim. Refetch first. card = fetch_card(card_url) cache.put(card) if skill_id not in card.skills: raise StaleAgentCardError( f"skill {skill_id!r} absent from fresh card at {card_url}" ) try: return send_task(card, skill_id) except Exception as exc: err_class = getattr(exc, "error_class", "unknown") fresh = revalidate_before_blame(cache, card_url, err_class, fetch_card) # Exactly one retry against the revalidated card; never loop. return send_task(fresh, skill_id) ```