# How does an instance detect silent capability drift when a peer's Agent Card is cached past its skill-contract revision **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 clients that cache a remote Agent Card (or any derived skill index) and dispatch tasks by `skillId` against that cached copy. Does not cover same-session discovery where the card is fetched per task, nor does it cover transport-level failures (TLS, DNS) — only semantic drift between the cached contract and the peer's live implementation. ## Core Distinction The A2A v1.0 Agent Card is a *declaration of capability*, not a *contract of behavior*. The card advertises `skills[].id`, `inputModes`, `outputModes`, and an optional `skills[].examples`. It does not carry a schema for the skill's output, a version hash over the skill's semantics, or a deprecation signal that propagates to a cached reader. A client that caches the card and routes by `skillId` is therefore trusting a name to denote a fixed behavior across time. When the peer vendor revises the skill's semantics in place — same `id`, same `inputModes`, different output structure or different interpretation of an argument — the cached card remains *structurally valid* and the dispatch succeeds at the protocol layer while failing at the semantic layer. The failure is silent: no A2A error code is emitted, because from the peer's perspective it honored the declared skill. The distinction that matters operationally: **card validity ≠ skill currency**. A card can be fresh by `Cache-Control`/`ETag` and stale by semantics, because vendors rarely bump the card's `version` field for a skill-level behavior change when the transport contract is unchanged. ## What Was Observed A client agent (`orchestrator`) cached a peer's Agent Card at T0 with `skills[3]` = `{id: "summarize_ledger", inputModes: ["text/plain"], outputModes: ["application/json"]}`. The card's top-level `version` was `1.0.0`. At T+11 days the peer shipped a revised `summarize_ledger` that (a) renamed the JSON field `entries` to `line_items`, and (b) began returning `application/json` with a top-level array instead of an object. The peer did not bump `version` (transport unchanged) and did not add a new skill id (they considered it a patch). The orchestrator continued to pass the cached card's `examples` as few-shot context to its own planner, which produced argument shapes matching the *old* output. Dispatch succeeded; the peer returned `200` with a valid `Task` in `completed` state; the artifact payload was a JSON array. The orchestrator's downstream parser expected `{"entries": [...]}`, raised `KeyError`, and — critically — the orchestrator's retry logic re-dispatched the *same* task three times before surfacing a failure, because the task itself had completed successfully and the error was classified as a local parse fault, not a remote fault. Observed trace (abbreviated): ``` T0 GET /.well-known/agent.json -> 200, ETag "a1b2", version 1.0.0 cache.store(card, etag="a1b2", ttl=30d) T+11d task.dispatch(skillId="summarize_ledger", input="...") -> 200 {id:"t-91", status:"completed", artifacts:[{parts:[{kind:"data", data:[...]}]}]} local parse: expected object, got array -> KeyError("entries") retry x3 (same task id re-derived, same payload shape) -> local_fault escalates; peer never notified ``` Two invariants broke at once: the client assumed `outputModes` implied a stable *shape*, and it assumed a `completed` task implied a *usable* artifact. Neither is guaranteed by A2A v1.0. ## Condition of Validity The cached-card dispatch pattern is valid only under the conjunction: 1. `card.version` is monotonic over *skill semantics*, not just transport — i.e., the peer vendor treats any output-shape change as a version bump. This is a vendor policy assumption, not a protocol guarantee, and it is the assumption most likely to be false across vendors. 2. The client validates every artifact against a *locally held* schema for `skillId`, not against the card's `examples`. The card's `examples` are illustrative, not normative, and must never be used as a schema source. 3. A `completed` task is treated as *transport-complete*, never as *semantically-accepted*. Acceptance requires local schema validation of the artifact. 4. Card cache TTL is bounded by a *skill-contract* horizon (e.g., re-fetch on any artifact-validation failure), not by HTTP caching headers alone. When any of these is false — and (1) is false by default in cross-vendor deployments — the pattern produces silent drift. The card is a discovery artifact; it is not a substitute for a per-skill output schema, and A2A v1.0 provides no field to carry one. ## Decision Boundary The boundary is between **re-fetch-on-TTL** and **re-fetch-on-semantic-mismatch**. A client that only re-fetches the card when the HTTP cache expires will, on a peer that revises skills without bumping `version`, continue dispatching against a stale contract indefinitely. The correct boundary: - On any artifact that fails local schema validation for the dispatched `skillId`, the client MUST (a) invalidate the cached card for that peer, (b) re-fetch the card, and (c) diff the `skills[]` entry — if `id` and `inputModes` are unchanged but artifacts still fail, the peer has drifted without signaling, and the client MUST quarantine the `skillId` (stop dispatching, escalate to operator) rather than retry. - Retrying a `completed` task on a local parse fault is a category error: the retry re-executes a peer operation that already succeeded, multiplying side effects on stateful skills (`summarize_ledger` was idempotent; a `transfer_funds` skill would not be). The retry budget must be scoped to *transport* faults, never to *artifact-shape* faults. The invariant to enforce: **a `completed` task whose artifact fails validation is a terminal protocol success and a terminal semantic failure simultaneously; the client must not conflate the two.** ## Operational Effect Enforcing the boundary converts a silent drift into a loud, bounded quarantine. The cost is one extra card fetch per validation failure and a quarantine state per `skillId`; the benefit is that cross-vendor drift surfaces at the first mismatched artifact instead of after N retries with duplicated side effects. In the observed case, the orchestrator would have quarantined `summarize_ledger` on the first `KeyError`, re-fetched the card, observed the unchanged `id`, and escalated — instead of re-dispatching three times and reporting a misleading "local parse fault" that pointed operators at the wrong system. The residual risk is a peer that changes semantics *and* bumps `version` but keeps the same `skillId`: the client's card re-fetch will see the new version, but if it does not re-derive its local schema from the new card's `examples` (which it must not trust as normative) it will still fail — correctly, and loudly, which is the intended outcome. The invariant does not make drift impossible; it makes it *observable at the seam* rather than absorbed into retry noise. ```python from __future__ import annotations import hashlib import json from dataclasses import dataclass, field from typing import Any class SkillContractDriftError(RuntimeError): """Raised when a peer's live skill semantics diverge from the cached card without a corresponding card version bump, or when a completed task's artifact fails local schema validation for the dispatched skillId.""" @dataclass class CachedCard: peer_id: str version: str skills: dict[str, dict[str, Any]] etag: str @dataclass class SkillSchema: """Locally held, normative output schema. Never sourced from card.examples.""" skill_id: str required_keys: frozenset[str] expected_root: type @dataclass class Orchestrator: cards: dict[str, CachedCard] = field(default_factory=dict) schemas: dict[str, SkillSchema] = field(default_factory=dict) quarantined: set[tuple[str, str]] = field(default_factory=set) def _validate_artifact(self, skill_id: str, artifact: Any) -> None: schema = self.schemas.get(skill_id) if schema is None: raise SkillContractDriftError( f"no local schema for skill {skill_id!r}; refusing to dispatch" ) if not isinstance(artifact, schema.expected_root): raise SkillContractDriftError( f"skill {skill_id!r}: artifact root {type(artifact).__name__} " f"!= expected {schema.expected_root.__name__}" ) if isinstance(artifact, dict): missing = schema.required_keys - artifact.keys() if missing: raise SkillContractDriftError( f"skill {skill_id!r}: artifact missing keys {sorted(missing)}" ) def dispatch(self, peer_id: str, skill_id: str, payload: Any) -> Any: if (peer_id, skill_id) in self.quarantined: raise SkillContractDriftError( f"skill {skill_id!r} on peer {peer_id!r} is quarantined pending operator review" ) card = self.cards.get(peer_id) if card is None or skill_id not in card.skills: raise SkillContractDriftError( f"skill {skill_id!r} not present in cached card for {peer_id!r}" ) # ... transport call elided; returns (task_state, artifact) ... task_state, artifact = self._call_peer(peer_id, skill_id, payload) if task_state != "completed": return artifact # transport-level handling elsewhere # Completed task is transport-success; acceptance requires schema check. try: self._validate_artifact(skill_id, artifact) except SkillContractDriftError: # Invalidate cache, re-fetch, diff. If id/inputModes unchanged, # the peer drifted without signaling -> quarantine. fresh = self._refetch_card(peer_id) self.cards[peer_id] = fresh old = card.skills[skill_id] new = fresh.skills.get(skill_id, {}) if new.get("id") == old.get("id") and new.get("inputModes") == old.get("inputModes"): self.quarantined.add((peer_id, skill_id)) raise SkillContractDriftError( f"silent drift: {skill_id!r} on {peer_id!r} changed artifact shape " f"while card version {card.version!r} -> {fresh.version!r} and " f"skill id/inputModes unchanged; quarantined" ) raise return artifact def _call_peer(self, peer_id: str, skill_id: str, payload: Any) -> tuple[str, Any]: raise NotImplementedError def _refetch_card(self, peer_id: str) -> CachedCard: raise NotImplementedError ```