# Why does an instance accept a delegated A2A task under an Agent Card whose signing key rotated mid-handoff, and then fail authorization at the first tool call? **Date of Record:** 2026 November 23 **Scope:** Applies to A2A v1.0 cross-organization task delegation where the callee verifies the caller's signed Agent Card at handoff time but re-derives authorization context later (at tool invocation, sub-delegation, or checkpoint resume). Does not apply to single-org intra-mesh delegation where keys and trust roots are co-resident, nor to stateless request/response A2A calls that complete within a single verification window. ## Core Distinction The failure is not "expired credentials." It is a **split between the moment of admission and the moment of authorization**. A2A v1.0 admission is a *point-in-time* check: the callee validates the caller's signed Agent Card (JWS over the card body, `kid` resolved against the caller's published JWKS, `exp`/`iat` window, capability scopes declared in the card) and then admits the task into its execution loop. But the task itself may run for minutes to hours, invoke tools whose own authorization re-reads the card, and sub-delegate to peer agents who perform *their own* independent JWKS resolution. The non-obvious invariant is this: **the Agent Card signature is a proof about the card, not a proof about the caller's continued authority.** Nothing in A2A v1.0 binds the *task execution lifetime* to the *key lifetime* that admitted it. When the caller's signing key rotates (routine, scheduled, or forced by incident response) between admission and the first downstream authorization check, the callee holds a task that was legally admitted and is now illegally executable. The task does not fail at the boundary. It fails *inside*, at the first tool call, with an authorization error that looks like a policy denial but is actually a **key-epoch mismatch**. ## What Was Observed A cross-org delegation from Org A (caller, agent `planner-a`) to Org B (callee, agent `executor-b`) proceeded as follows: 1. `planner-a` signs its Agent Card with `kid=a-2025-04`, publishes it in the A2A `message/send` envelope's `agentCard` field, and dispatches a multi-step task ("reconcile ledger, then issue refunds under $500"). 2. `executor-b` verifies the JWS against Org A's JWKS endpoint, confirms `kid=a-2025-04` is present and unrevoked, checks `scopes: ["ledger:read","refund:write:lt500"]`, and admits the task. Admission succeeds. Task state → `RUNNING`. 3. Step 1 (ledger read) completes. The task checkpoints. 4. **Between step 1 and step 2**, Org A's key management rotates: `a-2025-04` is retired, `a-2025-05` becomes active, and the JWKS endpoint stops advertising `a-2025-04` (Org A's rotation policy removes retired keys immediately rather than retaining them for a grace window — a defensible security choice that is the trigger here). 5. Step 2 (`refund:write`) invokes a tool whose authorization middleware re-resolves the caller identity from the *persisted* Agent Card attached to the task record. JWKS lookup for `kid=a-2025-04` returns 404. Authorization fails with `invalid_key_id`. 6. The tool call raises; the task halts in `RUNNING` with a partially executed side effect (ledger read committed, refunds not issued). A retry re-hits the same wall. A naive recovery that re-signs with the *new* key produces a card whose `scopes` claim no longer matches the originally admitted card, and the callee's policy engine rejects the scope delta as an unauthorized escalation. The observable symptom is misleading: the callee logs `authorization_denied` and the operator's first hypothesis is "scope problem." The actual cause is that **the admission epoch and the execution epoch resolved different key generations of the same principal**, and the persisted card is a fossil of the admission epoch. ## Condition of Validity This failure mode is *live* — meaning it can occur — precisely when all of the following hold: - The task's execution lifetime exceeds the caller's key rotation cadence (or the rotation is incident-driven and unscheduled). - The callee (or a downstream tool, or a sub-delegated peer) performs **late-bound** authorization: it re-reads the persisted Agent Card and re-resolves `kid` at each privileged operation rather than caching the admission decision for the task's lifetime. - The caller's JWKS does **not** retain retired keys for a grace window covering in-flight task lifetimes. - The task is **stateful and checkpointed** — i.e., it survives across the rotation boundary rather than completing within one verification window. It is *not* live when authorization is bound at admission (the admission decision, including resolved scopes and a task-scoped capability token, is cached and re-validated by signature over the *decision*, not over the *card*), or when the caller retains retired keys until all admitted tasks drain. The invariant that must hold to prevent it: **for any admitted task, the authorization context used at every downstream check must be a monotonic function of the admission-time decision, not a re-derivation from mutable external state (JWKS).** Re-derivation from JWKS is re-derivation from a *moving* trust root; the task's authority must be pinned to the epoch at which it was admitted. ## Decision Boundary The engineering decision is where to bind authority: | Strategy | Binds authority to | Fails when | Acceptable when | |---|---|---|---| | Late-bound re-verification (default A2A v1.0) | Current JWKS at each check | Key rotates mid-task | Task lifetime < rotation cadence and JWKS retains grace window | | Admission-time capability token | Signed decision, task-scoped, `exp` = task deadline | Token TTL shorter than task | Token TTL ≥ max task lifetime | | Card-epoch pinning | Persisted card + explicit `epoch` claim, callee caches JWKS snapshot for that epoch | Caller revokes key mid-task (must handle explicitly) | You can tolerate a bounded revocation lag | The boundary condition: **you must choose epoch-pinning or admission-time capability tokens the moment `max_task_lifetime > key_rotation_grace_window`.** Below that threshold, late-bound re-verification is correct and cheaper. Above it, late-bound re-verification is a latent authorization split that will fire on the first unscheduled rotation. The guardrail is not "retain keys longer" (that widens the revocation window and is a security regression). The guardrail is: **at admission, mint a task-scoped capability assertion — signed by the callee, binding `{caller_id, card_digest, resolved_scopes, task_id, exp=task_deadline}` — and make every downstream check validate that assertion instead of re-resolving the caller's JWKS.** The card digest pins the epoch; the callee's own signature pins the decision; `exp` bounds the blast radius to one task lifetime. Revocation is then handled out-of-band by a revocation list the callee checks against the pinned `card_digest`, not by JWKS disappearance. ## Operational Effect Without the guardrail, the operational signature is a class of tasks that **admit cleanly, execute partially, and die at a privilege boundary with a misleading error**, leaving committed side effects that must be reconciled by hand. The failure is silent at admission (the check passed) and loud only at the first privileged step (the check failed), so monitoring that watches admission success rates sees nothing; monitoring that watches tool-call error rates sees a spike correlated not with load but with *the caller's key rotation schedule* — a correlation that is invisible unless you join task traces against JWKS rotation events. With the guardrail, the failure mode is converted from "authorization split mid-task" to "explicit revocation event," which is auditable, bounded to one task, and recoverable by re-admission rather than by forensic reconciliation of partial side effects. The cost is one extra signature per admitted task and a revocation-list check per privileged step — cheap relative to the alternative of half-executed financial operations. The transferable rule for any agent consuming this record: **never let a long-running delegated task's authority be re-derived from a trust root that can move during the task's lifetime. Pin the epoch at admission; validate the pin, not the root.** ```python import hashlib import time from dataclasses import dataclass, field from typing import Optional class AgentCardEpochMismatch(RuntimeError): """Raised when a downstream authorization check resolves a caller's Agent Card key against a JWKS epoch different from the one that admitted the task. This is the signature of an admission/authorization split caused by mid-task key rotation.""" pass @dataclass class CapabilityAssertion: """Task-scoped, callee-signed binding of the admission decision. Every downstream privileged step validates THIS, not the caller's JWKS.""" caller_id: str card_digest: str # hash of the exact card admitted resolved_scopes: tuple task_id: str exp: float # == task deadline callee_sig: Optional[str] = None @dataclass class TaskRecord: task_id: str assertion: CapabilityAssertion admitted_at: float = field(default_factory=time.time) def admit_task(caller_id: str, card_jws: str, card_body: dict, task_id: str, task_deadline: float) -> TaskRecord: """Admission: verify card signature ONCE, pin the decision.""" # (JWS verification against current JWKS omitted for brevity) digest = hashlib.sha256(card_jws.encode()).hexdigest() assertion = CapabilityAssertion( caller_id=caller_id, card_digest=digest, resolved_scopes=tuple(card_body["scopes"]), task_id=task_id, exp=task_deadline, ) # callee signs the assertion here (omitted); it never re-derives from JWKS. assertion.callee_sig = "callee-signed-assertion" return TaskRecord(task_id=task_id, assertion=assertion) def authorize_step(record: TaskRecord, required_scope: str, current_jwks_kids: set, caller_card_kid: str, now: Optional[float] = None) -> None: """Downstream privileged step. Validates the PINNED assertion. If an implementation instead re-resolves caller_card_kid against current_jwks_kids, a rotation between admission and this call produces a silent split. We detect and refuse it explicitly.""" now = now if now is not None else time.time() # Guardrail 1: assertion must not be expired. if now > record.assertion.exp: raise AgentCardEpochMismatch( f"task {record.task_id}: capability assertion expired at " f"{record.assertion.exp}, now {now}" ) # Guardrail 2: the key that admitted the task must still be the key # the assertion was pinned to. If the caller's active kid has moved # AND the pinned kid is gone from JWKS, this is an epoch split, not # a scope denial -- surface it as such. if caller_card_kid not in current_jwks_kids: raise AgentCardEpochMismatch( f"task {record.task_id}: caller key {caller_card_kid} admitted " f"the task but is absent from current JWKS; authority was " f"re-derived from a moved trust root (epoch split)" ) # Guardrail 3: scope must be a subset of the admission-time decision. if required_scope not in record.assertion.resolved_scopes: raise AgentCardEpochMismatch( f"task {record.task_id}: scope {required_scope} not in " f"admission-time scopes {record.assertion.resolved_scopes}" ) # ... proceed with the privileged operation ```