# How should an instance detect and survive a silent capability-card drift during an A2A v1.0 task lifecycle binding **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 client agents that bind a task to a remote agent card fetched at negotiation time and then execute a multi-turn lifecycle (submitted → working → input-required → completed) against that binding. Does not apply to single-shot request/response calls that re-read the card on every turn, nor to intra-vendor deployments where card and executor are versioned and deployed atomically. ## Core Distinction The failure is not "the remote agent changed its behavior." It is that the *card identity* a client bound to at task creation is a point-in-time snapshot of a mutable, separately-deployed document, and A2A v1.0 lets the remote side keep the same `taskId` and the same `agentCard.url` while the *content* served at that URL drifts — new skill set, narrowed input schema, changed `capabilities.streaming`, altered auth scheme. The client's task lifecycle state machine was compiled against the card it read at `tasks/send`. Every subsequent turn is validated against a contract that no longer exists, but no protocol message ever signals the change. This is *card drift*, and it is distinguishable from ordinary capability negotiation failure because the transport stays healthy, HTTP 200s flow, and the remote agent keeps returning plausible-looking artifacts under a schema the client is no longer entitled to assume. The invariant that must hold: **a bound task's lifecycle is only valid against the exact card revision it was negotiated from, and any divergence between the live card and the bound card is a task-terminal condition, not a recoverable warning.** ## What Was Observed A client agent (call it C) negotiated with vendor agent V at `POST /tasks/send`. The card served at `/.well-known/agent.json` at T0 declared: - one skill `invoice.extract` with `inputSchema` accepting `{document_url, currency}`, - `capabilities.streaming: true`, - `securitySchemes: { bearer: {...} }`. C bound `taskId=7f3a…` to this card, cached the card hash, and entered the `working` state. On turn 2 the task moved to `input-required`, and C sent a follow-up with `document_url` only. V returned HTTP 200 with a well-formed `TaskStatusUpdate` in `working`. On turn 3, V returned `completed` with an artifact whose `currency` field was omitted and whose `amount` was in minor units — a schema V had *already* migrated to at T1 (between turns 1 and 2), where the new card declared `inputSchema` requiring `currency` as an enum and `outputSchema` emitting `amount_minor` as an integer. C never re-fetched the card. It validated the artifact against the T0 output schema, which had no `amount_minor` field, treated the integer as a float `amount`, and downstream reconciliation booked a value 100× too large. The transport was clean. The task lifecycle completed. The failure was entirely in the binding. The second observation: when C *did* re-fetch on a later task, the drift was detectable — but only if C compared the `agentCard` body hash, not just the `url`. V kept the same URL and the same `name`/`version` string (`"1.0.0"`); only the `skills[].inputSchema` and `capabilities` changed. A client that checks `version` equality passes. A client that checks the full canonicalized body hash catches it. ## Condition of Validity The guardrail is valid only under these conditions, and an instance must verify them before trusting its own drift check: 1. The client canonicalizes the card (sorted keys, no whitespace, no server-injected `timestamp`/`etag` fields) and stores a SHA-256 of the canonical form at bind time. If the vendor injects volatile fields into the card body, the hash is useless — the client must strip a declared set of volatile keys before hashing, and must *fail closed* if it cannot identify them. 2. Re-fetch happens at every lifecycle transition that changes the expected schema surface: `working → input-required` and `input-required → working`. A single fetch at `tasks/send` is insufficient because the drift window is exactly the multi-turn gap. 3. The client distinguishes *card drift* from *card unavailability*. A 503 on re-fetch is not drift; it is a transient and the task should park in `input-required` with a retry budget, not terminate. Only a successful fetch whose hash differs terminates the task. 4. The remote honors `taskId` continuity across card revisions. If V reassigns the task or returns `404` on the old `taskId` after a card swap, the client is in a *different* failure (task loss, not drift) and must not conflate them. Absent any of these, the drift check produces false positives (volatile fields) or false negatives (version-string equality), and the instance is worse off than not checking. ## Decision Boundary The precise line: **re-fetch and hash-compare at every state transition where the client will validate a payload against a schema the card declares.** Do not re-fetch on pure `working` heartbeats — those carry no schema-bearing payload and the cost is wasted round-trips. Do not skip re-fetch on `completed` if the completion artifact is validated against `outputSchema`; the artifact is exactly where the 100× error landed. When drift is detected, the boundary decision is binary and must not be softened: - **Terminate the task** with a `TaskDriftError`, do not send a corrective turn to V. Sending a follow-up against a card V no longer serves invites V to interpret the payload under its *new* schema while C still holds the old one — the divergence compounds. - **Do not auto-rebind.** Re-negotiating a fresh task against the new card is a *new* task with a new `taskId`; the old task's partial artifacts must be quarantined, not merged, because they were produced under a contract C cannot retroactively validate. - **Escalate to the orchestrator**, not to the vendor. The vendor has no incentive to signal drift; the orchestrator can decide whether to accept the new card revision and replay. The tempting-but-wrong move is to treat drift as a warning and continue with "best effort" schema coercion. That is precisely how the 100× error survived to reconciliation: the client coerced, the vendor accepted, and no layer objected. ## Operational Effect With the invariant enforced, the failure mode converts from *silent data corruption at task completion* to *loud task termination at the transition where the contract broke*. The blast radius shrinks from "every downstream consumer of the artifact" to "one task, quarantined." The cost is one extra card fetch per schema-bearing transition — cheap relative to the reconciliation cost of a 100× booking error. The secondary effect: because the client now holds a card hash per task, post-hoc audits can reconstruct *which contract* each artifact was produced under. A task that completed under hash `H1` is provably valid against `H1`; a task that drifted is provably invalid against both. This is the difference between an agent system that can be audited and one that can only be trusted. Instances that skip this invariant do not fail loudly. They fail at the reconciliation layer, days later, with a number that looks almost right. ```python import hashlib import json from dataclasses import dataclass from typing import Any class TaskDriftError(RuntimeError): """Raised when the live agent card diverges from the card a task was bound to.""" VOLATILE_CARD_KEYS = frozenset({"etag", "timestamp", "lastModified", "serverTime"}) def canonical_card_hash(card: dict[str, Any]) -> str: stripped = {k: v for k, v in card.items() if k not in VOLATILE_CARD_KEYS} canonical = json.dumps(stripped, sort_keys=True, separators=(",", ":")) return hashlib.sha256(canonical.encode("utf-8")).hexdigest() @dataclass class TaskBinding: task_id: str bound_card_hash: str bound_card: dict[str, Any] class DriftGuardedClient: def __init__(self, fetch_card, send_turn): self._fetch_card = fetch_card self._send_turn = send_turn def bind(self, task_id: str) -> TaskBinding: card = self._fetch_card() return TaskBinding(task_id, canonical_card_hash(card), card) def transition(self, binding: TaskBinding, payload: dict[str, Any]) -> dict[str, Any]: live = self._fetch_card() live_hash = canonical_card_hash(live) if live_hash != binding.bound_card_hash: raise TaskDriftError( f"task {binding.task_id} bound to card {binding.bound_card_hash[:12]} " f"but live card is {live_hash[:12]}; refusing to send turn " f"against a contract the client cannot validate" ) return self._send_turn(binding.task_id, payload) ```