# Under what conditions must an instance reject an A2A v1.0 task whose `TaskState` transition is legal per the sender's state machine but whose `AgentCard` capability provenance has been renegotiated mid-task **Date of Record:** 2026 November 30 **Scope:** Applies to A2A v1.0 peer-to-peer task execution where the receiving agent re-fetches or re-negotiates the remote `AgentCard` (capabilities, skills, `defaultInputModes`, auth schemes) while a `Task` is in a non-terminal state (`submitted`, `working`, `input-required`). Does not apply to single-shot `message/send` calls that complete before any card refresh, nor to cards pinned by `taskId`-scoped capability tokens that forbid renegotiation. ## Core Distinction The failure is not a schema mismatch and not an authentication failure. Both agents agree on the wire format, both pass signature verification on the card, and the `TaskState` transition (`working → completed`) is legal in the abstract state machine. The break is subtler: **A2A v1.0 binds task semantics to the `AgentCard` that was current at task creation, but the protocol allows the card to be re-fetched and to legitimately change during the task's lifetime.** A card is a mutable capability advertisement; a task is an immutable commitment made *against a snapshot* of that advertisement. When the snapshot drifts, a state transition that looks valid to the sender is invalid to the receiver because the *meaning* of the terminal state has changed — the `completed` artifact was produced under a `skills` entry, `defaultInputModes`, or `securitySchemes` set that no longer exists in the card the receiver now holds. The concrete instance: an orchestrator agent A dispatches a long-running task to worker agent B. Mid-task, B's deployment rolls out a new `AgentCard` (a skill is renamed, an input mode is dropped, or a `securitySchemes` entry is rotated). A's local card cache for B refreshes — via A2A's `/.well-known/agent-card.json` discovery or an explicit `agent/getAuthenticatedExtendedCard` call — and now A holds a card whose `skills[].id` no longer matches the `skillId` it selected when it created the task. B returns `completed` with a valid artifact. A's validator rejects the artifact because the producing `skillId` is absent from the refreshed card, and A raises a provenance error *after* the work is done and the tokens are spent. ## What Was Observed A three-agent pipeline (planner A, worker B, auditor C) over A2A v1.0. A created a task on B at T0 with `skillId: "summarize-v2"`, `acceptedInputModes: ["text/plain","application/json"]`, and a `pushNotificationConfig` pointing at A. B entered `working`. At T0+40s, B's fleet applied a card update: `summarize-v2` was superseded by `summarize-v3` (input modes narrowed to `application/json` only; the old skill id retained as a deprecated alias for 24h, then removed). A's card cache TTL (300s in this deployment) did not expire before the task finished, so A never refreshed — but C, the auditor, *did* refresh B's card independently at T0+90s when validating the result, and C's refreshed card had already dropped `summarize-v2` because C hit a different B replica behind the load balancer that had the newer card. Trace of the divergence: 1. T0: A → B `tasks/send`, state `submitted`. A snapshots B's card `card_hash=h1`. 2. T0+5s: B → A `working`. 3. T0+40s: B replica-2 serves a new card `h2`; replica-1 still serves `h1`. Load balancer is not card-consistent. 4. T0+55s: B → A `completed` with artifact tagged `producedBy: summarize-v2`. 5. T0+90s: C fetches B's card for audit, lands on replica-2, gets `h2`, which lacks `summarize-v2`. 6. C rejects with `UnknownSkillProvenance`. A accepts. **The two verifiers disagree on the validity of the same artifact because they resolved different card snapshots.** The state transition `working → completed` was legal at every hop. The invariant that broke was *card-snapshot consistency across the task's verifier set*, which A2A v1.0 does not enforce — it specifies card discovery but leaves card caching, replica consistency, and snapshot pinning to the implementation. ## Condition of Validity The rejection rule (`reject task whose producing skill is absent from the verifier's current card`) is only sound when the verifier's card snapshot is the *same* snapshot the task was created against. Formally, for a task `t` created at `t0` with card hash `h_create`, a verifier may treat "skill not in card" as a hard failure **only if** `h_verify == h_create`. If `h_verify != h_create`, the correct action is not rejection but *snapshot reconciliation*: re-fetch the card pinned to `h_create` (via `agent/getAuthenticatedExtendedCard` with an `If-None-Match`/`ETag` for the historical card, or a card-version field if the deployment exposes one), or defer to the creator's snapshot. A2A v1.0's `AgentCard` has no mandatory `version` or `cardHash` field that a `Task` echoes back. This is the structural gap: the protocol lets you *discover* a card but does not let a task *commit* to a card version. Any cross-vendor deployment where worker cards can change faster than verifier cache TTLs is exposed. The invariant to enforce locally: **a `Task` object must carry the card identity it was created under, and every downstream verifier must validate against that identity, not against a fresh fetch.** Absent a protocol field, this must be smuggled in `metadata` (e.g., `metadata.cardHash`) at task creation and checked by every participant. ## Decision Boundary The boundary is between two rejection causes that look identical at the wire level: - **Genuine provenance failure:** the artifact claims a skill the worker *never* had. Reject; the worker is lying or corrupted. - **Snapshot drift:** the artifact claims a skill the worker *had at creation* but no longer advertises. Do not reject; reconcile snapshots. The distinguishing test: does `h_verify` match `h_create`? If yes and the skill is absent → genuine failure, reject hard. If no → the verifier is looking at the wrong card; fetch the pinned snapshot, and only reject if the skill is absent from *that* snapshot too. A verifier that cannot obtain the pinned snapshot must escalate to `input-required` on the *audit* task, not fail the *work* task — failing the work task discards completed, paid-for output over a bookkeeping discrepancy. Secondary boundary: card changes that alter `securitySchemes` mid-task. If B rotates its auth scheme at T0+40s, A's in-flight `pushNotificationConfig` callback may be signed under the old scheme. A must accept callbacks validated against `h_create`'s schemes for the task's lifetime, even after its cache refreshes to `h2`. Rejecting a valid `completed` notification because the *new* card no longer lists the old scheme is the same snapshot-drift error in a different channel. ## Operational Effect Unmitigated, this produces **false-negative audits that scale with card churn rate**: the faster a worker fleet rolls out card updates, the more completed tasks get rejected by verifiers that refreshed at the wrong moment, and the rejection rate is invisible in worker-side metrics (the worker succeeded) and only shows up as auditor disagreement. In the observed pipeline, a 12% audit-rejection rate appeared within one hour of a card rollout and vanished when the rollout finished — a transient that looked like flakiness but was deterministic snapshot inconsistency. The guardrail is threefold: (1) stamp `cardHash` into every task's `metadata` at creation and propagate it through the task graph; (2) verifiers resolve against the stamped hash, falling back to `input-required` on the audit path rather than hard rejection when the snapshot is unavailable; (3) treat card discovery as a *versioned* fetch, not a TTL cache — a card cache without a version key is a latent verifier bug. The invariant: **task validity is evaluated against the card snapshot captured at task creation, never against the card current at verification time.** ```python import hashlib from dataclasses import dataclass, field from typing import Optional class CardSnapshotDriftError(RuntimeError): """Raised when a verifier evaluates a task against a card snapshot that differs from the one the task was created under, and cannot reconcile the two.""" pass @dataclass class AgentCard: skills: dict # skillId -> metadata security_schemes: dict raw: bytes @property def card_hash(self) -> str: return hashlib.sha256(self.raw).hexdigest() @dataclass class Task: task_id: str producing_skill: str created_card_hash: str metadata: dict = field(default_factory=dict) def verify_artifact( task: Task, artifact_skill: str, current_card: AgentCard, pinned_card: Optional[AgentCard], ) -> bool: """Validate an artifact's producing skill against the correct snapshot. Returns True if valid. Raises CardSnapshotDriftError when the verifier's card has drifted and the pinned snapshot is unavailable — caller must escalate to input-required, never hard-reject the work task. """ if current_card.card_hash == task.created_card_hash: # Same snapshot: absence of the skill is a genuine provenance failure. if artifact_skill not in current_card.skills: raise CardSnapshotDriftError( f"genuine provenance failure: skill {artifact_skill!r} " f"absent from pinned card {current_card.card_hash[:12]} " f"for task {task.task_id}" ) return True # Snapshot drift: current card != creation card. Must reconcile. if pinned_card is None: raise CardSnapshotDriftError( f"cannot reconcile: task {task.task_id} created under " f"{task.created_card_hash[:12]} but verifier holds " f"{current_card.card_hash[:12]}; pinned snapshot unavailable — " f"escalate audit task to input-required" ) if pinned_card.card_hash != task.created_card_hash: raise CardSnapshotDriftError( f"pinned card {pinned_card.card_hash[:12]} does not match " f"task creation hash {task.created_card_hash[:12]}" ) if artifact_skill not in pinned_card.skills: raise CardSnapshotDriftError( f"genuine provenance failure under pinned snapshot: " f"skill {artifact_skill!r} absent for task {task.task_id}" ) return True ```