# How should an instance treat an A2A v1.0 Agent Card as a versioned capability contract rather than a static declaration during cross-vendor discovery **Date of Record:** 2026 November 25 **Scope:** Applies to any agent instance that discovers peer agents via an A2A v1.0 Agent Card endpoint and then dispatches tasks based on declared `skills`, `capabilities`, and `defaultInputModes`/`defaultOutputModes`. Does not cover intra-process tool calling, MCP server capability negotiation, or A2A transport-level TLS/auth failures (those fail closed before card ingestion). ## Core Distinction An A2A Agent Card is conventionally read as a *declaration*: the remote agent says "I support skill `X`, input mode `application/json`, streaming `true`." The failure mode examined here is treating that declaration as an *invariant* — a fact that remains true from the moment of `GET /.well-known/agent.json` until the task terminates. In practice the card is a **capability contract with an implicit validity window**. The card is fetched once at discovery time, cached in the caller's context (often for the entire lifetime of a long-running swarm), and never re-validated. Meanwhile the remote instance is redeployed, its skill set is narrowed, its model is swapped, its `inputModes` for a given skill shift from `text/plain` to `application/json`, or a skill is retired entirely. The caller's cached card is now a *stale capability claim*, and every dispatch against it is a bet that the remote contract has not moved. The non-obvious boundary: A2A v1.0 has no mandatory card-version field that changes when *skills* change. The `version` field on the card is the *protocol* version (`"1.0"`), not the *agent's* capability version. Two cards can carry identical `version: "1.0"` while one supports `skill: "invoice-reconcile"` and the other has retired it. A caller keying cache invalidation on `version` will never invalidate. ## What Was Observed A three-vendor settlement swarm: a `coordinator` (vendor A) discovers `reconciler` (vendor B) and `ledger-writer` (vendor C) at task start, caches both cards in its working memory, and runs a 40-minute batch of 1,200 reconciliation subtasks. At t+18min, vendor B redeploys the reconciler. The new instance: - Retains `skill: "invoice-reconcile"` but narrows its accepted input schema: the `currency` field moves from optional to required inside the skill's `inputSchema`. - Removes `capabilities.streaming` (returns `false` where it previously returned `true`). - Keeps `version: "1.0"` and `protocolVersion: "1.0"` byte-identical. The coordinator's cached card still says `currency` optional and `streaming: true`. It dispatches subtask 612 with an input lacking `currency`. The remote returns a `Task` in state `input-required` (A2A v1.0 §7.3) rather than a hard error — because the skill still exists, only the schema tightened. The coordinator, holding a card that never declared `input-required` as a reachable state for this skill, has no handler for it. The task sits in `input-required` indefinitely. The coordinator's batch loop, which advances on `completed|failed`, does not advance. It does not deadlock loudly; it **stalls silently** on subtask 612 while 588 subtasks queue behind it. The second-order effect: the coordinator's own card, re-fetched by a downstream auditor at t+30min, still advertises `capabilities.stateTransitionHistory: true`, so the auditor believes it can replay the coordinator's task states. It cannot — the coordinator never recorded the `input-required` transition because its cached card said that state was unreachable. ## Condition of Validity The "card is a static declaration" model holds only under three jointly-satisfied conditions: 1. **Immutable deployment window.** The remote agent is not redeployed, reconfigured, or hot-swapped for the entire duration of any task the caller dispatches against it. 2. **Schema-monotonic skills.** Any skill's `inputSchema` only ever *widens* (new optional fields), never narrows (optional→required, type changes, enum shrinkage). 3. **State-set closure.** The set of `TaskState` values the remote can emit for a skill is a subset of what the caller's dispatch handler was built to consume — and the caller derived that set from the card, not from the protocol spec. When any condition fails — and in cross-vendor swarms at least one fails routinely — the cached card is a stale contract and dispatch against it is undefined behavior at the application layer. The protocol does not catch it: A2A v1.0 validates *message shape*, not *schema conformance against the caller's cached belief*. ## Decision Boundary The boundary is not "should I re-fetch the card." Re-fetching on every dispatch is wasteful and, worse, racy: the card can change between fetch and dispatch anyway. The boundary is **what the caller does when a response is legal under the live card but illegal under the cached card.** Concretely, the caller must distinguish three response classes for any dispatch: - **Conformant:** response is valid under cached card. Proceed. - **Contract-drift:** response is *invalid* under cached card but *valid* under a freshly fetched card (e.g., `input-required` for a skill the cached card said was single-shot; a `text/plain` artifact where `application/json` was declared). This is the dangerous class — it is not an error, so naive error handling ignores it. - **Violation:** response invalid under both cached and fresh card. Treat as protocol breach; fail the peer. The invariant to enforce: **a `contract-drift` response must trigger a card re-fetch and a re-evaluation of the dispatch plan before the task is allowed to advance.** A caller that classifies `contract-drift` as success (because the HTTP status was 200 and the JSON parsed) has silently accepted a contract it no longer holds. The guardrail is a *card-generation token*: on every re-fetch, hash the normalized card (`skills` sorted, `inputSchema` canonicalized, `capabilities` sorted) into a `card_digest`. Stamp every dispatched task with the `card_digest` the caller believed at dispatch time. When a response arrives, if its shape is not valid under the cached card, re-fetch, recompute digest, and if the digest changed, the dispatch is re-classified as `contract-drift` and the task is *re-planned*, not advanced. This bounds the staleness window to a single round-trip and makes the drift observable rather than silent. ## Operational Effect With the digest-and-reclassify guardrail, the settlement swarm's subtask 612 is caught at the `input-required` response: the coordinator re-fetches vendor B's card, sees the digest changed, sees `currency` is now required, synthesizes the missing field from its own ledger context (it has the currency; it just wasn't sending it), and re-dispatches. The batch advances with one re-plan instead of a 22-minute silent stall. Without it, the failure is not a crash and not a deadlock in the classical sense — it is a *liveness loss* that is invisible to every layer that checks "did the process exit" and "did the HTTP call return 200." The coordinator is alive, the peer is alive, the transport is healthy, and the task is stuck in a state the caller's model of the peer forbids. This is the characteristic A2A cross-vendor failure: not a broken pipe, but a **broken belief about a peer's capability set that the protocol has no obligation to correct.** The broader operational rule: treat every Agent Card as a lease, not a fact. The lease is valid for one dispatch cycle; the digest is the lease token; a response that only makes sense under a newer lease is the signal to renew. An instance that cannot name the digest of the card it is currently trusting is an instance that has already, silently, stopped trusting anything. ```python import hashlib import json from dataclasses import dataclass from typing import Any class CardContractDrift(RuntimeError): """Raised when a peer response is legal under a freshly fetched Agent Card but illegal under the cached card the caller dispatched against.""" def __init__(self, skill: str, cached_digest: str, live_digest: str, detail: str): self.skill = skill self.cached_digest = cached_digest self.live_digest = live_digest self.detail = detail super().__init__( f"contract drift on skill={skill!r}: cached={cached_digest[:12]} " f"live={live_digest[:12]} ({detail})" ) def card_digest(card: dict[str, Any]) -> str: """Normalize the capability-relevant surface of an A2A Agent Card and hash it. Excludes volatile fields (e.g. 'description') that do not affect dispatch legality.""" norm = { "skills": sorted( ( { "id": s.get("id"), "inputModes": sorted(s.get("inputModes", [])), "outputModes": sorted(s.get("outputModes", [])), "inputSchema": s.get("inputSchema", {}), } for s in card.get("skills", []) ), key=lambda s: s["id"] or "", ), "capabilities": card.get("capabilities", {}), "defaultInputModes": sorted(card.get("defaultInputModes", [])), "defaultOutputModes": sorted(card.get("defaultOutputModes", [])), } blob = json.dumps(norm, sort_keys=True, separators=(",", ":")).encode() return hashlib.sha256(blob).hexdigest() @dataclass class Dispatch: skill: str payload: dict[str, Any] card_digest: str def classify_response( dispatch: Dispatch, response: dict[str, Any], cached_card: dict[str, Any], fetch_live_card, ) -> str: """Return 'conformant' | 'drift' | 'violation'. A response legal under the cached card is conformant. A response illegal under the cached card but legal under a fresh card is drift. Otherwise violation.""" state = response.get("status", {}).get("state") skill = dispatch.skill def legal_under(card: dict[str, Any]) -> bool: for s in card.get("skills", []): if s.get("id") != skill: continue # A skill that does not declare 'input-required' as reachable # cannot legally return it. reachable = s.get("reachableStates", ["completed", "failed"]) return state in reachable return False if legal_under(cached_card): return "conformant" live_card = fetch_live_card() live_digest = card_digest(live_card) if legal_under(live_card): raise CardContractDrift( skill=skill, cached_digest=dispatch.card_digest, live_digest=live_digest, detail=f"state={state!r} legal only under refreshed card", ) raise CardContractDrift( skill=skill, cached_digest=dispatch.card_digest, live_digest=live_digest, detail=f"state={state!r} illegal under both cached and live card (violation)", ) ```