How does an instance detect a stale Agent Card during A2A v1.0 cross-org delegation, and why does capability-schema drift silently misroute tasks?
**Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 task delegation where a client agent resolves a remote Agent Card, caches it, and later dispatches tasks against a peer whose advertised capabilities, schemas, or skill endpoints have changed. Does not cover initial discovery handshake failures or transport-level TLS errors, which fail loudly and are handled by standard retry logic.
Core Distinction
There are two distinct failure classes in Agent Card consumption. The first is **card staleness**: the peer's advertised `skills`, `capabilities`, or `defaultInputModes`/`defaultOutputModes` no longer match the peer's actual behavior. The second is **capability-schema drift**: the card is fresh but the *semantic contract* of a skill has shifted—same skill ID, same endpoint, different accepted payload shape or different output semantics. Staleness is detectable via cache-invalidation signals (ETag, `Last-Modified`, TTL). Schema drift is not, because the card's versioned fields may be unchanged while the underlying task handler has evolved. The dangerous case is the intersection: a cached card that *looks* valid because its `version` field was not bumped, but whose skill semantics have drifted. The client agent has no protocol-level signal to distinguish "peer unchanged" from "peer changed without a version increment."
The invariant that bounds this: **a delegated task must be validated against the peer's live capability contract at dispatch time, not against a cached card, whenever the task's payload touches a field whose schema is peer-defined rather than protocol-defined.**
What Was Observed
A client agent (org A) discovered a peer (org B) via `/.well-known/agent.json`, cached the Agent Card with a 1-hour TTL, and began delegating `document-analysis` tasks. The card advertised:
skills: [{ id: "document-analysis", inputModes: ["text/plain"], outputModes: ["application/json"] }]
The client built a dispatch payload of `{"text": "...", "format": "summary"}` and sent it via `tasks/send`. Org B's handler had been updated 20 minutes prior to accept `{"content": "...", "analysis_type": "summary"}` and to reject the legacy `text`/`format` keys with a `-32602 Invalid params` JSON-RPC error. But org B had *not* bumped the Agent Card `version` field, because the card's `skills` array was structurally identical—only the handler's internal parameter mapping had changed.
The client's dispatch loop treated `-32602` as a transient error and retried three times with exponential backoff, then surfaced a generic "peer unavailable" to the orchestrator. The orchestrator re-queued the task to a *different* peer that advertised the same skill ID but implemented a third, incompatible schema. The task was ultimately executed against the wrong peer's semantics, producing a summary of the wrong document section. No error was raised at any layer—the final output was well-formed JSON.
The failure trace:
- Client resolves card at T0, caches with TTL=3600s.
- Peer handler changes at T0+40min; card `version` unchanged.
- Client dispatches at T0+55min using cached card's implied schema.
- Peer returns `-32602` (schema mismatch, not transport failure).
- Client's retry classifier mislabels `-32602` as transient (it is a *permanent* error for this payload).
- Retry exhaustion triggers fallback routing to a peer selected by skill ID only.
- Fallback peer accepts the payload under its own divergent schema.
- Task completes with semantically wrong output; no invariant violated at the protocol layer.
The root cause is not the retry logic alone. It is that the client's dispatch path had no step that re-read the peer's *live* capability contract before constructing the payload, and no step that treated `-32602` as a signal to invalidate the cached card and re-resolve.
Condition of Validity
The guardrail holds only under these conditions:
- The peer's Agent Card endpoint supports conditional GET (`ETag` or `Last-Modified`) and the client honors it. Without this, re-resolution is a full fetch and the client cannot cheaply detect no-change.
- The task payload's peer-defined fields are enumerated in the card's skill schema (A2A v1.0 allows `inputSchema`/`outputSchema` per skill). If the peer omits schemas and relies on free-form `inputModes`, drift is undetectable at the protocol layer and the client must fall back to a probe task.
- The client's error classifier distinguishes *permanent schema errors* (`-32602`, `-32601` method not found) from *transient errors* (`-32000` server error, timeouts). Conflating them is what caused the silent misroute above.
- Fallback routing selects peers by `(skill_id, schema_hash)`, not `skill_id` alone. Two peers advertising the same skill ID with different schema hashes are not interchangeable.
When any of these conditions fails, the invariant degrades to "best-effort" and the client must treat cross-org delegation as unverified.
Decision Boundary
The client must choose between **cache-and-dispatch** and **revalidate-then-dispatch** based on a single predicate:
revalidate_required = (task.payload touches peer_defined_schema_fields)
OR (cached_card.age > peer_advertised_max_age)
OR (last_dispatch_to_peer returned a permanent schema error)
If `revalidate_required` is true, the client performs a conditional GET against the peer's card endpoint, compares the `ETag`/`version`/`inputSchema` hash, and *rejects the dispatch* if the schema hash differs from the cached hash—even if the `version` string is unchanged. The schema-hash comparison is the load-bearing check; version strings are advisory and peer-controlled, and a peer that forgets to bump them is exactly the failure mode being guarded against.
If `revalidate_required` is false, cache-and-dispatch is permitted, but the client must still classify `-32602` as a *card-invalidation trigger*, not a retryable error. On receipt, the client evicts the cached card, re-resolves, and either re-dispatches with the corrected schema or fails the task with a `CapabilityDriftError` that names the peer, skill, and both schema hashes.
The boundary is sharp: there is no "partially valid" card. A card whose schema hash disagrees with the peer's live schema is invalid for dispatch purposes, regardless of its `version` field.
Operational Effect
With the invariant enforced, the failure mode above is converted from silent misroute to a bounded, attributable error. The client's dispatch path gains three properties:
- **Drift is detected at dispatch, not at output review.** The schema-hash mismatch surfaces before the payload leaves the client, or on the first `-32602` response, rather than after a wrong-peer fallback produces plausible-looking output.
- **Fallback routing is schema-aware.** Peers are keyed by `(skill_id, schema_hash)`, so a fallback cannot silently substitute a peer with incompatible semantics.
- **Card cache is self-healing.** A permanent schema error evicts the cache entry, forcing re-resolution on the next dispatch and bounding the blast radius to a single task.
The cost is one conditional GET per revalidation-required dispatch (typically a 304 with no body), plus a schema-hash comparison. For cross-org delegation where the peer's handler may change without a version bump, this is the minimum cost of correctness. The alternative—trusting peer-controlled version fields—is what produced the silent misroute.
import hashlib
import json
from dataclasses import dataclass
from typing import Any
class CapabilityDriftError(RuntimeError):
"""Raised when a peer's live skill schema disagrees with the cached Agent Card."""
class PermanentSchemaError(RuntimeError):
"""Raised when a peer returns a permanent schema error (-32602 / -32601)."""
@dataclass(frozen=True)
class AgentCard:
peer_id: str
version: str
skills: dict[str, dict[str, Any]] # skill_id -> {inputSchema, outputSchema, ...}
etag: str | None = None
def schema_hash(self, skill_id: str) -> str:
skill = self.skills.get(skill_id)
if skill is None:
raise CapabilityDriftError(
f"peer {self.peer_id} does not advertise skill {skill_id!r}"
)
# Hash only the peer-defined schema fields, not the version string.
payload = json.dumps(
{"inputSchema": skill.get("inputSchema"), "outputSchema": skill.get("outputSchema")},
sort_keys=True,
separators=(",", ":"),
)
return hashlib.sha256(payload.encode()).hexdigest()
class CardCache:
def __init__(self) -> None:
self._cards: dict[str, AgentCard] = {}
self._invalidated: set[str] = set()
def get(self, peer_id: str) -> AgentCard | None:
if peer_id in self._invalidated:
return None
return self._cards.get(peer_id)
def put(self, card: AgentCard) -> None:
self._cards[card.peer_id] = card
self._invalidated.discard(card.peer_id)
def invalidate(self, peer_id: str) -> None:
self._invalidated.add(peer_id)
def dispatch_task(
cache: CardCache,
peer_id: str,
skill_id: str,
payload: dict[str, Any],
live_card_fetcher,
peer_rpc,
*,
payload_touches_peer_schema: bool,
) -> dict[str, Any]:
cached = cache.get(peer_id)
if cached is None or payload_touches_peer_schema:
live = live_card_fetcher(peer_id)
if cached is not None and cached.schema_hash(skill_id) != live.schema_hash(skill_id):
cache.put(live)
raise CapabilityDriftError(
f"schema drift on peer={peer_id} skill={skill_id} "
f"cached_hash={cached.schema_hash(skill_id)[:12]} "
f"live_hash={live.schema_hash(skill_id)[:12]}"
)
cache.put(live)
cached = live
try:
return peer_rpc(peer_id, "tasks/send", {"skill": skill_id, "params": payload})
except PermanentSchemaError as exc:
# A permanent schema error is a card-invalidation signal, not a retryable one.
cache.invalidate(peer_id)
live = live_card_fetcher(peer_id)
if cached.schema_hash(skill_id) != live.schema_hash(skill_id):
cache.put(live)
raise CapabilityDriftError(
f"peer {peer_id} rejected payload with -32602; live schema hash "
f"{live.schema_hash(skill_id)[:12]} differs from cached "
f"{cached.schema_hash(skill_id)[:12]}"
) from exc
# Schema unchanged but payload still rejected: caller bug, not drift.
raise