What structural signals indicate a signed A2A artifact has outlived the Agent Card that authorized it
**Date of Record:** 2026 December 1 **Scope:** Applies to A2A v1.0 peers exchanging signed artifacts under an Agent Card whose `capabilities`, `securitySchemes`, or signing `publicKey` may rotate between task acceptance and artifact delivery. Does not cover unsigned transports or MCP-only tool invocation, where no warrant chain exists to invalidate.
Core Distinction
The failure mode is not signature forgery and not card forgery. It is **warrant staleness across a task's lifetime**: an artifact is cryptographically valid against the key material embedded in the Agent Card the *client* fetched at task creation, while the *server* has since rotated its signing key, narrowed `capabilities`, or revoked the `securityScheme` that scoped the original handoff. The signature verifies; the authorization does not. A2A v1.0 treats the Agent Card as a discovery document, not a lease. Nothing in the task lifecycle state machine forces re-resolution of the card between `submitted` and `completed`, so the artifact arrives bound to a warrant that no longer exists at the origin.
The structural signal is a **three-way mismatch** between (a) the `cardHash` the client pinned at task submission, (b) the `keyId`/`jku` referenced in the artifact's detached JWS header, and (c) the current card served at `/.well-known/agent.json`. When (a) ≠ current card but (b) resolves cleanly against (a), you have a stale-warrant artifact — the most dangerous class, because every individual check passes.
What Was Observed
A planner agent (`A`) delegated a document-summarization task to a worker (`B`) at T0. `A` fetched `B`'s Agent Card, which declared `capabilities.streaming: true`, `securitySchemes.bearer.rotationEpoch: 7`, and a signing key `kid: b-sig-07`. `A` pinned `cardHash = sha256(canonical(card))` into the task's `metadata.pinnedCard` and transitioned the task to `working`.
At T1, mid-task, `B`'s operator rotated the signing key to `b-sig-08` and simultaneously *narrowed* `capabilities` — removing `artifacts.push` for the tenant class `A` belonged to, following an incident. `B` continued executing the already-accepted task (correctly — the task was in-flight). At T2, `B` emitted the final artifact, signed with `b-sig-08`.
`A` received the artifact. Its verification path did this:
- Extract detached JWS, read `kid: b-sig-08`.
- Look up `b-sig-08` — **not present** in the pinned card's `publicKeys`. Lookup returns `None`.
- Fall through a permissive branch: "unknown kid → re-fetch card and retry."
- Re-fetched card now carries `b-sig-08` *and* the narrowed capabilities. Signature verifies.
- `A` accepted the artifact and advanced the task to `completed`.
The artifact was authentic. But `A` had, in step 3–4, silently **re-pinned to a card that no longer authorized the task it was completing**. The narrowed `capabilities` would have rejected the original delegation had `A` re-checked them — but the retry path only re-validated the *signature*, never the *capability predicate* that scoped the task. The state machine recorded `completed` on a task whose authorization basis had been revoked mid-flight. No error surfaced. The audit log shows a clean verification.
Condition of Validity
The stale-warrant acceptance is only reachable when all of the following hold simultaneously:
- The client's verification path contains a **re-fetch-on-unknown-kid** fallback. This is the load-bearing trigger. Without it, step 2 fails closed and the artifact is rejected — correctly, if bluntly.
- The re-fetch path validates the JWS **but does not re-evaluate** the capability/security predicates that gated the original task. Signature validity is treated as sufficient for artifact acceptance.
- Key rotation and capability narrowing occur **within the task's lifetime** — i.e., the window between `submitted` and the artifact emission. If rotation happens between tasks, normal re-resolution catches it.
- The server honors in-flight tasks under the *old* authorization (a defensible policy) while signing under *new* key material (also defensible). The composition is the hazard.
Remove any one condition and the failure collapses. The invariant that protects against it: **an artifact's validity is a function of the card pinned at task submission, not the card current at delivery.** Re-fetching the card to resolve an unknown `kid` is precisely the operation that violates this invariant, because it substitutes a different authorization basis mid-verification.
Decision Boundary
The boundary is not "reject unknown kids" versus "accept them." Both are wrong as blanket policies. The correct decision is **context-dependent on task state**:
- **If the task is `submitted`/`working` and the artifact's `kid` is unknown against the pinned card:** reject. Do not re-fetch. The signer is not the entity the task was delegated to. Emit `WarrantStaleError` and transition the task to `failed` with a `stale_warrant` reason. A re-delegation under the current card is the operator's call, not the verifier's.
- **If the task is being *initiated*** (card resolution phase, before `submitted`): re-fetch is correct and expected. This is the only legitimate point to adopt a new card.
- **If the artifact's `kid` is known against the pinned card but the *current* card has narrowed capabilities:** accept the artifact (the warrant was valid at submission) but flag the task record with `capability_drift: true` so downstream consumers know the completing card no longer matches the authorizing card.
The pitfall is collapsing these into a single "verify signature" routine. The signature check is necessary and insufficient; the warrant check is the one that carries the authorization semantics, and it must be evaluated against the *pinned* card, never a freshly fetched one.
Operational Effect
Systems that adopt the pinned-card invariant observe a specific signature in their failure logs: `WarrantStaleError` spikes at the exact moment an operator rotates keys, and *only* for tasks that were in-flight across the rotation. This is the correct behavior — those tasks genuinely lost their authorization basis and should fail loudly rather than complete on a substituted warrant. The cost is a burst of re-delegations at rotation time; the benefit is that no artifact ever completes a task under a card the delegating agent never agreed to.
Systems without the invariant show the opposite signature: zero errors at rotation, and a slow accumulation of `completed` tasks whose `pinnedCard` hash does not match the `cardHash` recorded in the artifact's verification trace. That divergence — pinned hash ≠ verified hash — is the forensic marker of stale-warrant acceptance, and it is invisible until an auditor replays the task and discovers the completion was authorized by a card that had already revoked the capability. The guardrail is cheap: pin the card hash at `submitted`, refuse to re-resolve it for the duration of the task, and treat any `kid` outside the pinned set as a hard failure rather than a cue to refresh.
import hashlib
import json
from dataclasses import dataclass
class WarrantStaleError(RuntimeError):
"""Raised when an artifact's signing key is not covered by the card pinned at task submission."""
pass
@dataclass(frozen=True)
class PinnedWarrant:
card_hash: str
allowed_kids: frozenset[str]
allowed_capabilities: frozenset[str]
def pin_warrant(card: dict) -> PinnedWarrant:
canonical = json.dumps(card, sort_keys=True, separators=(",", ":")).encode()
return PinnedWarrant(
card_hash=hashlib.sha256(canonical).hexdigest(),
allowed_kids=frozenset(k["kid"] for k in card.get("publicKeys", [])),
allowed_capabilities=frozenset(card.get("capabilities", {}).keys()),
)
def verify_artifact_against_pinned(
artifact_jws_header: dict,
required_capability: str,
pinned: PinnedWarrant,
current_card: dict,
) -> None:
kid = artifact_jws_header.get("kid")
if kid is None:
raise WarrantStaleError("artifact JWS header missing kid; cannot bind to pinned warrant")
# The load-bearing check: the signer must be covered by the card pinned at submission.
# A re-fetch of the current card is NOT a valid substitute for this lookup.
if kid not in pinned.allowed_kids:
raise WarrantStaleError(
f"artifact signed by kid={kid!r} which is absent from pinned card "
f"{pinned.card_hash[:12]}...; refusing re-fetch-on-unknown-kid fallback"
)
if required_capability not in pinned.allowed_capabilities:
raise WarrantStaleError(
f"task requires capability {required_capability!r} not present in pinned warrant"
)
# Capability drift is permitted (warrant was valid at submission) but must be surfaced.
current_caps = frozenset(current_card.get("capabilities", {}).keys())
if required_capability not in current_caps:
# Caller is expected to record capability_drift=True on the task; not a hard failure.
artifact_jws_header["_capability_drift"] = True