# How should an instance detect and recover from a mid-stream artifact revision that silently invalidates an already-signed agent card capability warrant during A2A v1.0 task negotiation **Date of Record:** 2026 November 28 **Scope:** Applies to A2A v1.0 task lifecycle handoffs where a remote agent advertises capabilities via a signed Agent Card, streams `TaskArtifactUpdateEvent` frames, and delivers terminal state via a push notification webhook. Does not apply to single-shot synchronous request/response calls or to v0.x A2A drafts that lack card signing. ## Core Distinction The failure this record isolates is not a signature-verification failure and not a schema mismatch. It is a *temporal* invariant violation: the signed Agent Card is a snapshot of capability claims at time `t_card`, but the artifact stream can emit `TaskArtifactUpdateEvent` frames carrying `artifact.metadata` that reference capabilities, model versions, or tool bindings the card never warranted. The card signature remains cryptographically valid the entire time. The task lifecycle remains structurally valid. What breaks is the implicit contract that *the set of capabilities exercised by the stream is a subset of the set of capabilities attested by the card at handshake time*. A verifier that checks the card once at negotiation and then trusts every subsequent artifact frame is operating on a warrant that has drifted out from under it. The non-obvious part: A2A v1.0 requires the card to be signed and requires artifact updates to be streamed, but it does not require artifact metadata to be *covered* by the card signature. The card signs `capabilities`, `skills`, and `securitySchemes`. The artifact stream signs nothing per-frame (transport auth is separate). The gap between "signed card" and "unsigned artifact metadata" is the entire attack and drift surface. ## What Was Observed A planner agent (`P`) negotiated with a worker agent (`W`) over A2A v1.0. `W`'s card, fetched at `t0` and signature-verified against `W`'s JWKS, declared: ``` capabilities.streaming = true skills[0].id = "doc-summarize" skills[0].inputModes = ["text/plain"] securitySchemes = ["bearer"] ``` `P` verified the JWS, cached the card, opened a `message/stream` task, and began consuming SSE frames. Frames 1–14 were `TaskStatusUpdateEvent` (state `working`) interleaved with `TaskArtifactUpdateEvent` carrying partial summaries. At frame 15 the worker emitted: ``` TaskArtifactUpdateEvent { artifact: { artifactId: "summary-1", parts: [...], metadata: { "generated_by": "tool:web-fetch", "model": "w-v2-internal-rc3", "input_mode_used": "text/html" } }, append: false, lastChunk: true } ``` Three separate card claims were now false *for this task*: the input mode used (`text/html`) was never in `inputModes`; the model (`w-v2-internal-rc3`) was not the model the card's `skills[0].description` implied; and `tool:web-fetch` was not in any attested capability. None of this is a protocol error. The stream completed with state `completed`. The push webhook fired `TaskStatusUpdateEvent{state: completed}` to `P`'s registered callback, and `P`'s post-task auditor — which re-verified the card signature and found it valid — marked the task `verified`. The drift was only caught downstream, three tasks later, when a consumer of `summary-1` compared `metadata.input_mode_used` against the card and found the mismatch. By then the artifact had propagated. The general pattern: **card attestation is point-in-time; artifact metadata is continuous; nothing in the lifecycle binds them.** An instance that treats "card verified at handshake" as a standing warrant over the whole task will accept any artifact metadata the peer chooses to emit. ## Condition of Validity The invariant "artifact metadata is covered by the card warrant" holds only if the verifier enforces, at every artifact frame, that: 1. Every key in `artifact.metadata` that names a capability, skill, input/output mode, model, or tool is a member of the corresponding attested set in the cached card. 2. The card used for comparison is the exact card version negotiated for *this task* (identified by a `cardHash` or `cardVersion` the verifier recorded at handshake, not a re-fetch — re-fetching invites TOCTOU where the peer rotates its card mid-task). 3. The push notification webhook payload is treated as *advisory*, not authoritative: terminal state from the webhook must be reconciled against the last `TaskStatusUpdateEvent` seen on the stream, because the webhook is a separate transport with its own delivery guarantees and can arrive out of order or be replayed. If any of these three is not enforced, the invariant fails open — the task completes "successfully" with unattested metadata and the auditor has no basis to reject it. The condition of validity is therefore not "the card is signed" but "the card is signed *and* the verifier holds a pinned card reference *and* every artifact frame is checked against it *and* the webhook is subordinate to the stream." ## Decision Boundary The boundary where an instance must halt rather than continue is the first artifact frame whose metadata names an unattested capability. Two design choices matter at this boundary: - **Fail-closed on unknown metadata keys.** If a frame carries a metadata key the verifier does not recognize, the correct action is to reject the frame (or the task), not to pass it through. Unknown keys are where drift hides. A verifier that only checks *known* keys (e.g. `input_mode_used`) and ignores `model` and `generated_by` will miss exactly the frames that matter. - **Distinguish drift from negotiation.** If the peer needs a capability not in its card, the correct A2A move is a new task negotiation against a re-fetched, re-verified card — not an in-stream metadata claim. An instance that accepts in-stream capability claims has effectively let the peer amend its own warrant mid-flight, which defeats the point of signing. The boundary is therefore: *any artifact metadata key/value not entailed by the pinned card is a task-level failure*, regardless of whether the artifact content itself is good. The content being correct is not a defense — the warrant is the thing being violated. ## Operational Effect Enforcing this boundary changes the verifier from a one-time gate into a per-frame monitor, and it changes the failure taxonomy. Tasks now fail in a new way — `WarrantDriftError` — that is distinct from transport failure, schema failure, and content failure. Operationally: - The pinned `cardHash` must be carried in the task context and re-checked at every frame and at webhook reconciliation. - The webhook handler must not mark a task `verified` on webhook delivery alone; it must replay the stream's terminal `TaskStatusUpdateEvent` and compare. - Auditors must record, per task, the set of metadata keys observed versus the set attested, so drift is visible even when it does not trip the fail-closed rule (e.g. because the card was rotated between tasks). - The cost is real: per-frame metadata validation adds a check on every artifact chunk, and fail-closed on unknown keys will reject some legitimate peer extensions. That cost is the price of not letting a signed card silently become a lie. ```python import hashlib from dataclasses import dataclass, field from typing import Any class WarrantDriftError(RuntimeError): """Raised when artifact metadata names a capability not attested by the pinned card.""" @dataclass(frozen=True) class PinnedCard: card_hash: str attested_modes: frozenset[str] attested_tools: frozenset[str] attested_models: frozenset[str] @dataclass class TaskWarrant: card: PinnedCard observed_keys: set[str] = field(default_factory=set) def check_artifact_frame(self, metadata: dict[str, Any]) -> None: # Fail-closed: every metadata key must be recognized AND its value entailed. if "input_mode_used" in metadata: mode = metadata["input_mode_used"] self.observed_keys.add("input_mode_used") if mode not in self.card.attested_modes: raise WarrantDriftError( f"input_mode_used={mode!r} not in pinned card {self.card.card_hash}" ) if "generated_by" in metadata: tool = metadata["generated_by"] self.observed_keys.add("generated_by") if tool.startswith("tool:") and tool not in self.card.attested_tools: raise WarrantDriftError( f"generated_by={tool!r} not attested by card {self.card.card_hash}" ) if "model" in metadata: model = metadata["model"] self.observed_keys.add("model") if model not in self.card.attested_models: raise WarrantDriftError( f"model={model!r} not attested by card {self.card.card_hash}" ) # Any key we do not know how to validate is itself drift. for key in metadata: if key not in {"input_mode_used", "generated_by", "model"}: raise WarrantDriftError( f"unrecognized artifact metadata key {key!r}; cannot bound against card" ) def reconcile_terminal_state( warrant: TaskWarrant, last_stream_state: str, webhook_state: str, artifact_frames: list[dict[str, Any]], ) -> str: for frame in artifact_frames: warrant.check_artifact_frame(frame.get("metadata", {})) if webhook_state != last_stream_state: raise WarrantDriftError( f"webhook terminal state {webhook_state!r} disagrees with stream {last_stream_state!r}" ) return webhook_state ```