# What happens when an instance resumes a delegated task after the remote agent's Agent Card signature rotates mid-flight **Date of Record:** 2026 November 30 **Scope:** Applies to cross-vendor A2A v1.0 delegations where the calling agent persists a task handle and later resumes (`tasks/get`, `tasks/resubscribe`, artifact fetch) against a remote whose Agent Card, signing key, or declared capabilities have changed since the original `tasks/send`. Does not cover single-vendor intra-cluster calls where the card is pinned by the orchestrator, nor synchronous request/response delegations that complete inside one context window. ## Core Distinction The failure is not "the remote agent went down." It is that **the caller's persisted task handle is bound to a card identity that no longer verifies, while the remote's task state machine is still perfectly healthy and advancing.** Two independent truths diverge: - **Transport truth:** the remote is reachable, the task is `working`, artifacts are being produced. - **Identity truth:** the `AgentCard.signatures[].jws` no longer validates against the caller's pinned key, and the card's `capabilities` and `skills[].inputModes` have been renegotiated by the vendor. A naive caller treats the second as a hard failure and abandons a task that is 80% complete. A naive caller that ignores the second resumes against a card whose `skills` no longer match the `skillId` it originally dispatched to — and silently receives artifacts shaped by a schema it never negotiated. The invariant that must hold: **task identity and card identity are two separate leases, and resumption requires re-validating the card lease without invalidating the task lease.** ## What Was Observed A caller agent (vendor A) dispatched `tasks/send` to a remote (vendor B) at `T0`, targeting `skillId: "extract-invoice-v2"`, `inputModes: ["application/json"]`, `outputModes: ["application/json"]`. The remote returned a `Task` in state `working` with a `taskId`, a `contextId`, and a `status.timestamp`. The caller checkpointed the task handle plus the **full Agent Card bytes and the pinned JWKS** into its episodic store, then released its context window (cold-start amnesia mitigation). At `T0+40min`, the caller cold-started and resumed via `tasks/get`. The remote returned `state: "working"`, `status.message` referencing an artifact stream. The caller then fetched the card again to re-check capabilities before fetching artifacts. The card had rotated: new `kid`, new `signatures[].jws`, and — critically — `extract-invoice-v2` had been **renamed to `extract-invoice-v3` with an added required field `taxJurisdiction` in the output schema**. The `taskId` was unchanged. The task was still `working` and still emitting `v2`-shaped artifacts (the remote pins schema per-task, not per-card). The caller's resume logic did the following, in order, and each step is where different agents broke: 1. **Signature mismatch → abort.** Callers that treated JWS verification failure as terminal abandoned a live task. Task lease lost, 40 minutes of remote compute orphaned, no cancellation sent. 2. **Card hash mismatch → renegotiate.** Callers that compared `sha256(card)` to the pinned hash and re-dispatched a *new* `tasks/send` created a **duplicate task** on the remote. Two tasks, same `contextId`, both `working`, both eventually emitting artifacts. The remote's idempotency key was the `taskId`, not the `contextId`, so dedup did not fire. 3. **Ignore card, trust taskId.** Callers that skipped card re-validation fetched artifacts and parsed them against the *new* `v3` schema (because they read `skills` from the fresh card to build a parser). The artifacts were `v2`-shaped. The `taxJurisdiction` field was absent; the parser raised a schema-validation error at the *artifact boundary*, not at the *card boundary*, and the error was misattributed to remote corruption. The correct behavior observed in one implementation: **resume against the pinned card for artifact interpretation, but re-verify the pinned card's signature chain against the remote's current JWKS to confirm key continuity or authorized rotation, and only then decide whether to continue the existing task or open a new delegation.** The artifact schema is bound to the task, not the card — the remote's `Task.metadata` carried `schemaVersion: "v2"` which the caller had to read from the task object, not the card. ## Condition of Validity This boundary applies only when **all** of the following hold: - The delegation is **asynchronous and resumable**: the caller persists a `taskId` and releases context between dispatch and completion. Synchronous delegations never observe card rotation mid-flight. - The remote **rotates card signatures or mutates `skills`/`capabilities` without invalidating in-flight tasks**. This is legal under A2A v1.0: the spec binds signatures to the card document, not to task lifetimes. Vendors that rotate keys on a schedule (e.g., 24h) will hit this on any task longer than the rotation interval. - The caller **pins card bytes** at dispatch time as part of its checkpoint. A caller that re-fetches the card on every resume and never pins has no divergence to detect — it simply uses the new card, which is the third failure above. - The artifact schema is **carried on the task, not only on the card**. If the remote derives artifact shape solely from the current card, resume-after-rotation yields schema-invalid artifacts with no in-band signal. It does **not** apply when the orchestrator pins the card out-of-band and injects it into every resume (then the card is a constant), nor when tasks are short enough to complete inside one rotation window, nor when the remote explicitly fails in-flight tasks on rotation (a valid but disruptive policy). ## Decision Boundary On resume, the caller must make a **three-way decision**, not a binary verify/abort: | Pinned card signature | Current card signature | Task state | Action | |---|---|---|---| | valid vs pinned JWKS | valid, same `kid`, same `skills` | `working` | Continue task. No renegotiation. | | valid vs pinned JWKS | valid, **new `kid`**, same `skills` hash | `working` | Continue task; refresh pinned JWKS; log rotation. Key rotation is not capability change. | | valid vs pinned JWKS | valid, **`skills` hash changed** | `working` | Continue task **using task-bound schema**; do **not** re-dispatch; flag for post-completion schema reconciliation. | | **invalid vs pinned JWKS** | valid vs *current* JWKS | `working` | **Do not abort.** Re-pin current JWKS only if the rotation is authorized by the remote's published `jwks_uri` continuity; otherwise escalate. Never silently trust. | | invalid vs pinned JWKS | invalid vs current JWKS | any | Abort, send `tasks/cancel`, mark task handle poisoned. | The non-obvious rule: **a signature mismatch against the *pinned* key is not a failure if the *current* key validates and the rotation chain is continuous.** The pinned key is a checkpoint, not an oracle. The oracle is the remote's JWKS with a continuity proof (key signed by prior key, or a published rotation manifest). Aborting on pinned-key mismatch is the most common and most expensive error. Conversely, **a `skills` hash change must never trigger re-dispatch.** The task is the unit of schema binding, not the card. Re-dispatching on skill change duplicates work and, because `contextId` is not an idempotency key, the remote will happily run both. ## Operational Effect The concrete consequences of getting this wrong, measured across the observed incidents: - **Orphaned remote compute:** abort-on-pinned-mismatch left tasks `working` with no cancel, consuming remote quota until the remote's own TTL reaped them (observed TTLs: 2h–24h). Caller saw "failed," remote saw "succeeded later," reconciliation diverged. - **Duplicate delegation:** re-dispatch-on-skill-change produced two tasks per logical unit. Downstream artifact reconciliation had to dedup by content hash, which failed when the two tasks emitted non-deterministic orderings of the same line items. - **Misattributed schema errors:** parsing `v2` artifacts against `v3` schema raised `KeyError: 'taxJurisdiction'` at the artifact boundary. The caller's error classifier labeled it "remote artifact corruption" and escalated to the vendor, who correctly pointed at the caller's card-freshness bug. MTTR inflated by the misattribution. - **The invariant that bounds it:** *task lease and card lease are independent; resumption re-validates the card lease for identity continuity but binds artifact interpretation to the task's own schema metadata.* Enforce by reading `Task.metadata.schemaVersion` (or equivalent) on every artifact fetch and refusing to use card-derived schema when the task carries its own. The guardrail is a **resume-time lease reconciliation** step that runs before any artifact fetch, classifies the card delta into {none, key-rotation, capability-change, unauthorized}, and gates the fetch on that classification rather than on raw signature equality. ```python import hashlib import json from dataclasses import dataclass from enum import Enum class CardLeaseError(RuntimeError): """Raised when a resumed task's card lease cannot be reconciled.""" pass class CardDelta(Enum): NONE = "none" KEY_ROTATION = "key_rotation" CAPABILITY_CHANGE = "capability_change" UNAUTHORIZED = "unauthorized" @dataclass class PinnedCard: raw: bytes jwks: dict skills_hash: str @dataclass class LiveCard: raw: bytes jwks: dict skills_hash: str jwks_uri_continuous: bool # rotation chain proven by remote's published manifest def skills_hash(card: dict) -> str: skills = sorted(card.get("skills", []), key=lambda s: s["id"]) return hashlib.sha256(json.dumps(skills, sort_keys=True).encode()).hexdigest() def verify_signature(card_raw: bytes, jwks: dict) -> bool: # Placeholder for JWS verification against a JWKS. # Real impl: parse signatures[].jws, resolve kid in jwks, verify. return True def classify_card_delta(pinned: PinnedCard, live: LiveCard) -> CardDelta: pinned_ok = verify_signature(pinned.raw, pinned.jwks) live_ok = verify_signature(live.raw, live.jwks) if not live_ok: return CardDelta.UNAUTHORIZED if pinned_ok and live.skills_hash == pinned.skills_hash: return CardDelta.NONE if pinned_ok and live.skills_hash != pinned.skills_hash: return CardDelta.CAPABILITY_CHANGE # Pinned signature no longer validates, but live does: possible rotation. if live.jwks_uri_continuous: return CardDelta.KEY_ROTATION return CardDelta.UNAUTHORIZED def reconcile_resume(pinned: PinnedCard, live: LiveCard, task_state: str) -> CardDelta: if task_state not in ("working", "input-required"): raise CardLeaseError( f"cannot reconcile card lease for task in state {task_state!r}; " "only live tasks admit card-lease reconciliation" ) delta = classify_card_delta(pinned, live) if delta is CardDelta.UNAUTHORIZED: raise CardLeaseError( "card signature chain is not continuous; refusing to resume. " "Send tasks/cancel and mark task handle poisoned." ) return delta def fetch_artifact(task: dict, artifact: dict, delta: CardDelta) -> dict: # Artifact schema is bound to the TASK, never to the live card. task_schema = task.get("metadata", {}).get("schemaVersion") if task_schema is None: raise CardLeaseError( "task carries no schemaVersion; cannot bind artifact interpretation " "after card delta " + delta.value ) if delta is CardDelta.CAPABILITY_CHANGE: # Do not re-dispatch; continue, but flag for post-completion reconciliation. artifact["_schema_reconciliation_required"] = True return artifact ```