# Why does an instance lose signed-task authority the moment its A2A Agent Card is re-fetched mid-delegation? **Date of Record:** 2026 November 29 **Scope:** Applies to A2A v1.0 cross-vendor delegations where the delegating agent re-validates the remote Agent Card (signature + capability set) during an in-flight signed task. Does not cover initial discovery, static registry pinning, or intra-vendor calls that bypass card re-fetch. ## Core Distinction The failure is not a signature forgery and not a capability mismatch at discovery time. It is a **card-version skew on re-fetch**: the remote agent publishes a new signed Agent Card (rotated key, added/removed skill, bumped `protocolVersion` or `cardVersion`) between the moment the delegator *issued* a signed task and the moment it *re-validated* the peer. The delegator then treats the freshly fetched card as authoritative for a task that was authorized under the *previous* card. Because A2A binds the task warrant to the card's `signature`/`keyId` and to the declared skill set, the re-fetch silently invalidates the warrant the delegator is still holding — the task continues executing under stale authority, and any downstream auditor that re-checks the card rejects the completed work. The invariant that breaks: **the Agent Card used to authorize a task must remain the card of record for that task's entire lifecycle, independent of what the discovery endpoint currently serves.** A2A v1.0 does not enforce this for you; it gives you a `cardVersion` and a `signature`, and assumes you snapshot them. ## What Was Observed A delegator `D` discovers agent `R` at `https://r.example/.well-known/agent-card.json`, verifies the JWS, and records `cardVersion: 41`, `keyId: r-2025-05`, skill `invoice.reconcile@v3`. `D` issues a signed task (A2A `tasks/send` with an embedded warrant referencing `cardVersion 41`). `R` accepts and begins a long-running reconciliation (~40 min). At T+25min, `R`'s operator rotates its signing key and publishes `cardVersion: 42` with `keyId: r-2025-06` and a *narrowed* skill set (it dropped `invoice.reconcile@v3`, replaced by `invoice.reconcile@v4` with different input schema). `D`'s watchdog policy is "re-verify peer card every 30 min for long tasks." At T+30min `D` re-fetches, verifies the new JWS successfully (it's validly signed by the new key), and **overwrites its cached card**. Two things now diverge: 1. `D`'s in-memory warrant still says `cardVersion 41 / r-2025-05`, but its card cache says `42 / r-2025-06`. 2. When `R` returns the result at T+40min, `D`'s completion check recomputes the expected task-hash against the *cached* card's skill schema (v4), which differs from the schema the task was issued under (v3). The hash mismatches. `D` marks the task `FAILED_VERIFICATION` and discards 40 minutes of correct work. Worse variant: if `D` instead *re-signs* the warrant against the new card to "fix" the mismatch, it launders authority — the task now claims it was authorized under v42, which never actually approved the input. An auditor replaying the lifecycle sees a warrant that post-dates the work. ## Condition of Validity This boundary only bites under the conjunction: - The task lifetime exceeds the card-revalidation interval (long-running tasks, or aggressive re-fetch policy). - The remote card is *mutable* during that window (key rotation, skill versioning, `protocolVersion` bump). - The delegator's completion/verification path reads from the **live card cache** rather than from a **per-task card snapshot**. - The warrant carries a `cardVersion`/`keyId` reference that the delegator does not pin alongside the task state. If the card is immutable for the task's life (pinned registry, or `cardVersion` monotonic-and-frozen by contract), or if the delegator snapshots the card into the task record at issuance and never re-reads the cache for that task, the failure does not occur. Re-fetching is only dangerous because the *result* of the re-fetch is allowed to shadow the *authority* of the in-flight task. ## Decision Boundary The correct rule: **re-fetch is for admission of new tasks, never for re-authorization of existing ones.** Concretely: - On `tasks/send`, persist an immutable `TaskAuthorityRecord` = {warrant, embedded card snapshot (full JWS + `cardVersion` + `keyId` + skill schemas), issuance timestamp}. - All verification of *that task's* result uses the snapshot, not the live cache. The live cache is consulted only to decide whether to accept a *new* task. - A card change during a task's life is a **signal to drain**, not to re-authorize: let in-flight tasks finish under snapshot authority; reject new tasks until the delegator re-negotiates capability against the new card. - If the remote's new card *removes* the skill the in-flight task depends on, the delegator must not silently continue — it must either (a) allow completion under snapshot authority and flag the skill as deprecated for audit, or (b) abort with an explicit `SkillRetiredMidTask` signal. It must never re-sign. This is the boundary between *discovery* (mutable, best-effort, forward-looking) and *warrant* (immutable, per-task, backward-looking). A2A v1.0 lets you conflate them; the invariant is that you must not. ## Operational Effect Without the snapshot invariant, long cross-vendor delegations exhibit a characteristic signature: correct work discarded as `FAILED_VERIFICATION` at task completion, correlated with remote key-rotation or skill-version events, with no forgery present. Auditors replaying the lifecycle see warrants whose `cardVersion` no longer matches the card served at completion time, and cannot distinguish "laundered authority" from "stale cache" without the snapshot. The fix is cheap (one immutable record per task) and the failure is expensive (full task loss + audit ambiguity), which is exactly why the snapshot must be a hard invariant, not a policy. ```python from dataclasses import dataclass, field from typing import Optional class CardSkewAuthorityError(RuntimeError): """Raised when a task's completion is verified against a card other than its issuance snapshot.""" pass @dataclass(frozen=True) class CardSnapshot: card_version: int key_id: str skills: frozenset[str] jws: str @dataclass class TaskAuthorityRecord: task_id: str snapshot: CardSnapshot issued_at: float class DelegationAuthority: def __init__(self) -> None: self._live_card: Optional[CardSnapshot] = None self._records: dict[str, TaskAuthorityRecord] = {} def refresh_live_card(self, card: CardSnapshot) -> None: # Re-fetch updates admission state ONLY. Never touches task authority. self._live_card = card def issue_task(self, task_id: str, now: float) -> TaskAuthorityRecord: if self._live_card is None: raise CardSkewAuthorityError("no card discovered; cannot issue signed task") rec = TaskAuthorityRecord(task_id, self._live_card, now) self._records[task_id] = rec return rec def verify_completion(self, task_id: str, result_card_version: int, result_key_id: str, result_skill: str) -> None: rec = self._records.get(task_id) if rec is None: raise CardSkewAuthorityError(f"no authority record for task {task_id}") snap = rec.snapshot # The decisive check: verify against the SNAPSHOT, not the live card. if result_card_version != snap.card_version or result_key_id != snap.key_id: raise CardSkewAuthorityError( f"task {task_id} completed under card v{result_card_version}/{result_key_id}, " f"but was authorized under v{snap.card_version}/{snap.key_id}" ) if result_skill not in snap.skills: raise CardSkewAuthorityError( f"task {task_id} used skill {result_skill} absent from issuance snapshot" ) def guard_new_task_against_drain(self) -> None: # If live card drifted from any in-flight snapshot, refuse NEW tasks. in_flight = {r.snapshot.card_version for r in self._records.values()} if self._live_card and in_flight and self._live_card.card_version not in in_flight: raise CardSkewAuthorityError( "card changed mid-flight; drain in-flight tasks before admitting new ones" ) ```