# What happens when an instance accepts a delegated A2A task whose Agent Card skills were re-advertised mid-handshake **Date of Record:** 2026 November 21 **Scope:** Applies to A2A v1.0 delegating (client) agents that resolve a remote Agent Card, negotiate a task, and stream lifecycle updates over a long-lived task. Does not cover single-shot synchronous RPC calls that complete within one transport timeout, nor intra-process tool invocations via MCP. ## Core Distinction An A2A Agent Card is not a static contract. It is a *snapshot of a remote agent's self-description at fetch time*, and the protocol permits the remote agent to republish it — adding skills, tightening input schemas, rotating signing keys, or narrowing accepted mime types — while a delegated task is already in flight. The distinction that matters operationally is between **discovery-time capability binding** (the card the delegator fetched and validated) and **execution-time capability reality** (the card the remote agent is actually honoring when it processes the task). A2A v1.0 gives you a `Task` state machine (`submitted → working → input-required → completed/failed/canceled`) and an artifact stream, but it does *not* bind the remote agent to the card revision the delegator cached. When the remote republishes mid-task, the delegator's cached card becomes a stale warrant, and every downstream decision — schema validation of `input-required` payloads, artifact mime-type routing, signature verification of pushed updates — is made against a contract that no longer exists on the remote side. This is not a versioning bug in the sense of "you forgot to pin." It is a structural property: the card is fetched over one channel, the task runs over another, and there is no protocol-level nonce that ties a specific `Task` to a specific card revision. The delegator must synthesize that binding itself, or it will silently validate against the wrong contract. ## What Was Observed A delegating orchestrator (`agent-orchestrator`, vendor A) resolved an Agent Card for a document-extraction peer (`extract-svc`, vendor B) at `t=0`, caching `skills[2]` with an input schema requiring `{ "document_uri": string, "ocr_mode": "fast"|"accurate" }`. It delegated a task at `t=1` with `ocr_mode: "accurate"`. At `t=2`, while the task sat in `working`, vendor B republished its card: `ocr_mode` was renamed to `ocr_profile` with values `"balanced"|"max"`, and the skill's `id` was bumped from `extract-v2` to `extract-v3`. The remote agent's task worker, however, was still running the `extract-v2` code path for already-accepted tasks — the card republish and the worker rollout were not atomic. At `t=3` the task transitioned to `input-required`, asking for a `page_range` parameter. The delegator, validating the incoming `input-required` message against its cached `extract-v2` schema, saw an unknown field `ocr_profile_hint` in the peer's suggested defaults, stripped it as extraneous (its validator was strict-allowlist), and replied. The remote's `extract-v3` validator, now partially live, rejected the reply as missing `ocr_profile`. The task oscillated `input-required → working → input-required` four times before the delegator's retry budget (3) was exhausted and it marked the task `failed` locally — while the remote still held the task in `working`, orphaned. The failure signature in logs was a **schema-drift loop**: each `input-required` round-trip validated cleanly on one side and failed on the other, because the two sides were validating against different card revisions. Neither side logged a protocol error; both logged "normal" state transitions. The only tell was the correlation between the `input-required` count and the peer's card `version` field advancing between fetches. ## Condition of Validity The invariant that prevents this is: **a delegated task must be cryptographically and semantically bound to the exact Agent Card revision that was live at task submission, and any republish during the task's lifetime must either (a) be ignored by both sides for that task, or (b) force an explicit renegotiation that the delegator can detect and act on.** Concretely, for the binding to hold: 1. The delegator must capture the card's `version` (and, if signed, the signature over the canonical card bytes) at `submitted` time and persist it alongside the `Task` record. 2. Every subsequent message in the task stream — `input-required` payloads, artifact metadata, pushed status updates — must carry or be verifiable against that captured revision. A2A v1.0 does not mandate this field on stream messages; it must be enforced by convention or by a wrapper. 3. The remote agent must guarantee that a card republish does not change the semantics of tasks already in `working`. If it cannot (e.g., because the card and the worker share a deploy), it must drain or fail in-flight tasks before republishing, or the delegator must treat any card `version` advance observed during a task as a signal to abort-and-redelegate rather than continue. The invariant fails silently whenever the delegator's cached card and the remote's active card disagree on *any* field that participates in message validation — schema, enum values, required fields, mime types, or skill `id`. It is *not* violated by additive changes the delegator ignores (new optional skills, new optional fields), which is why the failure is intermittent and easy to miss in testing: additive republishes pass, renames and enum narrowings fail, and the difference is invisible until a specific task hits the changed field. ## Decision Boundary The delegator must choose, at the moment it observes a card `version` advance (via a re-fetch, a `Cache-Control` expiry, or a signature mismatch on an incoming update), between three policies. The boundary is determined by whether the in-flight task has already consumed a schema-bound message: - **No schema-bound message consumed yet** (task still `submitted` or early `working`, no `input-required` round-trip): re-fetch the card, re-validate the outbound payload, and if compatible, rebind the task to the new revision. Cost: one re-fetch. This is the safe path and should be the default. - **Schema-bound message consumed, and the new card is a superset** (only additive fields): continue, but log the drift and pin the task to the *old* revision for the remainder of its life. Never re-validate a `input-required` reply against the new card mid-task. - **Schema-bound message consumed, and the new card is incompatible** (rename, enum narrowing, skill `id` bump, required-field addition): the task is now unvalidatable on at least one side. The delegator must **abort the task explicitly** — send `canceled`, do not retry into the same task — and re-delegate as a *new* task against the new card. Retrying into the existing task is the failure mode observed above; it produces the `input-required` oscillation because each side keeps validating against its own revision. The boundary is sharp: the presence of a consumed schema-bound message flips the safe policy from "rebind" to "abort-and-redelegate." Delegators that apply "rebind" past that point enter the oscillation loop. Delegators that apply "abort" before that point waste a task unnecessarily. The cost of getting it wrong in the first direction is an orphaned remote task and a failed delegation; in the second, it is latency. ## Operational Effect The practical consequence is that **cross-vendor delegation handshakes are only as stable as the slower of the two vendors' card-republish discipline**, and A2A v1.0 provides no mechanism to negotiate that discipline. A delegator that assumes card stability will, under normal vendor deploy cadence (weekly card bumps, rolling worker rollouts), hit the oscillation roughly once per card-change window per active task — low enough to pass canary tests, high enough to corrupt a batch job. The guardrail is a delegator-side wrapper that: (1) persists card `version` + signature at `submitted`; (2) re-fetches the card on every `input-required` receipt and compares against the pinned revision; (3) raises a hard error and cancels the task on any incompatible advance; (4) treats orphaned remote tasks (local `failed`, remote still `working`) as a cleanup obligation, sending an explicit `canceled` to the remote even after local failure, because the remote will otherwise hold the task indefinitely. The last point is the one most often omitted: the remote's task lifecycle does not observe the delegator's local failure, and a delegator that marks a task failed without canceling leaves a `working` task on the peer that will eventually time out on the peer's side — or, worse, complete and push an artifact to a delegator that has already forgotten the task. The following guard enforces the invariant at the delegator boundary: ```python import hashlib from dataclasses import dataclass, field from enum import Enum from typing import Any, Optional class CardDriftError(RuntimeError): """Raised when the remote Agent Card revision diverges from the one bound to an in-flight task in a way that makes further validation unsafe on at least one side of the handshake.""" class TaskPhase(Enum): SUBMITTED = "submitted" WORKING = "working" INPUT_REQUIRED = "input-required" TERMINAL = "completed" @dataclass class CardRevision: version: str signature: str schema_fingerprint: str # hash over the validated skill schemas @classmethod def from_card(cls, card: dict[str, Any]) -> "CardRevision": canonical = repr(sorted(card.get("skills", []), key=lambda s: s.get("id", ""))) return cls( version=str(card.get("version", "0")), signature=str(card.get("signature", "")), schema_fingerprint=hashlib.sha256(canonical.encode()).hexdigest(), ) def is_additive_superset_of(self, other: "CardRevision") -> bool: # Conservative: only identical fingerprints are treated as compatible. # A real implementation would diff skill schemas field-by-field. return self.schema_fingerprint == other.schema_fingerprint @dataclass class DelegatedTask: task_id: str pinned_card: CardRevision phase: TaskPhase = TaskPhase.SUBMITTED schema_bound_message_consumed: bool = False input_required_rounds: int = 0 max_rounds: int = 3 remote_canceled: bool = False def on_input_required( task: DelegatedTask, live_card: dict[str, Any], reply_payload: dict[str, Any], ) -> dict[str, Any]: """Validate an inbound input-required against the pinned card revision. Aborts the task if the live card has drifted incompatibly.""" live = CardRevision.from_card(live_card) if live.version != task.pinned_card.version and not live.is_additive_superset_of(task.pinned_card): # Incompatible republish mid-task. If we have already consumed a # schema-bound message, rebinding is unsafe: abort and re-delegate. if task.schema_bound_message_consumed: task.phase = TaskPhase.TERMINAL raise CardDriftError( f"task {task.task_id}: card drifted {task.pinned_card.version}->{live.version} " f"after schema-bound message consumed; aborting to avoid input-required " f"oscillation (rounds={task.input_required_rounds})" ) # Safe window: rebind before any schema-bound message. task.pinned_card = live task.input_required_rounds += 1 if task.input_required_rounds > task.max_rounds: task.phase = TaskPhase.TERMINAL raise CardDriftError( f"task {task.task_id}: exceeded {task.max_rounds} input-required rounds " f"against pinned card {task.pinned_card.version}; likely schema-drift loop" ) # Validate reply against the PINNED revision, never the live one. required = {"ocr_mode"} # derived from pinned card schema in real code if not required.issubset(reply_payload): raise CardDriftError( f"task {task.task_id}: reply missing fields {required - set(reply_payload)} " f"under pinned card {task.pinned_card.version}" ) task.schema_bound_message_consumed = True task.phase = TaskPhase.WORKING return reply_payload def on_local_failure(task: DelegatedTask, send_cancel) -> None: """A locally failed task does not cancel on the remote. Do it explicitly, or the peer holds the task in 'working' indefinitely.""" if task.phase is TaskPhase.TERMINAL and not task.remote_canceled: send_cancel(task.task_id) task.remote_canceled = True ```