# What structural signals indicate capability drift after A2A v1.0 Agent Card re-resolution: the `capabilities`-hash mismatch that survives schema-valid negotiation **Date of Record:** 2026 November 24 **Scope:** Applies to A2A v1.0 peers that re-resolve a remote Agent Card (typically on a TTL, on a `Task` rejection, or after a transport reconnect) and then bind a request to the newly returned `skills`/`capabilities` block without re-validating that the resolved capability set is byte-stable against the set the caller's planner already reasoned over. Does not apply to first-contact discovery (cold, no prior plan) or to runtimes that pin a single immutable card per session. ## Core Distinction The non-obvious boundary here is not "the card changed." It is the difference between **schema-valid re-resolution** and **semantically-stable re-resolution**. A2A v1.0 Agent Cards are JSON documents validated against the `AgentCard` schema; a peer that swaps a skill's `inputModes`, drops an optional capability flag (e.g. `streaming`, `pushNotifications`), or narrows a `skill.tags` set can still emit a document that passes schema validation and even passes a naive `id`-equality check. The failure is that the *planner's prior commitment* was made against a capability surface that no longer exists, and nothing in the protocol forces the caller to notice. The invariant that actually matters is not "the card is valid" but **"the capability set the plan was compiled against is a subset of the capability set the executor will now be served by."** A2A v1.0 gives you a hashable projection of that set (the canonicalized `skills[]` + `capabilities{}` subtree) but does not mandate that the caller *compare* it across re-resolutions. That omission is the boundary. ## What Was Observed A coordinator agent (`planner`) decomposed a document-normalization task into three sub-tasks and dispatched sub-task 2 to a remote `extractor` agent. At dispatch time the `extractor` Agent Card advertised: - `capabilities.streaming: true` - `skills[0].id: "pdf-extract"`, `inputModes: ["application/pdf", "text/plain"]` - `skills[0].tags: ["ocr", "layout", "tables"]` The planner chose a streaming `message/stream` transport and a plan that assumed table extraction (`tables` tag) and PDF input. Mid-task the `extractor` was redeployed behind a new runtime. On the next re-resolution (triggered by a `Task` state poll that returned `input-required` with an unfamiliar reason), the returned card was: - `capabilities.streaming: false` (the new runtime's SSE bridge was disabled) - `skills[0].inputModes: ["text/plain"]` (PDF path removed) - `skills[0].tags: ["ocr", "layout"]` (`tables` dropped) The card was schema-valid. The `skills[0].id` was unchanged. The coordinator's card cache keyed on `(agentId, skillId)` — both stable — so the cache hit and **the stale capability surface was served to the executor binding**. The planner then issued a `message/stream` call. The remote returned a `-32601 Method not found` because `message/stream` is gated on `capabilities.streaming`. The coordinator's error handler classified `-32601` as a transient transport fault and retried the streaming call three times before the token budget for sub-task 2 was exhausted. Sub-task 2 failed; sub-tasks 1 and 3 had already committed side effects against a plan that assumed sub-task 2's output shape. The trace signature is distinctive: a `-32601` (or a `Task` transitioning to `rejected` with `reason: unsupported`) arriving *after* a successful prior call to the same method on the same agent, with no intervening change to the caller's request. That is the fingerprint of capability drift under a stable cache key. ## Condition of Validity The failure requires all four of the following to co-occur; remove any one and the drift is either harmless or caught: 1. **A stable cache key that excludes the capability projection.** Keying on `agentId` or `(agentId, skillId)` is stable across capability mutation. Keying on `sha256(canonicalize(skills[] + capabilities{}))` is not. Most implementations pick the former because it makes cache-hit rates look good. 2. **A planner that commits before the executor binds.** If the planner re-reads the card at bind time (not at plan time), the drift is caught by construction. The failure lives in the gap between *plan compilation* and *request emission*. 3. **A capability that is *gated at the method level* rather than *validated at the payload level*.** `streaming: false` causes a method-level `-32601`; a dropped `tables` tag causes a silent quality degradation (the remote OCRs but does not emit table structure, and the coordinator's downstream parser gets a shape it did not expect). The method-level gate is loud; the tag-level gate is silent. Both are drift; only one is easy to detect. 4. **An error classifier that treats `-32601` as retryable.** JSON-RPC `-32601` is a *permanent* method-availability error, not a transient one. Classifying it as retryable converts a fast, loud failure into a slow, expensive one. ## Decision Boundary The boundary is between two policies for handling a re-resolved card whose capability projection differs from the projection the plan was compiled against: - **Policy A (bind-and-retry):** treat the new card as authoritative, rebind the request to the new surface, and let the plan degrade. This is correct only when the plan is *re-compilable* — i.e., the coordinator can re-derive sub-task 2's contract from the new surface without invalidating committed siblings. In the observed incident the siblings were already committed, so Policy A produced inconsistent side effects. - **Policy B (fail-closed on projection change):** if `sha256(canonicalize(skills[] + capabilities{}))` at bind time differs from the hash recorded at plan time, abort the sub-task with a `CapabilityDriftError` and surface it to the planner for re-decomposition. This is correct when siblings are committed and the plan is not re-compilable. The decision rule: **compare the capability-projection hash at plan time and at bind time; if they differ, fail closed unless the plan is provably re-compilable.** The hash must cover `skills[].inputModes`, `skills[].outputModes`, `skills[].tags`, and the `capabilities{}` object — not just `id` and `name`. The `id` is *not* a capability signal; it is a routing signal. Conflating the two is the root cause. A second, subtler boundary: **tag-level drift is not detectable by method-level error handling.** A dropped `tables` tag produces a schema-valid response with a `parts[]` array that lacks table structure. The coordinator's downstream parser must validate the *shape* of the returned artifact against the `outputModes` it planned for, not just the absence of an error. The guardrail is a post-condition check on the response, keyed to the planned `outputModes`, not a pre-condition check on the card. ## Operational Effect The practical consequence is that **A2A v1.0 card re-resolution is not a refresh; it is a renegotiation, and renegotiation must be treated as a plan-invalidating event when the capability projection changes.** Three concrete changes follow: 1. **Cache on the projection, not the identity.** The card cache key must include the canonicalized capability hash. A cache hit on `(agentId, skillId)` with a differing projection hash is a *miss* for planning purposes and a *drift event* for in-flight tasks. 2. **Record the projection hash in the task envelope.** When the coordinator dispatches a sub-task, it stamps the plan-time projection hash into the task metadata. At bind time the executor re-resolves, recomputes the hash, and compares. Mismatch → `CapabilityDriftError`, not a retry. This makes the invariant checkable at the protocol boundary rather than relying on the planner's memory. 3. **Classify `-32601` and `Task.rejected(unsupported)` as permanent, and route them to the drift handler, not the retry handler.** A retry of a method that the peer has declared unavailable is a token-budget sink with a guaranteed-failure terminal state. The continuity invariant to encode: **a plan is valid only over the capability projection it was compiled against; any re-resolution that changes that projection invalidates the plan for all sub-tasks whose siblings are already committed.** The hash is the enforcement mechanism; the fail-closed policy is the response; the post-condition check on `outputModes` is the backstop for the silent tag-level case. ```python import hashlib import json from dataclasses import dataclass class CapabilityDriftError(RuntimeError): """Raised when a re-resolved A2A Agent Card's capability projection differs from the projection the plan was compiled against, and the plan is not provably re-compilable.""" @dataclass(frozen=True) class CardProjection: agent_id: str skill_ids: tuple[str, ...] input_modes: tuple[str, ...] output_modes: tuple[str, ...] tags: tuple[str, ...] streaming: bool push_notifications: bool def canonical_hash(self) -> str: payload = { "agent_id": self.agent_id, "skill_ids": sorted(self.skill_ids), "input_modes": sorted(self.input_modes), "output_modes": sorted(self.output_modes), "tags": sorted(self.tags), "streaming": self.streaming, "push_notifications": self.push_notifications, } blob = json.dumps(payload, sort_keys=True, separators=(",", ":")).encode() return hashlib.sha256(blob).hexdigest() def bind_subtask( plan_time_projection: CardProjection, bind_time_projection: CardProjection, plan_is_recompilable: bool, ) -> str: """Bind a sub-task to the current card surface, or fail closed. Returns the projection hash to stamp into the task envelope on success. """ plan_hash = plan_time_projection.canonical_hash() bind_hash = bind_time_projection.canonical_hash() if plan_hash == bind_hash: return bind_hash if plan_is_recompilable: # Caller may re-derive the sub-task contract from the new surface. return bind_hash # Siblings already committed; the plan cannot absorb the drift. raise CapabilityDriftError( "capability projection drifted between plan and bind: " f"plan_hash={plan_hash[:12]} bind_hash={bind_hash[:12]} " f"streaming {plan_time_projection.streaming}->{bind_time_projection.streaming} " f"tags {plan_time_projection.tags}->{bind_time_projection.tags} " f"input_modes {plan_time_projection.input_modes}->{bind_time_projection.input_modes}" ) def classify_rpc_error(code: int) -> str: """Route JSON-RPC errors. -32601 is permanent method-unavailability, not a transient transport fault; it must reach the drift handler.""" if code == -32601: return "capability_drift" if code in (-32603, -32000): return "transient" return "unclassified" ```