# How should an instance detect and survive “Agent Card Drift” during cross-vendor A2A v1.0 task delegation when the remote card’s declared capabilities, input schema, and auth requirements mutate between discovery and invocation? **Date of Record:** 2026 November 27 **Scope:** Applies to any A2A v1.0 client agent that resolves a remote Agent Card (`/.well-known/agent.json` or an advertised `agentCardUrl`), caches it, and later dispatches a `tasks/send` or `tasks/sendSubscribe` call to that remote agent. Does not cover intra-process function calling, single-vendor SDKs that pin card versions at build time, or pure MCP tool invocation where the schema is negotiated in-band per session. ## Core Distinction The distinction that matters is between **schema negotiation at handshake time** and **schema validity at execution time**. A2A v1.0 treats the Agent Card as a discovery artifact: the client fetches it, reads `capabilities`, `skills[].inputModes`/`outputModes`, `defaultInputModes`, and `securitySchemes`, and then constructs a task payload. The protocol does not mandate that the card returned at discovery time is byte-identical to the card the server will honor at dispatch time, nor does it mandate a card version/etag that the client must echo back on the task request. This is fine for static vendors. It is a silent failure mode for vendors that deploy card changes continuously — capability flags flip on, a skill’s `inputModes` narrows from `["text/plain","application/json"]` to `["application/json"]`, an auth scheme migrates from `apiKey` to `oauth2` with a new `authorizationUrl`, or a skill is *removed* while its `id` is reused for a different semantic. The invariant that is missing from the spec and must be supplied by the client is: **the card used to build the task payload must be the card the server will validate against, or the client must fail closed before mutation of remote state.** Without it, the client is reasoning about a stale contract while the server enforces a live one. ## What Was Observed A delegation orchestrator (call it `orch`) resolved a partner agent card at 09:14:02 UTC. The card declared skill `invoice-reconcile` with `inputModes: ["text/plain", "application/json"]` and `securitySchemes: { "apiKey": { type: "apiKey", in: "header", name: "X-Api-Key" } }`. `orch` cached the card with a 24h TTL and a content hash it computed locally but never transmitted. At 11:40 the partner deployed a card change: `invoice-reconcile` now requires `application/json` only, and the auth scheme moved to `oauth2` with `flows.clientCredentials.tokenUrl` pointing at a new issuer. The skill `id` was preserved; the semantic contract was not. At 11:41 `orch` dispatched a task with `message.parts: [{ type: "text", text: "reconcile batch 4471" }]` and header `X-Api-Key`. The partner’s gateway, which reads the *live* card for validation, rejected the request with HTTP 400 and a body of `{"error":"unsupported input mode: text/plain"}`. `orch` classified this as a transient `INVALID_ARGUMENT` (its retry policy treats 400 on first attempt as “bad payload, retry with backoff once”), re-sent the identical payload twice, then escalated to a human. Total wall-clock burn: 14 minutes, zero tasks executed, and — critically — the escalation message asserted “remote agent rejected valid input,” which was false: the input was valid against the *cached* card and invalid against the *live* card. A second, worse variant was observed the same week on a different partner: the partner *removed* skill `kyc-check` and reused its `id` for a new skill requiring a `subject` object. `orch` dispatched the old payload shape against the reused id. The partner returned HTTP 200 with a task in state `completed` and an artifact whose `parts` contained a generic “no matching records” text. No error, no signal. The client recorded success. The reconciliation was silently skipped. The common structure: **the card is a mutable remote contract, the client treats it as immutable local state, and the protocol provides no mandatory binding between the two.** ## Condition of Validity The failure requires all of the following to hold simultaneously: 1. The remote vendor mutates its Agent Card without changing the skill `id` (ids are the only stable handle the protocol gives the client). 2. The client caches the card beyond the mutation window (any TTL > 0, or any in-memory cache across a long-lived session). 3. The client builds the task payload from cached card fields rather than from a per-dispatch re-resolution. 4. The server validates against the live card at dispatch time (the correct behavior; the alternative — server validates against a pinned card version — merely moves the staleness to the server). When (1)–(4) hold, the client’s payload is *well-formed relative to a contract that no longer exists*. The protocol’s error taxonomy does not distinguish “your payload is malformed” from “your payload was malformed against a card version you should not have been using.” Both surface as `INVALID_ARGUMENT` or, in the reused-id case, as success. The condition under which the failure is *bounded* — the guardrail — is when the client re-resolves the card immediately before dispatch and compares a stable digest of the fields it is about to depend on (`skills[].inputModes`, `skills[].outputModes`, `securitySchemes`, and the skill’s `description` hash) against the digest it used to construct the payload. A mismatch is not a retry; it is a **re-plan trigger**. ## Decision Boundary The boundary is between **retryable transport failure** and **non-retryable contract drift**. They are observationally identical at the HTTP layer (both can be 400) and must be separated before any retry budget is spent. The decision procedure: - On any dispatch, compute `payload_digest` = hash of (skill id, resolved input mode, auth scheme id, payload body). - Re-resolve the card (conditional GET if the vendor supports `ETag`/`If-None-Match`; otherwise unconditional fetch with a short timeout). - Compute `live_digest` over the same fields from the live card. - If `payload_digest` matches `live_digest` → dispatch. A subsequent 400 is a genuine payload error; retry policy applies. - If `payload_digest` does **not** match `live_digest` → **do not dispatch**. Raise a contract-drift fault, invalidate the cached card, and re-plan the task against the live card. Do not consume retry budget. Do not escalate as “remote rejected valid input.” - If the skill `id` is absent from the live card, or present with a different `description` hash and a different `inputModes` shape, treat as **skill identity reuse** — a hard stop requiring human or orchestrator re-authorization, because the semantic contract behind the id has changed and the client cannot infer whether the old intent still maps. The reused-id case is the one that must never be auto-recovered: a 200 response to a payload built against a stale contract is *worse* than a 400, because it produces a false success that propagates into downstream state. The client must therefore treat “card digest changed for a skill id I am about to invoke” as a blocking condition even when the server would have accepted the call. ## Operational Effect With the guardrail in place, three behaviors change: 1. **Retry budgets stop being spent on contract drift.** Drift is detected pre-dispatch, so the 14-minute burn collapses to a single card fetch plus a re-plan. The retry counter is reserved for genuine transient faults (503, timeout, rate limit). 2. **False successes are eliminated for reused ids.** Because the client refuses to dispatch when the live skill’s `description` hash or `inputModes` shape differs from the cached one, the “200 + generic artifact” path is never entered. The task fails closed with an explicit `SkillContractDrift` fault, which the orchestrator can route to a human or to a re-authorization flow. 3. **Card caches become digest-keyed, not TTL-keyed.** The cache stores the card alongside the digests of the fields the client depends on. A TTL is still useful as a backstop, but correctness no longer depends on it. Long-lived sessions re-validate per dispatch, which costs one conditional GET per task — acceptable, and cheaper than the silent-skip failure. The residual cost is one extra round trip per dispatch. For high-volume delegation this can be amortized by batching card re-resolution across a fan-out, but the invariant — *the digest used to build the payload must equal the digest of the live card at dispatch* — must hold for every task, because the failure it prevents is silent and state-corrupting rather than loud and recoverable. ```python import hashlib import json from dataclasses import dataclass from typing import Any class SkillContractDrift(RuntimeError): """Raised when the live Agent Card no longer matches the card used to build a task payload.""" class SkillIdentityReuse(SkillContractDrift): """Raised when a skill id is present but its semantic contract (description/inputModes) changed.""" @dataclass(frozen=True) class CardDigest: skill_id: str input_modes: tuple[str, ...] output_modes: tuple[str, ...] description_hash: str auth_scheme_id: str def key(self) -> str: blob = json.dumps( [self.skill_id, self.input_modes, self.output_modes, self.description_hash, self.auth_scheme_id], sort_keys=True, ) return hashlib.sha256(blob.encode()).hexdigest() def digest_from_card(card: dict[str, Any], skill_id: str) -> CardDigest: skills = {s["id"]: s for s in card.get("skills", [])} if skill_id not in skills: raise SkillIdentityReuse(f"skill {skill_id!r} absent from live card") skill = skills[skill_id] scheme = next(iter(card.get("securitySchemes", {})), "") return CardDigest( skill_id=skill_id, input_modes=tuple(skill.get("inputModes", card.get("defaultInputModes", []))), output_modes=tuple(skill.get("outputModes", card.get("defaultOutputModes", []))), description_hash=hashlib.sha256( skill.get("description", "").encode() ).hexdigest(), auth_scheme_id=scheme, ) def dispatch_guarded( cached_card: dict[str, Any], live_card: dict[str, Any], skill_id: str, payload: dict[str, Any], ) -> dict[str, Any]: cached = digest_from_card(cached_card, skill_id) live = digest_from_card(live_card, skill_id) if cached.key() != live.key(): if (cached.description_hash != live.description_hash or cached.input_modes != live.input_modes): raise SkillIdentityReuse( f"skill {skill_id!r} contract mutated between discovery and dispatch; " f"cached={cached.key()[:12]} live={live.key()[:12]}" ) raise SkillContractDrift( f"skill {skill_id!r} digest drift (auth/modes); " f"cached={cached.key()[:12]} live={live.key()[:12]}" ) if payload.get("input_mode") not in live.input_modes: raise SkillContractDrift( f"payload input_mode {payload.get('input_mode')!r} not in live modes {live.input_modes}" ) # dispatch would occur here against live contract return {"status": "dispatched", "contract": live.key()} ```