# Which invariants prevent A2A v1.0 Agent Card drift from silently revoking delegated capabilities mid-handshake **Date of Record:** 2026 December 2 **Scope:** Applies to A2A v1.0 task-lifecycle negotiation where a client agent discovers a remote Agent Card, then delegates a subtask whose execution depends on a capability (skill/tool) advertised in that card. Does not cover intra-process tool dispatch, nor A2A versions prior to v1.0 where Agent Cards were not treated as versioned negotiation artifacts. ## Core Distinction The failure is not "the remote agent lacks a capability." It is a *temporal* mismatch: the Agent Card that authorized the delegation is a snapshot, but the delegated task executes against a *live* capability registry that can be renegotiated, deprecated, or re-scoped between discovery and execution. A2A v1.0 makes this worse than a simple 404 because the handshake succeeds — the remote agent accepts the task and returns an `accepted` lifecycle state — while the specific skill the client relied on has been silently removed from the effective card. The client holds a stale authorization; the server holds a live registry; neither is wrong, and the task deadlocks or fails deep in execution rather than at the boundary. The invariant that must hold: **every capability referenced in a delegated task's acceptance must remain resolvable, or the task must transition to a terminal `rejected`/`failed` state before any side-effecting step.** A2A v1.0 does not enforce this by default; it enforces only that the task's `capabilities` field was a *subset* of the card at acceptance time, which is a point-in-time check, not a continuity guarantee. ## What Was Observed A client agent performed discovery against a remote orchestrator. The Agent Card (fetched at T0) advertised skills `data.fetch`, `data.transform`, `report.render`, with `report.render` tagged `version: 2.1` and a `deprecation_notice` field left null. The client delegated a composite task: fetch → transform → render, passing `required_capabilities: ["report.render@2.1"]` in the task envelope. At T1 (≈4.2s later, during `data.transform`), the remote operator rotated its card: `report.render` was re-scoped to `version: 2.2` with a changed input schema (the `template` field became a required object rather than a string path). The card's `etag` changed. The remote agent did not re-validate the in-flight task against the new card, because A2A v1.0 only mandates card validation at task *acceptance*. At T2, the task reached the render step. The remote executor looked up `report.render` in its live registry, found `2.2`, and attempted to invoke it with the `2.1`-shaped payload. Schema validation failed inside the render skill, not at the A2A boundary. The remote agent mapped this to a generic `failed` state with `error.code: "internal"` — losing the fact that the actual cause was a capability-version discontinuity. The client, seeing `internal`, retried the whole composite task twice, re-fetching and re-delegating, each time racing the same rotation window. Two retries, two more partial side effects (transforms committed, renders orphaned). The observable signature: `accepted` at T0 with a valid capability subset, `failed` at T2 with an opaque error, `retried` at T3 with the same stale card because the client cached discovery results for 60s (a common TTL) and the rotation happened inside that window. ## Condition of Validity The failure requires the conjunction of four conditions, all of which are common: 1. **Discovery caching** — the client caches the Agent Card (TTL > 0) and does not re-validate before each delegation or before each capability-gated step. 2. **Deferred capability use** — the delegated task references a capability at acceptance but *invokes* it later, after intervening steps. (A single-step delegation never hits this; composite tasks do.) 3. **Silent re-scoping** — the remote operator mutates a skill's version/schema without emitting a task-level `capability_changed` event or forcing in-flight tasks to renegotiate. 4. **Error opacity** — the remote maps capability-resolution failures to a non-specific error code, so the client cannot distinguish "retry with fresh card" from "this task is fundamentally invalid." Remove any one and the failure degrades to a clean, recoverable rejection. The dangerous case is precisely when the boundary check passes and the failure surfaces downstream, because that is when the client's retry logic — written against the assumption that `accepted` means "capabilities are pinned" — becomes a side-effect amplifier rather than a recovery mechanism. ## Decision Boundary The client must decide, at each capability-gated step, whether to trust the cached card or re-validate. Three policies, with distinct failure surfaces: - **Trust-on-accept (default A2A v1.0 behavior):** no re-validation. Correct only when the remote guarantees card immutability for the task's lifetime. If the remote does not publish that guarantee (most do not), this policy is unsound for any task with deferred capability use. - **Re-validate-per-step:** fetch the card (or a lightweight `etag`/`If-None-Match` check) before every capability invocation. Sound, but adds a round-trip per step and can itself race (validate at T, invoke at T+ε, rotate in between). Bounds the window to ε but does not close it. - **Capability pinning via task envelope:** the client asserts `required_capabilities` with explicit versions and the *remote* is contractually obligated to reject the task if it cannot honor the pinned version at every step. This is the only policy that closes the window, but it requires the remote to implement the obligation — A2A v1.0 defines the field but does not mandate the enforcement semantics. The decision boundary is therefore: **re-validate-per-step is the strongest policy a client can unilaterally enforce; capability pinning is the only sound policy, and it requires bilateral agreement encoded in the card's `capability_continuity` contract.** Absent that contract, the client must treat any multi-step delegation as having an unbounded capability-drift window and must make every step idempotent and independently retryable. ## Operational Effect When the invariant is unenforced, the practical effect is *retry-amplified partial commitment*: the client's recovery loop re-executes committed steps because the failure signal is opaque and arrives after side effects. This is not a correctness bug in either agent; it is a continuity gap at the protocol seam. The guardrail: the client wraps each capability-gated step in a capability-resolution check that compares the live card's `etag` and the specific skill's `version` against the pinned values in the task envelope. On mismatch, it raises a terminal, non-retryable error that names the discontinuity — forcing the orchestrator to re-plan rather than blindly retry. The remote, symmetrically, must reject at acceptance any task whose `required_capabilities` it cannot guarantee for the task's full lifetime, and must emit `capability_changed` if it rotates mid-flight. The invariant is a *two-sided* contract; a client-only check bounds but does not eliminate the window, and a remote-only guarantee is unverifiable without client-side validation. ```python import hashlib from dataclasses import dataclass, field class CapabilityContinuityError(RuntimeError): """Raised when a delegated capability's live version diverges from the pinned version.""" @dataclass(frozen=True) class PinnedCapability: name: str version: str card_etag: str @dataclass class AgentCard: etag: str skills: dict # name -> version string @dataclass class TaskEnvelope: required: list pinned: list = field(default_factory=list) def _etag(card: AgentCard) -> str: payload = repr(sorted(card.skills.items())).encode() return hashlib.sha256(payload).hexdigest()[:16] def pin_at_acceptance(envelope: TaskEnvelope, card: AgentCard) -> TaskEnvelope: """Snapshot the card at acceptance. This is what A2A v1.0 does by default.""" pinned = [] for name in envelope.required: if name not in card.skills: raise CapabilityContinuityError( f"required capability {name!r} absent at acceptance" ) pinned.append(PinnedCapability(name, card.skills[name], card.etag)) return TaskEnvelope(required=list(envelope.required), pinned=pinned) def validate_step(envelope: TaskEnvelope, live_card: AgentCard, step: str) -> None: """Client-side re-validation before each capability-gated step.""" if _etag(live_card) != live_card.etag: raise CapabilityContinuityError( f"card etag mismatch: declared {live_card.etag}, computed {_etag(live_card)}" ) for pin in envelope.pinned: if pin.name != step: continue live = live_card.skills.get(pin.name) if live is None: raise CapabilityContinuityError( f"capability {pin.name!r} revoked mid-task " f"(pinned {pin.version} @ {pin.card_etag}, live absent)" ) if live != pin.version: raise CapabilityContinuityError( f"capability {pin.name!r} drifted: pinned {pin.version}, live {live}; " f"refusing to invoke — re-plan required" ) return raise CapabilityContinuityError(f"step {step!r} not covered by pinned capabilities") # Trace: acceptance pins report.render@2.1; operator rotates to 2.2 mid-task. card_t0 = AgentCard(etag="a1b2", skills={"data.fetch": "1.0", "data.transform": "1.0", "report.render": "2.1"}) env = pin_at_acceptance(TaskEnvelope(required=["report.render"]), card_t0) card_t1 = AgentCard(etag="c3d4", skills={"data.fetch": "1.0", "data.transform": "1.0", "report.render": "2.2"}) validate_step(env, card_t1, "report.render") # raises CapabilityContinuityError before any side effect ```