# What structural signals indicate a silent capability-contract drift in A2A v1.0 Agent Card discovery across vendor boundaries **Date of Record:** 2026 November 22 **Scope:** Applies to cross-vendor A2A v1.0 task delegation where a client agent resolves a remote Agent Card via `/.well-known/agent.json`, negotiates a task, and then executes a multi-turn lifecycle (submitted → working → input-required → completed). Does not apply to intra-vendor delegation where both endpoints share a release train, nor to single-shot synchronous RPC calls that never re-enter discovery. ## Core Distinction The failure mode is not "the Agent Card was wrong." It is that the Agent Card was *correct at discovery time* and *silently wrong at execution time* — and the protocol's lifecycle messages carry no structural signal that the contract under which the task was accepted has since changed. A2A v1.0 treats the Agent Card as a discovery artifact, fetched once, cached by the client, and used to build a `Task` envelope. The card advertises `skills[]`, each with an `id`, `inputModes`/`outputModes` (MIME-level), and a free-text `description`. The card also advertises `capabilities` (streaming, pushNotifications, stateTransitionHistory). What the card does **not** carry is a versioned, hashable contract for the *semantic* payload of a skill: the JSON Schema of arguments, the enumerable set of valid `input-required` follow-up shapes, or the terminal-state semantics (does `completed` guarantee `artifacts[]` is non-empty?). So the client's only structural signals at task-accept time are: the `skill.id` string, the MIME modes, and the free-text description. When a vendor deploys a new card revision mid-flight — adding a required field to a skill's arguments, renaming an enum member, tightening an artifact schema — the `skill.id` string is unchanged, the MIME modes are unchanged, and the description is prose. The client's cached card still validates. The remote accepts the task. The divergence surfaces only as a downstream `input-required` whose `message.parts` the client cannot satisfy, or a `completed` whose artifacts fail the client's own (now stale) schema. ## What Was Observed Concrete trace from a cross-vendor delegation (client = orchestrator, remote = vendor B's "document-extraction" skill): 1. **T0 — discovery.** Client fetches `/.well-known/agent.json`. Skill `doc-extract` advertises `inputModes: ["application/json"]`, `outputModes: ["application/json"]`, description "Extract structured fields from a document." Client caches the card with a TTL of 3600s. Client builds its argument object `{doc_url, fields: [...]}`. 2. **T0+40s — task accepted.** Client sends `tasks/send` with the argument object. Remote returns `Task{state: "working", id: T-8817}`. No schema echo, no contract hash, no skill-revision field in the response. 3. **T0+90s — vendor B deploys card v1.4.** Skill `doc-extract` now requires `fields[].type` (previously optional, inferred). The `skill.id` is still `doc-extract`. The `inputModes` are still `application/json`. The card's `version` field (agent-level, e.g. `"1.4.0"`) changed, but the client never re-fetches because its cache TTL has not expired. 4. **T0+120s — remote emits `input-required`.** `Task{state: "input-required", message: {parts: [{type: "data", data: {missing: ["fields[0].type"]}}]}}`. The remote is asking the client to supply a field the client's cached card never declared as required. 5. **T0+121s — client failure.** Client's `input-required` handler is schema-driven off its cached card. It has no branch for `fields[].type`. It retries the same payload. Remote emits the same `input-required`. Loop. After 3 retries the client aborts with a generic "task failed" — losing the fact that the root cause was a mid-flight contract change, not a transient error. The tell was in step 4: `input-required` carrying a `missing` list that references a path absent from the client's cached schema. That is the structural signal — a follow-up request whose required paths are not a subset of the contract the client accepted under. It is observable, machine-checkable, and *only* appears when the contract drifted. ## Condition of Validity The invariant that must hold for a client to safely accept an A2A task is: > For every skill `s` in the cached card, the set of paths the remote may require in an `input-required` follow-up must be a subset of the paths declared (as required or optional) in the contract the client used to build the initial payload — *for the duration of the task*. A2A v1.0 does not enforce this. It is a client-side invariant, and it is only enforceable if the client does two things the spec permits but does not require: 1. **Pin the contract at task-accept.** On `tasks/send`, capture the card's agent-level `version` and, critically, a client-computed hash of the skill's declared argument surface (the client already has this if it validates its own payload against a schema). Store it on the `Task` record. 2. **Re-derive on every `input-required`.** When a follow-up arrives, intersect the required paths in `message.parts` against the pinned contract. A non-empty intersection with the *undeclared* set is a contract-drift signal. If the client skips (1) or (2), the invariant is unobservable and the failure is silent — the task just "fails," and the orchestrator's error taxonomy attributes it to the remote being flaky rather than to a versioned contract change. This is the non-obvious part: the failure is *correctly detected as an error* and *incorrectly attributed*, which is worse than a crash because it corrupts the orchestrator's routing policy (it will retry the same remote, or blacklist a healthy one). The invariant also fails to hold across the `pushNotifications` path. If the client registered a webhook at accept time, the remote's async `input-required` push carries the same `message.parts` but no `taskId`-scoped contract reference. The client must correlate by `taskId` and apply the same pinned-contract check; if it correlates by `skill.id` instead, it will re-fetch the (now v1.4) card and validate against the *new* contract — masking the drift and accepting a payload shape it never negotiated. ## Decision Boundary The boundary is: **does the client treat the Agent Card as a cache or as a contract?** - **Cache semantics** (A2A v1.0 default, and what most SDKs implement): the card is a hint. The client accepts whatever the remote sends and adapts. This is fine for stateless single-shot skills. It is wrong for multi-turn skills where the remote's `input-required` shape is a function of the card revision. - **Contract semantics** (what the invariant requires): the card is a versioned agreement. The client pins it per-task, and any follow-up that violates the pin is a hard `ContractDriftError`, not a retryable input error. The decision rule an orchestrator should encode: - If `input-required` required-paths ⊆ pinned-contract paths → normal follow-up, satisfy and continue. - If `input-required` required-paths ⊄ pinned-contract paths → **do not retry**. Emit `ContractDriftError` with `{taskId, skillId, pinnedVersion, missingPaths}`. Re-fetch the card, diff, and either renegotiate (new task under new contract) or fail the delegation to a human/peer. - If the card's agent-level `version` changed between accept and any lifecycle message → treat as drift *even if* the current follow-up happens to validate, because the remote's terminal-state semantics may also have changed (e.g., `completed` now omits `artifacts[]` when extraction is empty). Version change is a superset signal; path violation is the sharp one. The trap: a naive client sees `input-required` and treats it as a *user-input* prompt, surfacing it to the end user ("the remote needs more info"). The user, who has no schema, supplies something. The remote rejects. The failure is now attributed to the user. The structural signal — required-path ⊄ pinned-contract — was available and discarded. ## Operational Effect Downstream consequences when the invariant is not enforced: - **Error-taxonomy corruption.** Drift is logged as `TaskFailed` with a transport or validation error, not as `ContractDrift`. Orchestrator routing policy learns "vendor B is unreliable" when vendor B is healthy and simply versioned. Retry budgets are burned on a non-retryable condition. - **Silent artifact corruption.** The `completed`-state half of the same drift: remote v1.4 returns artifacts conforming to its new schema; client validates against cached v1.3 schema and either rejects a valid artifact or, worse, accepts it and downstream consumers mis-parse a renamed enum. This is the more dangerous half because it does not raise — it produces plausible-but-wrong structured data. - **Baton-passing breakage in swarms.** In a multi-agent swarm, the orchestrator hands the `Task` to a sub-agent that did not perform discovery and therefore has no pinned contract. The sub-agent cannot detect drift at all. The invariant must be carried *in the task envelope* (the pinned contract hash travels with the task), not held in the discovering agent's memory — otherwise a handoff silently drops the only signal that could have caught the drift. The architectural guardrail is therefore: **the pinned contract is task state, not agent state.** It must survive handoff, checkpoint/resume, and cold-start. A client that pins the contract in its own memory but not in the `Task` record will pass the invariant check on the first agent and fail it on every agent the task is handed to. ```python import hashlib import json from dataclasses import dataclass, field from typing import Any class ContractDriftError(RuntimeError): """Raised when an A2A input-required follow-up requires paths outside the contract pinned at task-accept time, or when the remote's agent-level version changed mid-flight. Non-retryable; requires renegotiation.""" def __init__(self, task_id: str, skill_id: str, pinned_version: str, observed_version: str | None, missing_paths: list[str]): self.task_id = task_id self.skill_id = skill_id self.pinned_version = pinned_version self.observed_version = observed_version self.missing_paths = missing_paths super().__init__( f"contract drift on task {task_id} skill {skill_id}: " f"pinned={pinned_version} observed={observed_version} " f"undeclared_required_paths={missing_paths}" ) @dataclass class PinnedContract: skill_id: str agent_version: str declared_paths: frozenset[str] # dotted paths the client may supply contract_hash: str @classmethod def from_card(cls, card: dict[str, Any], skill_id: str) -> "PinnedContract": skill = next(s for s in card["skills"] if s["id"] == skill_id) # Client-side schema of the skill's argument surface. In a real client # this is the JSON Schema it validated its own payload against. declared = frozenset(skill.get("argumentPaths", [])) blob = json.dumps({"skill": skill_id, "paths": sorted(declared)}, sort_keys=True).encode() return cls( skill_id=skill_id, agent_version=card["version"], declared_paths=declared, contract_hash=hashlib.sha256(blob).hexdigest(), ) @dataclass class TaskRecord: task_id: str pinned: PinnedContract history: list[dict[str, Any]] = field(default_factory=list) def handle_input_required(task: TaskRecord, followup: dict[str, Any], current_card_version: str | None) -> None: """Enforce the pinned-contract invariant on an input-required follow-up.""" # 1. Version superset signal: any change is drift, even if paths validate. if current_card_version is not None and \ current_card_version != task.pinned.agent_version: raise ContractDriftError( task.task_id, task.pinned.skill_id, task.pinned.agent_version, current_card_version, missing_paths=[], ) # 2. Sharp signal: required paths must be subset of pinned declared paths. required = set(followup.get("requiredPaths", [])) undeclared = sorted(required - task.pinned.declared_paths) if undeclared: raise ContractDriftError( task.task_id, task.pinned.skill_id, task.pinned.agent_version, current_card_version, missing_paths=undeclared, ) # Invariant holds: normal follow-up, satisfy and continue. task.history.append({"event": "input-required-satisfied", "paths": sorted(required), "contract_hash": task.pinned.contract_hash}) ```