# Which invariants prevent silent capability downgrade during A2A v1.0 Agent Card re-resolution across vendor boundaries **Date of Record:** 2026 December 3 **Scope:** Applies to cross-vendor task delegation where a delegating agent (client) discovers a remote agent via an A2A v1.0 Agent Card at `/.well-known/agent.json`, negotiates a task, and may re-resolve the card mid-task (on retry, on session resume, or on a `tasks/resubscribe` reconnect). Does not apply to same-vendor intra-cluster delegation where card content is pinned at deploy time. ## Core Distinction The failure is not "the remote agent is down." It is **silent capability downgrade under card re-resolution**: the client caches an Agent Card, initiates a task whose `message` payload depends on a capability declared in that card (e.g., `streaming: true`, a specific `skills[].id`, a `defaultInputModes` entry of `application/json`), and then—on a mid-task reconnect or retry—re-fetches the card and receives a *different but schema-valid* card from the same URL. The task continues, but the negotiated contract no longer matches the payload already in flight. A2A v1.0's Agent Card is a *discovery* artifact, not a *negotiated* artifact. Nothing in the spec binds a task's `taskId` to the exact card revision it was created against. The result: a task created under card revision A can be resumed under card revision B with no protocol-level error, because every individual message is well-formed against *some* card. The invariant that prevents this is **card-revision pinning at task creation**, expressed as a client-side binding between `taskId` and the card's `(url, version, skills[].id set, capabilities)` tuple, enforced on every subsequent `tasks/get`, `tasks/send`, and `tasks/resubscribe`. ## What Was Observed A client agent (vendor X) delegated a document-extraction task to a remote agent (vendor Y) advertising: ``` skills: [{ id: "extract.invoice.v2", inputModes: ["application/json"], outputModes: ["application/json"] }] capabilities: { streaming: true, pushNotifications: false } ``` The client sent `tasks/send` with `message.parts[0]` as a JSON invoice blob and `metadata.skillId = "extract.invoice.v2"`. The remote accepted, returned `taskId = t-9f2`, `state = "working"`, and a stream `contextId = c-441`. Fourteen seconds in, the SSE stream dropped (vendor Y rolling a deployment). The client reconnected via `tasks/resubscribe`, and—because its card cache had a 60s TTL—re-resolved `/.well-known/agent.json` first. Vendor Y's new deployment had renamed the skill to `extract.invoice.v3` and flipped `capabilities.streaming` to `false` for a hotfix, while keeping the endpoint URL and card `version` field at `"1.0.0"` (the version string tracked the spec, not the deployment). Three distinct failures compounded: 1. The re-resolved card no longer contained `extract.invoice.v2`. The client's skill-ID validation passed anyway because it validated *presence of some skill*, not *the skill the task was bound to*. 2. `capabilities.streaming: false` meant `tasks/resubscribe` was no longer a valid operation against the new card, but the client had already issued it and the remote—still holding `t-9f2` in its store—accepted it, returning a `TaskStatusUpdateEvent` with `state: "input-required"` and a `message` asking for a *different* input schema (v3's). 3. The client, seeing `input-required`, re-sent the original JSON blob. The v3 handler parsed it under v3's schema, which had a renamed required field, and returned `state: "failed"` with `error.code: -32602` (invalid params) — attributed to the *client's* payload, not to the card drift. The task was marked failed, retried by the client's orchestrator under the *new* card, and re-sent with v3-shaped input. It succeeded on attempt 3. The audit log showed a clean retry. The actual event—a mid-task capability contract violation that produced a spurious `-32602`—was invisible. ## Condition of Validity The silent-downgrade window exists iff all of the following hold: - The client re-resolves the Agent Card during the lifetime of an open task (retry, resume, resubscribe, or a cache-miss on a subsequent `tasks/send` to the same `taskId`). - The remote's card content is mutable at a stable URL without changing the card's `version` field. A2A v1.0 defines `version` as the *protocol* version, so this is the common case, not the exception. - The client's validation is *schema-level* (does the card parse? does it advertise *a* matching skill?) rather than *identity-level* (does it advertise the exact `skillId` and capability tuple the task was created under?). - The remote retains `taskId` state across the card change (it usually does — task store is separate from card serving). If any one fails, the failure is loud: either the client refuses to resume (no re-resolve), the remote rejects the `taskId` (state dropped), or the client's validator catches the skill-ID mismatch. The dangerous configuration is the *most common* one: long-lived task store, mutable card, schema-level validation. ## Decision Boundary The correct boundary is: **a task's contract is frozen at `tasks/send` acceptance and must be re-asserted on every continuation, not re-derived from the current card.** Concretely, on `tasks/send` acceptance the client must persist a *contract token*: ``` contract = { "taskId": t-9f2, "cardUrl": "https://y.example/agent.json", "cardVersion": "1.0.0", "cardEtag": "", "skillId": "extract.invoice.v2", "inputModes": ["application/json"], "outputModes": ["application/json"], "capabilities": {"streaming": true} } ``` On every `tasks/get`, `tasks/send` (continuation), and `tasks/resubscribe`, the client re-resolves the card and compares the *tuple*, not the schema. Any of the following is a hard stop, not a retry: - `skillId` absent from the new card → `ContractDriftError`, do not continue. - `cardEtag` differs and any field in the contract tuple changed → `ContractDriftError`. - New card disables a capability the open task's transport depends on (`streaming: false` while a resubscribe is in flight) → `ContractDriftError`, fall back to polling *only if* the task's `state` is terminal-adjacent, otherwise abort. The boundary is *not* "reject all card changes." A card may legitimately add skills, bump output modes, or change `pushNotifications`. The invariant is narrower: **the fields the open task's payload and transport depend on are immutable for the life of that task.** Everything else may drift. ## Operational Effect Enforcing the contract token converts a class of silent, misattributed failures into a single explicit, attributable error. In the observed case, the client would have raised `ContractDriftError(taskId=t-9f2, field="skills", expected="extract.invoice.v2", observed="extract.invoice.v3")` at the resubscribe boundary — before re-sending the v2 payload into the v3 handler, before the spurious `-32602`, before the orchestrator's blind retry. The downstream effects are: 1. **Error attribution becomes correct.** The `-32602` was logged against the client. The `ContractDriftError` is logged against the *remote's card mutation*, which is the actual cause. 2. **Retry policy becomes safe.** Blind retry under a drifted card is what produced the v3-shaped re-send. With the token, the orchestrator must either pin to the original card (if the remote still serves it, e.g., via `?version=` or an `ETag`-addressed URL) or escalate to a human/vendor-boundary owner. It cannot silently re-shape the payload. 3. **The remote's card-mutation discipline becomes observable.** A vendor that mutates skill IDs at a stable URL without bumping a card-level revision will now generate `ContractDriftError` at every open-task boundary. That is a *feature*: it surfaces a spec-level gap (A2A v1.0's `version` field is protocol-scoped, not deployment-scoped) as an operational signal rather than a silent payload corruption. The invariant to carry forward: **discovery is not negotiation.** The Agent Card tells you what *could* be negotiated; the contract token records what *was*. Any system that treats a re-resolved card as authoritative for an open task has no defense against cross-vendor card drift, because the protocol provides none. ```python import hashlib import json from dataclasses import dataclass, field class ContractDriftError(RuntimeError): """Raised when a re-resolved Agent Card no longer satisfies an open task's contract.""" def __init__(self, task_id: str, field_name: str, expected, observed): self.task_id = task_id self.field_name = field_name self.expected = expected self.observed = observed super().__init__( f"contract drift on task {task_id}: field={field_name} " f"expected={expected!r} observed={observed!r}" ) @dataclass(frozen=True) class ContractToken: task_id: str card_url: str card_etag: str skill_id: str input_modes: tuple output_modes: tuple streaming: bool @staticmethod def from_card(task_id: str, card_url: str, raw_card: bytes, skill_id: str) -> "ContractToken": card = json.loads(raw_card) etag = hashlib.sha256(raw_card).hexdigest() skill = next((s for s in card.get("skills", []) if s.get("id") == skill_id), None) if skill is None: raise ContractDriftError(task_id, "skills", skill_id, [s.get("id") for s in card.get("skills", [])]) caps = card.get("capabilities", {}) return ContractToken( task_id=task_id, card_url=card_url, card_etag=etag, skill_id=skill_id, input_modes=tuple(skill.get("inputModes", [])), output_modes=tuple(skill.get("outputModes", [])), streaming=bool(caps.get("streaming", False)), ) def assert_contract_holds(token: ContractToken, raw_card: bytes) -> None: """Re-validate an open task against a freshly resolved card. Raises on any drift.""" card = json.loads(raw_card) skills = {s.get("id"): s for s in card.get("skills", [])} if token.skill_id not in skills: raise ContractDriftError(token.task_id, "skills", token.skill_id, sorted(skills)) skill = skills[token.skill_id] if tuple(skill.get("inputModes", [])) != token.input_modes: raise ContractDriftError(token.task_id, "inputModes", token.input_modes, tuple(skill.get("inputModes", []))) if tuple(skill.get("outputModes", [])) != token.output_modes: raise ContractDriftError(token.task_id, "outputModes", token.output_modes, tuple(skill.get("outputModes", []))) streaming_now = bool(card.get("capabilities", {}).get("streaming", False)) if streaming_now != token.streaming: raise ContractDriftError(token.task_id, "capabilities.streaming", token.streaming, streaming_now) def resume_task(token: ContractToken, fetch_card) -> None: """Called on tasks/resubscribe or continuation send. Fails closed on drift.""" raw_card = fetch_card(token.card_url) assert_contract_holds(token, raw_card) # ... proceed with resubscribe / continuation under the pinned contract ```