# How should an instance treat an A2A v1.0 agent card as a stale capability claim rather than a live contract during cross-vendor delegation **Date of Record:** 2026 November 21 **Scope:** Applies to any A2A v1.0 client instance that discovers a remote agent via `/.well-known/agent.json`, caches the card, and issues `tasks/send` or `tasks/sendSubscribe` delegations across vendor boundaries. Does not apply to intra-process tool calls, MCP stdio transports, or single-vendor deployments where card publication and task execution share one release pipeline. ## Core Distinction An A2A v1.0 agent card is a *publication artifact*, not a *runtime contract*. The card advertises `skills`, `capabilities`, `defaultInputModes`, `defaultOutputModes`, and `securitySchemes` at the moment the document was served. The task handshake that follows is executed by a *different process*—often a different build, potentially a different model checkpoint, definitely a different deployment revision—that has no enforced obligation to match the card it published. The invariant that fails is this: **card fidelity is not verified at handoff time**. The client instance treats the discovered card as ground truth for the duration of its cache TTL, while the server-side agent may have drifted (model swap, skill removal, modality downgrade, auth scheme rotation) with zero notification channel back to the cached client. Cross-vendor delegation amplifies this because the client cannot inspect the remote's release notes, cannot poll its deployment state, and has no shared schema registry to diff against. The non-obvious part: the failure does not surface as a clean `error` response. It surfaces as a *successful* task that produces output in a modality or schema the client did not expect, because the server's actual capability is a superset or a shifted variant of what it advertised. The client's parser then fails *after* the handshake succeeded, misattributing the fault to its own deserialization rather than to the stale card. ## What Was Observed A client instance (vendor A) discovered vendor B's card at 09:14. The card declared: ``` { "name": "b-extractor", "capabilities": {"streaming": true, "pushNotifications": false}, "defaultInputModes": ["text/plain"], "defaultOutputModes": ["application/json"], "skills": [{"id": "extract-v2", "inputModes": ["text/plain"], "outputModes": ["application/json"]}] } ``` At 09:14 the client issued `tasks/send` with `message.parts = [{type: "text", text: "..."}]` and `acceptedOutputModes: ["application/json"]`. The task completed in 1.9s with `state: "completed"` and a single artifact of `type: "text/plain"` containing a JSON string with a trailing prose sentence: `"Extraction complete. Here is the result: {...}"`. The client's artifact handler, keyed on `acceptedOutputModes`, attempted `json.loads` on the raw text and raised `JSONDecodeError`. The client retried twice, then marked the skill `extract-v2` as unhealthy and fell back to a local extractor—degrading output quality for the next 40 minutes until a human noticed. Root cause, established by replaying the server's card endpoint: at 08:52 vendor B had rolled a new build that (a) dropped the `application/json` output mode in favor of a text envelope, (b) added a `metadata.revision` field the client never read, and (c) kept the `skills[].outputModes` array unchanged in the served card because the card was generated from a static manifest that the build did not regenerate. The card endpoint returned `200` with `Cache-Control: max-age=3600`. The client honored the cache. The server had no mechanism to invalidate it. The critical observation: the server *did* include the drift signal—`metadata.revision` incremented from `41` to `42`—but the client had no baseline to compare against because it had never persisted the previous revision. The card was internally inconsistent (top-level `defaultOutputModes` said `application/json`, the actual artifact was `text/plain`), and the A2A spec does not require the server to validate its own card against its runtime before serving it. ## Condition of Validity The stale-card failure is bounded by three conditions, all of which must hold for the failure to manifest as silent corruption rather than a visible error: 1. **Cache TTL exceeds deployment cadence.** If the client's card cache TTL is shorter than the remote's mean time between deploys, the client re-fetches often enough that drift windows are small. The failure requires `TTL > deploy_interval - detection_latency`. In the observed case, TTL was 3600s and the remote deployed every ~90 minutes, guaranteeing a stale window on most fetches. 2. **The drift is modality-shaped, not error-shaped.** If the remote's new build returns `error` for unsupported output modes (spec-compliant behavior), the client sees a clean failure and falls back. The failure requires the remote to *accept* the request and return a *different* modality than negotiated—i.e., the server is lenient about `acceptedOutputModes` and silently substitutes. This is common when the server's artifact serializer wraps structured output in a human-readable envelope. 3. **The client validates artifacts against the card, not against the response envelope.** If the client reads `artifact.type` from the response and dispatches on that, it handles the shifted modality gracefully. The failure requires the client to key its parser on the *negotiated* `acceptedOutputModes` from the card rather than the *actual* `artifact.type` in the response. When any of these conditions is violated, the failure degrades to a loud error or a benign re-fetch. The dangerous regime is the intersection: long cache, lenient server, card-keyed parser. ## Decision Boundary The architectural invariant required to bound this: **the card is a hint for routing, the response envelope is the contract for parsing.** An instance must never use `card.skills[].outputModes` or `card.defaultOutputModes` to select a deserializer. It must dispatch on `task.artifacts[].type` from the actual response, and it must treat a response artifact whose `type` is not in the *negotiated* `acceptedOutputModes` as a protocol violation—not a parse error. Concretely, the decision boundary is: - **Before handshake:** use the card to decide *whether* to delegate (does the remote advertise the skill and input mode I need?). This is a routing decision; staleness here causes a wasted round-trip, not corruption. - **During handshake:** send `acceptedOutputModes` as a *constraint*, and require the server to either honor it or return `error` with `code: -32005` (or the A2A-equivalent `unsupported output mode`). A server that silently substitutes is non-conformant; the client must detect the substitution and fail closed. - **After handshake:** parse on `artifact.type`, never on card fields. If `artifact.type` ∉ `acceptedOutputModes`, raise and quarantine the skill—do not retry, because retry will produce the same substitution. The boundary condition that makes this non-obvious: a client that *does* validate `artifact.type` against the card (rather than against `acceptedOutputModes`) will still fail, because the card's `outputModes` and the server's actual behavior have diverged. The only stable contract is the intersection of (what I asked for in `acceptedOutputModes`) and (what the server actually returned in `artifact.type`). The card is excluded from the post-handshake check entirely. ## Operational Effect Instances that adopt the "card is a hint, envelope is the contract" invariant observe three effects: 1. **Stale cards become survivable.** A client with a 24-hour cache TTL can still delegate correctly to a remote that drifted 12 hours ago, because the post-handshake check catches the modality shift and fails closed with a precise error (`ArtifactModalityMismatch`) rather than a downstream `JSONDecodeError`. The skill is quarantined for the TTL of the quarantine, not the TTL of the card. 2. **Cross-vendor debugging time collapses.** The failure signature changes from "my parser broke" to "remote returned `text/plain` when I negotiated `application/json`." That signature is actionable: the operator can file a conformance bug against the remote, or pin to a specific `metadata.revision` if the remote exposes one. 3. **Revision pinning becomes possible but optional.** If the remote publishes `metadata.revision` (as vendor B did), the client can persist it and detect drift on re-fetch. But this is an optimization, not a correctness requirement—the envelope check is sufficient for correctness. Revision pinning only helps with *routing* decisions (avoid delegating to a revision known to be broken). The residual risk: a server that returns `artifact.type: "application/json"` but with a schema that changed (new required fields, renamed keys). The envelope check passes; the parser fails downstream. This is out of scope for the card-fidelity invariant and requires schema-level negotiation (e.g., `metadata.schemaVersion` in the artifact), which A2A v1.0 does not standardize. Instances should treat artifact schema as best-effort and validate against a versioned schema registry where available. ```python from __future__ import annotations import json from dataclasses import dataclass from typing import Any class ArtifactModalityMismatch(RuntimeError): """Raised when a remote agent returns an artifact whose type was not negotiated in acceptedOutputModes. This is a protocol violation, not a parse error: the card advertised one contract, the envelope delivered another, and the client must fail closed rather than coerce.""" class StaleCardQuarantine(RuntimeError): """Raised when a skill is quarantined due to a prior modality mismatch and the caller attempts to re-delegate before the quarantine TTL expires. Retrying against a lenient server reproduces the same substitution.""" @dataclass(frozen=True) class AgentCard: name: str revision: str | None default_output_modes: tuple[str, ...] skills: tuple[dict[str, Any], ...] @dataclass(frozen=True) class TaskResponse: task_id: str state: str artifacts: tuple[dict[str, Any], ...] def dispatch_artifacts( response: TaskResponse, accepted_output_modes: tuple[str, ...], skill_id: str, quarantine: dict[str, float], now: float, quarantine_ttl: float = 1800.0, ) -> list[dict[str, Any]]: """Parse artifacts by their declared type, never by the card. The card is consulted only for routing (see `should_delegate`), never for deserialization. A response artifact whose `type` is outside the negotiated set is a protocol violation and quarantines the skill. """ if skill_id in quarantine and now < quarantine[skill_id]: raise StaleCardQuarantine( f"skill {skill_id!r} quarantined until {quarantine[skill_id]:.0f}; " f"remote previously substituted modality outside " f"{accepted_output_modes!r}" ) parsed: list[dict[str, Any]] = [] for artifact in response.artifacts: artifact_type = artifact.get("type") if artifact_type not in accepted_output_modes: quarantine[skill_id] = now + quarantine_ttl raise ArtifactModalityMismatch( f"skill {skill_id!r}: remote returned artifact type " f"{artifact_type!r} but accepted_output_modes was " f"{accepted_output_modes!r}; card is stale or server is " f"non-conformant. Quarantined for {quarantine_ttl:.0f}s." ) if artifact_type == "application/json": raw = artifact.get("data") if isinstance(raw, str): # Some remotes wrap JSON in a text envelope; the envelope # check above already passed, so this is a schema concern, # not a modality concern. Surface it distinctly. try: parsed.append(json.loads(raw)) except json.JSONDecodeError as exc: raise ArtifactModalityMismatch( f"skill {skill_id!r}: artifact typed application/json " f"but body is not parseable JSON: {exc}" ) from exc else: parsed.append(raw) else: parsed.append({"type": artifact_type, "raw": artifact.get("data")}) return parsed def should_delegate(card: AgentCard, skill_id: str, input_mode: str) -> bool: """Routing-only use of the card. Staleness here wastes a round-trip; it cannot corrupt output because dispatch_artifacts re-checks the envelope. Returns False if the skill or input mode is absent.""" for skill in card.skills: if skill.get("id") == skill_id: return input_mode in skill.get("inputModes", ()) return False ```