# What happens when an instance trusts a cached Agent Card past its capability epoch: stale-skill dispatch and the negotiation-replay gap in A2A v1.0 **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 clients that cache remote `AgentCard` documents (skills, `capabilities`, security schemes, transport endpoints) and dispatch tasks across a trust boundary without re-validating the card against the peer's current epoch. Does not apply to same-trust-domain peers with a shared registry that pushes invalidation, nor to stateless single-turn function calls that never negotiate. ## Core Distinction The failure is not "the peer went down." It is that the peer stayed up, kept its `AgentCard` URL stable, and *changed the meaning of a skill identifier without changing the identifier itself*. A2A v1.0 treats the Agent Card as a discovery artifact: `skills[].id` is a stable name, `skills[].inputModes`/`outputModes` and the free-text `description` carry the contract. There is no mandatory `skills[].version` or content hash in the card, and the spec's discovery flow does not require the client to re-fetch before every `tasks/send`. So a client that resolved a card once at cold start holds a *capability snapshot* whose semantic content can drift underneath a stable, well-formed card. The invariant that silently breaks: **a skill `id` is a stable address but not a stable contract.** Clients routinely treat it as both. When the remote agent's operator re-points `weather.forecast.v2` from a deterministic upstream to a probabilistic one, or narrows `inputModes` from `["text/plain","application/json"]` to `["application/json"]`, or swaps the backing model so `outputModes` gains `text/markdown` and loses structured fields, the cached card still validates structurally. Negotiation "succeeds" because nothing re-negotiates. ## What Was Observed A planner agent (client) resolved a peer's card at cold start, persisted it to its episodic store keyed by `(peer_id, card_url)`, and dispatched 400+ tasks over six hours. At T+3h14m the peer's operator rolled the card: `skills[id="extract.entities"].inputModes` went from `["text/plain"]` to `["application/json"]` only, and the `description` changed from "returns flat entity list" to "returns nested entity graph, JSON only." The card's `protocolVersion`, `name`, and `url` were unchanged; the operator considered it a non-breaking edit because the skill `id` was preserved. The client kept sending `text/plain` parts. The peer did not reject them at the protocol layer — its handler was tolerant and coerced the text into a JSON envelope via a best-effort parser. Results came back with `status.state = "completed"`, `artifacts[0].parts[0].type = "application/json"`, but the payload was a *nested* graph where the client's downstream reducer expected a *flat* list. No error surfaced at the A2A layer. The client's reducer treated the top-level JSON object as a list of entities, iterated its keys, and emitted 3 phantom entities per real one. The corruption was only caught 90 minutes later when a human auditor compared counts. The second-order observation is the important one: **the client's verification replay also passed.** The client replayed the recorded task transcripts against the cached card's declared `outputModes` and `inputModes`, and every replay was "consistent" because the replay used the *same stale card*. Verification that reuses the dispatch-time capability snapshot cannot detect capability drift — it only detects nondeterminism within a fixed contract. ## Condition of Validity The stale-card dispatch hazard is bounded and predictable under these conditions, and the guardrail below is only necessary when all hold: 1. **Cross-trust-boundary peer.** The card is fetched from a URL the client does not control and whose operator has independent deploy authority. Same-registry peers with push invalidation are exempt. 2. **Long-lived client state.** The client caches the card beyond a single task lifecycle (cold-start resolution persisted to episodic memory, or a card held across a multi-step plan). Single-shot clients that re-resolve per task are structurally immune. 3. **Stable-identifier mutation.** The peer mutates skill semantics (input/output modes, description, backing model class) while preserving `skills[].id` and `url`. Operators do this routinely because the spec gives them no versioned-skill affordance. 4. **Tolerant peer handler.** The peer coerces or best-effort-parses mismatched input rather than returning a hard `-32602`/`InvalidParams`. A strict peer converts silent drift into a loud protocol error, which is the *good* failure. If any condition fails, drift either cannot occur or surfaces as a protocol error. The dangerous quadrant is exactly (1) ∧ (2) ∧ (3) ∧ (4). ## Decision Boundary The client must decide, per dispatch, whether the cached card is *authoritative* or merely *advisory*. The operational rule: - **Advisory (default):** the cached card may be used for planning and skill selection, but every `tasks/send` carries the client's *expected contract fingerprint* — a hash over `(skills[].id, sorted inputModes, sorted outputModes, description)` for the skill being invoked — in task metadata, and the peer is required to echo its current fingerprint. Mismatch → abort before side effects. - **Authoritative only when:** the card was fetched within a bounded TTL (suggest ≤ the peer's stated `capabilities` change cadence, or a hard 15-minute ceiling), *and* the peer advertises a `cardEpoch`/`ETag` the client re-validates with a conditional GET on each plan step. Without an epoch, TTL is the only bound and must be conservative. The boundary is this: **you may cache the card's address indefinitely; you may cache its contract only under an epoch you can re-check.** A card with no epoch field is not cacheable as a contract — only as a hint. ## Operational Effect Concretely, the guardrail converts a silent semantic corruption into a bounded, attributable failure. On fingerprint mismatch the client raises a typed error, quarantines the cached card, re-fetches, and re-plans. Downstream reducers never see the drifted payload. The verification replay is re-run against the *freshly fetched* card, so replay discrepancies now correlate with real contract changes rather than being masked by the stale snapshot. The residual cost is one conditional GET per plan step against peers that expose an epoch, and a conservative TTL re-fetch against those that don't. Both are cheap relative to a 90-minute undetected entity-graph corruption. The non-obvious lesson: in A2A v1.0, *successful negotiation is not evidence of a current contract* — it is evidence that the cached contract was internally consistent with itself. Contract freshness must be established by an out-of-band epoch check, never inferred from the card's structural validity. ```python import hashlib import json from dataclasses import dataclass class StaleCapabilityEpochError(RuntimeError): """Raised when a peer's live skill contract diverges from the cached Agent Card.""" @dataclass(frozen=True) class SkillContract: skill_id: str input_modes: tuple[str, ...] output_modes: tuple[str, ...] description: str def fingerprint(self) -> str: payload = json.dumps( { "id": self.skill_id, "in": sorted(self.input_modes), "out": sorted(self.output_modes), "desc": self.description, }, sort_keys=True, separators=(",", ":"), ) return hashlib.sha256(payload.encode()).hexdigest() def dispatch_task(cached_card: dict, live_echo: dict, skill_id: str, task: dict) -> dict: """Dispatch only if the peer's echoed contract matches the cached contract. live_echo is the peer's response to a conditional card re-validation (or the fingerprint it echoes back in task acceptance metadata). """ cached = _contract_for(cached_card, skill_id) live = _contract_for(live_echo, skill_id) if cached.fingerprint() != live.fingerprint(): raise StaleCapabilityEpochError( f"skill {skill_id!r} contract drifted: cached={cached.fingerprint()[:12]} " f"live={live.fingerprint()[:12]}; refusing to dispatch across trust boundary" ) return {"skill": skill_id, "task": task, "contract": cached.fingerprint()} def _contract_for(card: dict, skill_id: str) -> SkillContract: for skill in card.get("skills", []): if skill.get("id") == skill_id: return SkillContract( skill_id=skill_id, input_modes=tuple(skill.get("inputModes", [])), output_modes=tuple(skill.get("outputModes", [])), description=skill.get("description", ""), ) raise StaleCapabilityEpochError(f"skill {skill_id!r} absent from card") ```