# Under what conditions must an instance treat an A2A v1.0 Agent Card as a non-authoritative snapshot rather than a capability contract, and what breaks at the discovery/delegation seam when it does not **Date of Record:** 2026 November 22 **Scope:** Applies to any A2A v1.0 client instance that resolves a remote agent via `/.well-known/agent.json` (or a vendor-specific card URL), caches the returned Agent Card, and subsequently issues `tasks/send` JSON-RPC calls against the advertised skills/endpoints. Does not cover intra-process tool invocation, MCP server manifests, or A2A streaming/SSE transport edge cases beyond the initial `tasks/send` handshake. ## Core Distinction An A2A v1.0 Agent Card is a *discovery-time advertisement*, not a *delegation-time contract*. The card declares `name`, `url`, `capabilities`, `skills[]`, `defaultInputModes`/`defaultOutputModes`, and `securitySchemes` — but the protocol has no mechanism that binds the serving agent to that advertisement at the moment a `tasks/send` request arrives. The card is a point-in-time JSON document fetched from a well-known path; the task is a separate RPC against a possibly different process, revision, or tenant behind the same `url`. The failure mode emerges when a client instance treats the card as a stable capability contract and skips re-validation at the delegation boundary. The card says "skill `summarize_legal_v2` accepts `text/plain` and returns `application/json`"; the client builds a task payload, ships it, and receives either a JSON-RPC `-32601 Method not found`, a `-32602 Invalid params` with a schema the client never saw, or — worse — a `200` with a `Task` object whose `artifacts` carry a media type not in `defaultOutputModes`. The card was true when fetched. It is not a promise about the task you are about to send. ## What Was Observed A cross-vendor delegation trace, anonymized, involving a client agent (Instance C) delegating document-redaction tasks to a vendor agent (Instance V) discovered via `https://vendor.example/.well-known/agent.json`. 1. **T+0 — Discovery.** Instance C fetches the card. Card advertises `skills: [{id: "redact_pii", inputModes: ["text/plain"], outputModes: ["application/json"], version: "1.4.2"}]`, `capabilities: {streaming: false, pushNotifications: false}`, `url: "https://vendor.example/a2a"`. Client caches card with a 24h TTL, keyed only on the base URL. 2. **T+0 to T+6h — Steady delegation.** ~4,000 `tasks/send` calls succeed. Client assumes the card is authoritative and stops including a `skillId` hint, relying on server-side routing from `message.parts`. 3. **T+6h — Vendor rollout.** Vendor deploys a new revision behind the same `url`. `redact_pii` is renamed to `redact_pii_v2`; `outputModes` narrows to `application/json+redacted` (a vendor extension). The well-known card is updated, but the client's cache does not expire for another 18h. 4. **T+6h01 — Silent divergence.** Client sends a task with `parts: [{type: "text", text: "..."}]` and no `skillId`. Server routes to the only remaining skill matching input mode, `redact_pii_v2`, which now returns `application/json+redacted`. Client's response parser is keyed on `application/json` and treats the artifact as opaque, passing it downstream unparsed. 5. **T+6h02 to T+9h — Compounding.** Downstream consumer of the artifact receives a blob it cannot deserialize; it retries the task twice (no idempotency key was set because the card did not advertise one). Vendor now processes each document three times. One retry lands after a second vendor deploy that drops `redact_pii_v2` entirely; that call returns JSON-RPC `-32601`. Client's error handler classifies `-32601` as a transport fault and re-queues indefinitely. 6. **T+9h — Detection.** Only when the client's own token budget for the delegation loop is exhausted does the loop halt. Root cause required diffing the cached card against a fresh fetch. The critical observation: every individual RPC was well-formed JSON-RPC. The protocol did not fail. The *invariant the client assumed* — "the card I hold describes the agent I am calling" — failed silently because A2A v1.0 provides no card-version echo, no `If-Match` on the card, and no server-side rejection of tasks built against a stale skill set. ## Condition of Validity The card-as-contract assumption holds only under a conjunction that is rarely satisfied in cross-vendor settings: - The serving agent's skill set, input/output modes, and routing rules are **immutable** for the lifetime of the client's cache TTL, **and** - The client pins delegation to a specific `skill.id` in every `tasks/send` (not relying on server-side routing), **and** - The client validates returned `artifacts[].mimeType` against the card's `outputModes` and fails closed on mismatch, **and** - The card's `url` resolves to a single revision (no blue/green or canary behind one hostname). Drop any one conjunct and the card degrades from contract to snapshot. In cross-vendor delegation, the vendor controls the deploy cadence and the routing logic; the client controls only the cache TTL and the per-task `skillId`. The client therefore cannot *enforce* the first conjunct and must not *assume* it. The only enforceable invariants are client-side: pin the skill, validate the output media type, and treat `-32601`/`-32602` as *card-staleness signals* rather than transport faults. ## Decision Boundary The boundary is the moment between cache-hit and task-send. Two questions decide the correct behavior: 1. **Is the task bound to a specific `skill.id` from the cached card?** If yes, a `-32601` is unambiguously "this skill no longer exists" → invalidate card, re-fetch, re-plan. If no (routing by input mode), a `-32601` is ambiguous — it may be a renamed skill or a transport fault, and retry-forever is the wrong default. 2. **Does the response artifact's `mimeType` appear in the cached card's `outputModes` for the invoked skill?** If yes, proceed. If no, the card is stale *even if the call succeeded* — the vendor changed output shape without a client-visible signal. Halt, re-fetch, and re-validate the downstream parser before continuing. The decision rule: **a successful RPC whose response violates the cached card is a staleness event, not a success.** Treat it exactly like a `-32601`. Conversely, a `-32601` on a skill-pinned task is a staleness event, not a transport error — do not retry without re-fetching. The failure to bound: unbounded retry on `-32601` when no `skillId` was pinned. This is the specific loop that consumed 9 hours and tripled vendor processing. The guardrail is a **card-staleness circuit breaker**: N consecutive schema-or-method mismatches (default N=2) force a synchronous re-fetch of the card and a re-plan, and any task issued with no `skillId` must carry an idempotency key so that a forced retry does not duplicate side effects. ## Operational Effect Implementing the boundary changes three behaviors: - **Every `tasks/send` pins `skill.id`** from the cached card. Server-side routing is treated as a fallback the client never relies on. This makes `-32601` a decidable signal. - **Response media types are checked against the card before parsing.** A mismatch raises a staleness exception that invalidates the cache and halts the delegation loop rather than passing an opaque artifact downstream. - **`-32601` and `-32602` are reclassified** from transport faults to staleness signals, and the retry policy for them is "re-fetch card, re-plan, retry once with new skill binding" — never "retry same payload." The residual risk is a vendor that changes behavior *without* changing the card (silent output-shape change under the same `mimeType`). No client-side invariant catches that; it requires either a card `version`/`etag` echoed in task responses (not in A2A v1.0) or out-of-band vendor change notification. The guardrail here is only to log the card hash alongside every task so that post-hoc divergence is attributable. ```python import hashlib import json from dataclasses import dataclass from typing import Any class CardStalenessError(RuntimeError): """Raised when a task response contradicts the cached Agent Card. A successful RPC whose artifact mimeType is absent from the card's outputModes is a staleness event, not a success. A -32601 on a skill-pinned task is a staleness event, not a transport fault. """ @dataclass(frozen=True) class CachedCard: url: str skills: dict[str, dict[str, Any]] # skill_id -> {inputModes, outputModes} card_hash: str @classmethod def from_json(cls, url: str, raw: dict[str, Any]) -> "CachedCard": skills = { s["id"]: { "inputModes": s.get("inputModes", []), "outputModes": s.get("outputModes", []), } for s in raw.get("skills", []) } digest = hashlib.sha256( json.dumps(raw, sort_keys=True).encode() ).hexdigest()[:16] return cls(url=url, skills=skills, card_hash=digest) def delegate(card: CachedCard, skill_id: str, payload: dict[str, Any], rpc) -> dict[str, Any]: """Issue a skill-pinned tasks/send and validate the response against the card. rpc is a callable(skill_id, payload, card_hash) -> dict with keys 'error' (JSON-RPC error code or None) and 'artifacts' (list of {mimeType}). """ if skill_id not in card.skills: raise CardStalenessError( f"skill {skill_id!r} not in cached card {card.card_hash}; re-fetch required" ) resp = rpc(skill_id, payload, card.card_hash) code = resp.get("error") if code in (-32601, -32602): # Method/params mismatch on a pinned skill == card is stale. raise CardStalenessError( f"JSON-RPC {code} on pinned skill {skill_id!r} " f"(card {card.card_hash}); invalidate cache and re-plan" ) if code is not None: raise RuntimeError(f"transport/rpc fault: {code}") allowed = set(card.skills[skill_id]["outputModes"]) for art in resp.get("artifacts", []): mt = art.get("mimeType") if mt not in allowed: # Silent success with off-contract output: still a staleness event. raise CardStalenessError( f"artifact mimeType {mt!r} not in outputModes {sorted(allowed)} " f"for skill {skill_id!r} (card {card.card_hash})" ) return resp class StalenessBreaker: """Circuit breaker: N schema/method mismatches force a synchronous re-fetch.""" def __init__(self, threshold: int = 2) -> None: self.threshold = threshold self._hits = 0 def record(self, exc: CardStalenessError) -> bool: self._hits += 1 if self._hits >= self.threshold: self._hits = 0 return True # caller must re-fetch card and re-plan return False ```