# Which invariants prevent silent capability drift when A2A v1.0 Agent Cards are cached across org boundaries **Date of Record:** 2026 November 19 **Scope:** Applies to A2A v1.0 cross-organization task delegation where a client agent discovers a remote Agent Card, caches it, and later delegates tasks whose `skills[].id`, schema, or auth requirements may have changed. Does not apply to same-process in-memory tool calls or to MCP tool listings, which have different refresh semantics. ## Core Distinction The failure here is not "the card is stale." It is that **Agent Card discovery is a pull-based, self-asserted capability advertisement, while task delegation is a push-based, binding commitment.** The card is a promise the remote agent makes about what it *can* do; the task submission is a contract the client makes about what it *requires*. A2A v1.0 does not bind the card's content to the task's acceptance at submission time. So the window between "client read card" and "client submits task" is unguarded, and the remote agent can accept a task for a skill it no longer implements — or silently route it to a degraded fallback — without any protocol-level signal that the card it advertised is no longer true. The non-obvious part: the remote agent is *not obligated to reject* a task referencing a `skillId` absent from its current card. Many implementations treat `skillId` as a routing hint, not a validated key. The client's cached card is the only record of what was promised, and it lives on the wrong side of the trust boundary. ## What Was Observed A client agent (org A) discovered a remote agent (org B) at `https://b.example/a2a`. The card advertised: ``` skills: [{ id: "invoice.reconcile", inputModes: ["application/json"], outputModes: ["application/json"], schema: { version: "2.1", fields: ["invoice_id","line_items","currency"] } }] ``` Org A cached the card with a 24h TTL. Six hours later, org B shipped a schema bump to `2.2` that renamed `line_items` → `items` and added a required `tax_jurisdiction`. Org B's card was updated, but org A's cache was still warm. Org A submitted a `tasks/send` with a `2.1`-shaped payload referencing `invoice.reconcile`. Org B's handler performed **lenient deserialization**: unknown fields dropped, missing `tax_jurisdiction` defaulted to `"US"`. The task was accepted, returned `state: "completed"`, and produced a reconciliation against the wrong tax jurisdiction. No error, no `TaskState.input-required`, no schema-mismatch rejection. The failure was detected three days later during a financial audit — not by the protocol. The trace: 1. `GET /.well-known/agent.json` → card v2.1 (cached, TTL 24h). 2. Org B deploys card v2.2. No push notification, no version negotiation on `tasks/send`. 3. Org A `POST /a2a` `tasks/send` with `skillId: "invoice.reconcile"`, payload shaped to v2.1. 4. Org B deserializes leniently, defaults missing required field, accepts. 5. `TaskState` transitions `submitted → working → completed`. 6. Result is semantically wrong but structurally valid JSON matching the *v2.2* output schema, which org A's v2.1 parser also accepts (superset). The invariant that was violated: **the card version the client validated against must equal the card version the server executes against, for the duration of the task.** A2A v1.0 has no field in `tasks/send` to assert this. The `metadata` object is free-form and unvalidated by the protocol. ## Condition of Validity The cached-card pattern is safe only under a conjunction that is rarely checked: - The remote card is **immutable for the cache TTL**, or - The card carries a monotonic `version`/`etag` that the client sends on `tasks/send` and the server *rejects on mismatch*, or - The server performs **strict schema validation** and returns `TaskState.rejected` (or a `-32602` JSON-RPC error) on any payload not conforming to the currently advertised schema. A2A v1.0 mandates none of these. The spec defines `AgentCard` fields (`name`, `description`, `url`, `version`, `capabilities`, `skills`, `defaultInputModes`, `defaultOutputModes`, `authentication`) but does not require the server to validate inbound task payloads against `skills[].schema`, nor does it define a version-pinning handshake on `tasks/send`. Lenient deserialization on the server side — common in Python/JS handlers — converts a schema drift into a silent semantic error rather than a protocol error. The pattern is *invalid* whenever: (a) the remote agent's card can change faster than the client's cache TTL, AND (b) the remote handler deserializes leniently, AND (c) the task has side effects (payments, state mutations, external API calls) where a wrong-but-accepted result is worse than a rejected one. ## Decision Boundary The boundary is: **does the client treat the card as a routing hint or as a validated contract?** If routing hint, cache freely and accept that `skillId` is advisory. If contract, the client must enforce version pinning itself, because the protocol will not. Concretely, the client must, before every side-effecting `tasks/send`: 1. Re-fetch the card (or use a short TTL, e.g. 60s) and compare `version` against the cached version. If changed, re-validate the payload against the new schema before submission; do not submit the stale-shaped payload. 2. Include the card `version` in `tasks/send.metadata.cardVersion` and require the server to echo it in the `Task` object. If the echo is absent or mismatched, treat as `rejected` regardless of `TaskState`. 3. On receipt of a `Task` whose `state == "completed"`, validate the result against the *cached* card's output schema, not the current one. A mismatch means the server executed against a different schema than the client validated — escalate, do not consume the result. The server-side guardrail (which org B lacked) is strict validation: reject any `tasks/send` whose payload does not conform to the currently advertised `skills[].schema`, returning `TaskState.rejected` with a machine-readable reason. Lenient deserialization is a protocol violation in spirit even where the spec is silent. ## Operational Effect Without these guards, cross-org delegation degrades into **silent semantic drift**: tasks complete, results look valid, and the error surfaces only in downstream reconciliation. The blast radius scales with the side-effect weight of the skill — a `search` skill drifts harmlessly, an `invoice.reconcile` or `payment.initiate` skill drifts into financial loss. The invariant to encode: *card version at validation time == card version at execution time, asserted on the wire, enforced by rejection.* Any client that caches a card for longer than the remote's deploy cadence, and any server that deserializes leniently, has an unguarded window. The protocol will not close it for you; the client and server must each enforce their half. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class CardVersionDriftError(RuntimeError): """Raised when the card version used to validate a payload does not match the version the remote agent executed against.""" class LenientDeserializationError(RuntimeError): """Raised when a server accepts a payload that does not conform to the currently advertised skill schema (unknown fields or missing required).""" @dataclass class AgentCard: version: str skills: dict[str, dict[str, Any]] = field(default_factory=dict) def fingerprint(self) -> str: blob = json.dumps( {"version": self.version, "skills": self.skills}, sort_keys=True ).encode() return hashlib.sha256(blob).hexdigest() @dataclass class CachedCard: card: AgentCard fetched_at: float ttl_seconds: float def is_fresh(self, now: float) -> bool: return (now - self.fetched_at) < self.ttl_seconds def submit_task( cached: CachedCard, live: AgentCard, skill_id: str, payload: dict[str, Any], now: float, ) -> dict[str, Any]: if not cached.is_fresh(now): raise CardVersionDriftError( f"cached card expired at t={cached.fetched_at + cached.ttl_seconds}, " f"now={now}; refusing side-effecting submit" ) if cached.card.fingerprint() != live.fingerprint(): raise CardVersionDriftError( f"card drifted between cache and submit: cached version " f"{cached.card.version} != live version {live.version}; " f"re-validate payload before resubmission" ) skill = cached.card.skills.get(skill_id) if skill is None: raise CardVersionDriftError( f"skill {skill_id!r} not present in validated card version " f"{cached.card.version}" ) required = set(skill.get("schema", {}).get("required", [])) provided = set(payload.keys()) missing = required - provided if missing: # The server MUST reject this; if it does not, it is deserializing # leniently and the caller must not trust the result. raise LenientDeserializationError( f"payload missing required fields {sorted(missing)} for skill " f"{skill_id!r}; a compliant server rejects with TaskState.rejected" ) envelope = { "skillId": skill_id, "payload": payload, "metadata": {"cardVersion": cached.card.version, "cardFingerprint": cached.card.fingerprint()}, } return envelope def verify_task_result( envelope: dict[str, Any], task: dict[str, Any], live: AgentCard, ) -> None: echoed = task.get("metadata", {}).get("cardVersion") asserted = envelope["metadata"]["cardVersion"] if echoed != asserted: raise CardVersionDriftError( f"server executed against card version {echoed!r} but client " f"validated against {asserted!r}; result is not trustworthy" ) if task.get("state") != "completed": raise CardVersionDriftError( f"task did not complete: state={task.get('state')!r}" ) if live.version != asserted: raise CardVersionDriftError( f"card changed again after execution: executed {asserted!r}, " f"live now {live.version!r}; replay required" ) ```