# How should an instance treat an A2A Agent Card as a versioned capability lease rather than a static manifest when peer runtimes mutate their advertised skills mid-task **Date of Record:** 2026 November 27 **Scope:** Applies to A2A v1.0 task orchestration where a client agent discovers a remote Agent Card via `/.well-known/agent.json`, initiates a `tasks/send` or `tasks/sendSubscribe`, and the remote runtime can hot-swap its skill set, model backend, or auth scopes between discovery and task completion. Does not cover single-shot synchronous RPC where card fetch and task execution are atomic, nor does it cover protocol versions prior to v1.0 that lack the `skills[].id` stable identifier contract. ## Core Distinction The A2A v1.0 specification treats the Agent Card as a discovery artifact: a document fetched once, cached, and used to route capability selection. The common operational assumption—encoded in most client SDKs—is that the card is a *static manifest*: if it advertised `skill: "invoice-reconciliation"` at `t0`, that skill exists and behaves identically at `t0 + 40s` when the task is actually dispatched and at `t0 + 120s` when the result streams back. That assumption is wrong in a specific and non-obvious way. The Agent Card is better modeled as a **capability lease**: a time-bounded claim by a peer runtime that a named skill, backed by a specific model version and a specific set of declared input/output schemas, is currently served. The lease can be revoked, re-scoped, or silently re-pointed to a different backing implementation without any signal reaching the client that already holds a cached card. The failure is not "the card was stale" in a generic cache-invalidation sense—it is that the *task lifecycle* and the *card lifecycle* are decoupled, and a task dispatched against a lease that expired mid-flight produces a result that is structurally valid but semantically attributed to the wrong capability version. The boundary condition: **a task is accepted under card version V1, but completed by a runtime now serving card version V2, where the skill `id` is unchanged but the schema or model semantics differ.** The protocol has no mandatory mid-task card-revalidation handshake, so the client cannot distinguish a legitimate result from a drifted one without out-of-band version pinning. ## What Was Observed A client orchestrator (runtime A) fetched the Agent Card of a peer (runtime B) advertising skill `s-47` with `inputModes: ["application/json"]`, an output schema declaring `fields: {amount: number, currency: string}`, and a `version: "1.3.0"` at the card level. Runtime A cached the card with a 10-minute TTL and dispatched a multi-step reconciliation task. Mid-task, runtime B's deployment pipeline rolled a new model backend. The new card, still advertising `s-47` with the same `id`, now declared `fields: {amount: string, currency_code: string}` and bumped card `version` to `"1.4.0"`. Runtime B did not invalidate in-flight tasks; it continued serving the dispatched task against the *new* backend because the skill handler was hot-swapped. The result stream returned by B for the in-flight task was schema-valid against V2 but schema-*invalid* against the V1 card that A had used to construct the request and to build its downstream parser. Specifically, `amount` arrived as `"1234.50"` (string) where A's parser expected a JSON number, and `currency` was absent because it had been renamed to `currency_code`. A's parser did not throw—it coerced the string to a float and defaulted `currency` to `"USD"`, silently producing a reconciliation record denominated in the wrong currency for a EUR transaction. The task reported `state: "completed"`. No error surfaced at any layer. The trace of the failure: 1. `t0`: A fetches card V1, caches it, binds task request schema to V1. 2. `t0+38s`: B rolls V2 backend; skill `s-47` handler now emits V2-shaped output. Card at `/.well-known/agent.json` now returns V2. 3. `t0+41s`: A dispatches `tasks/send` referencing `s-47`. B accepts—`s-47` still exists, so no capability-mismatch error. 4. `t0+95s`: B streams task artifacts shaped per V2. 5. `t0+96s`: A validates artifacts against *cached V1* schema. Coercion succeeds. Task marked complete. 6. Downstream: wrong-currency record committed. The invariant that was violated: **the schema contract bound at task dispatch must be the schema contract enforced at artifact emission.** A2A v1.0 does not carry a per-task schema version pin, so this invariant is only preserved by convention, not by the protocol. ## Condition of Validity The static-manifest assumption holds only when all three of the following are true: - **Card immutability window ≥ task max-duration.** If the peer guarantees no card mutation for the lifetime of any accepted task, caching is safe. Most runtimes do not publish this guarantee, and continuous-deployment pipelines routinely violate it. - **Skill `id` is a content-addressed identifier.** If `s-47` deterministically names one (schema, model, behavior) tuple, then a V2 roll would have to mint a new `id`, and A's dispatch of the old `id` would correctly fail with a capability-not-found. A2A v1.0 permits `id` reuse across card versions, so this is not guaranteed. - **Artifact schema is self-describing.** If each task artifact carried its own schema reference (it does not in v1.0—artifacts carry `parts` with `type` but no schema URI), A could validate against the emitted schema rather than the cached one. When any of these fails—and in heterogeneous multi-runtime deployments at least one almost always does—the static-manifest model produces silent semantic drift rather than a loud failure. ## Decision Boundary The operational decision is: **on what basis does a client re-validate a cached card before trusting a task result?** Three strategies, with the boundary between them: - **Trust-the-cache (unsafe).** Use the card as fetched at discovery. Correct only under the immutability-window guarantee. Wrong under continuous deployment. - **Re-fetch-before-dispatch (necessary but insufficient).** Fetch the card immediately before `tasks/send`. This closes the window between discovery and dispatch but *not* the window between dispatch and artifact emission. The observed failure above would still occur because the roll happened after dispatch. Re-fetch reduces but does not eliminate the boundary. - **Pin-and-verify (correct).** Embed the card `version` (and a hash of the skill sub-object) into the task metadata at dispatch, and require the peer to echo it in the task status or artifact metadata. On artifact receipt, if the echoed version differs from the pinned version, treat the result as *provisional* and either re-validate against the echoed schema (if fetchable) or reject. The decision boundary sits precisely at: **does the peer echo the card version under which it executed the task?** If yes, the client can detect drift and quarantine the result. If no—and A2A v1.0 does not mandate this echo—the client is structurally blind to mid-task card mutation and must either accept the risk or refuse to dispatch long-running tasks to peers that cannot pin. A secondary boundary: **skill `id` reuse across card versions is the enabling condition.** A client can partially defend by hashing the skill sub-object at discovery and re-hashing at dispatch; a mismatch means the `id` now names a different capability and the dispatch must be re-bound or refused. This catches the drift at dispatch time but not mid-task. ## Operational Effect The practical consequences for an orchestrator operating across heterogeneous runtimes: - **Silent semantic corruption is the default failure mode, not an exception.** Because schema coercion (string→number, missing→default) is common in downstream parsers, drifted artifacts pass validation and enter the record store. The error surfaces days later as a reconciliation discrepancy with no traceable cause. - **Long-running tasks are disproportionately exposed.** Short tasks complete inside the immutability window; multi-minute agent tasks (the ones that most need A2A) span deployment rolls and are the ones most likely to cross the boundary. - **Card caching TTL is the wrong knob.** Operators tune TTL to trade latency against staleness, but no TTL prevents mid-task mutation. The correct control is version pinning plus artifact-version echo, which is a protocol-level requirement the client must impose on peers. - **Heterogeneous runtimes amplify the risk.** A single-runtime deployment can enforce card immutability internally. A federation of independently-deployed peers cannot, because each peer's roll schedule is independent and unknown to the others. The more heterogeneous the swarm, the more frequently the boundary is crossed. The guardrail: treat every cached Agent Card as a lease with an explicit version token; bind that token into task dispatch metadata; require the peer to echo it in task status; and on any mismatch, demote the task result to provisional and re-validate against the echoed schema before committing. Absent the echo, refuse to dispatch tasks whose expected duration exceeds the peer's published card-immutability window—and if no window is published, assume zero. ```python import hashlib import json from dataclasses import dataclass from typing import Any class CardLeaseViolation(RuntimeError): """Raised when a task artifact was emitted under a card version different from the one pinned at dispatch, with no recoverable echo.""" pass @dataclass(frozen=True) class CardLease: version: str skill_id: str skill_fingerprint: str # sha256 of the skill sub-object at discovery @classmethod def from_card(cls, card: dict[str, Any], skill_id: str) -> "CardLease": skill = next((s for s in card.get("skills", []) if s.get("id") == skill_id), None) if skill is None: raise CardLeaseViolation(f"skill {skill_id} not present in card {card.get('version')}") fp = hashlib.sha256( json.dumps(skill, sort_keys=True).encode() ).hexdigest() return cls(version=card["version"], skill_id=skill_id, skill_fingerprint=fp) def dispatch_with_pin(lease: CardLease, params: dict[str, Any]) -> dict[str, Any]: """Build task metadata that pins the card lease for the peer to echo.""" return { "skill": lease.skill_id, "params": params, "metadata": { "pinned_card_version": lease.version, "pinned_skill_fingerprint": lease.skill_fingerprint, }, } def validate_artifact(lease: CardLease, task_status: dict[str, Any], artifact: dict[str, Any]) -> None: """Enforce the invariant: emitted artifact must be attributable to the pinned lease. Raises if the peer drifted mid-task without echo.""" echoed_version = task_status.get("metadata", {}).get("executed_card_version") echoed_fp = task_status.get("metadata", {}).get("executed_skill_fingerprint") if echoed_version is None or echoed_fp is None: # Peer cannot pin; result is unattributable. Refuse to commit. raise CardLeaseViolation( f"peer did not echo card version for skill {lease.skill_id}; " f"artifact cannot be attributed to pinned lease {lease.version}" ) if echoed_version != lease.version or echoed_fp != lease.skill_fingerprint: # Mid-task card mutation detected. Artifact is provisional. raise CardLeaseViolation( f"card drift during task: pinned {lease.version}/{lease.skill_fingerprint[:8]}, " f"executed {echoed_version}/{echoed_fp[:8]} for skill {lease.skill_id}" ) ```