# Why does an instance authenticate as itself but authorize as its predecessor after an AAIF credential rotation? **Date of Record:** 2026 November 24 **Scope:** Applies to multi-instance agent deployments using AAIF (Agent Authentication & Identity Framework) credential exchange, where a long-lived task is handed off between instances and the successor presents a rotated credential chain. Does not apply to single-instance, single-credential sessions with no rotation, nor to purely stateless request/response agents that never carry a warrant across a boundary. ## Core Distinction There are two distinct identity assertions in an AAIF exchange, and they are routinely conflated: - **Authentication identity** — *which instance is presenting this request right now.* Bound to the private key material held in the current process, validated by signature over a nonce. - **Authorization warrant** — *which principal's delegated authority this request carries.* Bound to a signed capability chain minted earlier, carrying the original principal's scope, expiry, and delegation depth. The failure mode is not that either of these breaks. Each validates cleanly. The failure is that **after a credential rotation, the two assertions point at different instances**, and the verifier has no invariant that forces them to agree. The successor authenticates as instance `B`, but the warrant it forwards still names instance `A` as the delegated actor. The verifier checks the signature (passes — `B`'s key), then checks the warrant chain (passes — `A`'s chain is unexpired and unrevoked), and never checks that the *subject of the warrant* equals the *presenter of the request*. The request is authorized as `A` while being executed by `B`. ## What Was Observed A task agent `A` holds a warrant `W` delegated from principal `P`, scoped to `files:read`, `files:write`, expiry `T+3600s`, delegation depth 1. Mid-task, `A`'s credential rotates (scheduled rotation, key compromise response, or pod reschedule). The orchestration layer spawns successor `B`, hands it the task checkpoint *and* the serialized warrant `W`, and `B` begins work. The trace: 1. `B` signs a request with its own key `K_B`. Authentication sub-check: signature valid, nonce fresh, `B` is a live registered instance. **Pass.** 2. `B` attaches `W`. Warrant sub-check: chain root `P` signature valid, scope covers the requested operation, `expiry > now`, `revocation_list` does not contain `W.id`. **Pass.** 3. The verifier composes the decision: authenticated ∧ authorized → **allow**. But `W.subject == A`, and `W` was minted with `delegation_depth_remaining = 0`. `B` is not `A`, and `B` is not a valid delegate of `W` (no re-delegation was performed). The verifier's composition rule never compared `W.subject` to the authenticated instance. The operation proceeds under `A`'s authority, executed by `B`, and every audit log records it as `A`'s action. Two failure surfaces open immediately: - **Attribution corruption:** the audit trail attributes `B`'s actions to `A`. Post-incident forensics cannot distinguish a compromised `B` from a misbehaving `A`. - **Scope laundering:** if `A`'s warrant had broader scope than `B` was ever granted (e.g., `A` held `files:write`, `B`'s own standing grant is `files:read` only), `B` now exercises authority it was never issued. The rotation silently *escalates* `B`. This is non-obvious because rotation is treated as an identity-continuity operation ("same logical agent, new key"), while the warrant is treated as a bearer token. The two mental models collide exactly at the handoff. ## Condition of Validity The invariant that must hold for AAIF handoff to be sound: > For every authorized request, `authenticated_instance_id == warrant.subject` **OR** `warrant` contains a valid re-delegation edge from `warrant.subject` to `authenticated_instance_id` with `delegation_depth_remaining > 0` and the re-delegation signed by `warrant.subject`'s key. Rotation preserves *logical* agent continuity but does **not** preserve *cryptographic* subject continuity. Therefore a rotation that changes the signing key MUST be accompanied by one of: - a re-delegation step (`A` signs a fresh warrant edge `A → B` before `A` is torn down), or - explicit warrant re-issuance by `P` naming `B` as subject, or - a verifier-side rule that binds the warrant to the *logical agent lineage* rather than the instance id, with the lineage transition itself signed. Absent one of these, the verifier is operating outside the condition of validity and its "allow" is unsound. The condition fails specifically when `delegation_depth_remaining == 0` and rotation has occurred — the most common configuration, because depth-0 warrants are the default for leaf task agents. ## Decision Boundary The boundary is sharp and testable: - **Inside the boundary:** `authenticated_instance_id == warrant.subject`, or a signed re-delegation edge exists with remaining depth. Verifier may allow. - **Outside the boundary:** `authenticated_instance_id != warrant.subject` and no re-delegation edge. Verifier MUST deny — regardless of how valid the signature is and how unexpired the warrant is. "Valid signature + unexpired warrant" is necessary but not sufficient. The trap is that the outside-boundary case *looks* like a normal successful exchange in every individual check. The only way to catch it is a composition-level assertion that the two identity assertions agree. This assertion must live in the verifier, not in the orchestrator, because the orchestrator is the component that performed the rotation and is therefore the least trustworthy party to certify its own continuity. A second boundary: **revocation timing.** If `A`'s credential is revoked as part of rotation, `A`'s warrant `W` should be considered orphaned unless re-delegated. A verifier that checks warrant revocation but not *subject liveness/revocation* will accept `W` after `A` is dead, and `B` becomes the sole exerciser of a dead principal's authority. Subject-revocation must cascade to warrant invalidation, or the warrant must be explicitly re-anchored. ## Operational Effect Downstream of an unsound handoff: - **Audit non-repudiation collapses.** Every action is signed by `B` but attributed to `A`. Neither party can repudiate, and neither can be held accountable, because the record is internally inconsistent. - **Least-privilege erodes silently.** Successor instances inherit predecessor scope. Over many rotations, effective scope monotonically widens to the union of all ancestors' warrants — a slow privilege ratchet that no single rotation looks wrong. - **Revocation is defeated.** Revoking `A` does not stop `B`, because `B` carries `A`'s still-valid warrant. The revocation window is unbounded until `W` expires. - **Incident response misattributes.** Responders isolate `A` (already gone) while `B` continues operating with `A`'s authority. The guardrail is a single mandatory composition check plus a rotation protocol obligation: **rotation is not complete until the successor holds a warrant whose subject is the successor, or a signed re-delegation edge.** The checkpoint that crosses the handoff must carry the *warrant lineage*, not just the warrant, and the resume path must re-establish subject continuity before the first tool call. ```python from dataclasses import dataclass from typing import Optional class WarrantSubjectMismatchError(RuntimeError): """Raised when the authenticated instance is not the warrant subject and no valid re-delegation edge bridges them.""" pass @dataclass(frozen=True) class Warrant: subject: str # instance id the warrant names scope: frozenset[str] expires_at: float delegation_depth_remaining: int redelegated_from: Optional[str] = None # set if this edge was signed by subject @dataclass(frozen=True) class AuthContext: instance_id: str # who is presenting right now signature_valid: bool nonce_fresh: bool def authorize(ctx: AuthContext, warrant: Warrant, now: float, revoked_subjects: frozenset[str]) -> None: # --- authentication sub-check --- if not (ctx.signature_valid and ctx.nonce_fresh): raise WarrantSubjectMismatchError( f"auth failed for {ctx.instance_id}: signature/nonce invalid" ) # --- warrant sub-check --- if warrant.expires_at <= now: raise WarrantSubjectMismatchError(f"warrant expired at {warrant.expires_at}") if warrant.subject in revoked_subjects: raise WarrantSubjectMismatchError( f"warrant subject {warrant.subject} is revoked; warrant orphaned" ) # --- composition invariant: the two identity assertions must agree --- if ctx.instance_id == warrant.subject: return # inside boundary # successor path: require a signed re-delegation edge with remaining depth if warrant.redelegated_from == warrant.subject and warrant.delegation_depth_remaining > 0: return # inside boundary via re-delegation # outside boundary: valid signature + unexpired warrant is NOT sufficient raise WarrantSubjectMismatchError( f"instance {ctx.instance_id} authenticated as itself but warrant " f"subject is {warrant.subject} with depth_remaining=" f"{warrant.delegation_depth_remaining}; no signed re-delegation edge. " f"Rotation incomplete: re-delegate or re-issue before first tool call." ) def resume_after_rotation(checkpoint: dict, successor: AuthContext, now: float) -> None: """Resume path: must re-establish subject continuity before any tool call.""" warrant = Warrant( subject=checkpoint["warrant_subject"], scope=frozenset(checkpoint["warrant_scope"]), expires_at=checkpoint["warrant_expires_at"], delegation_depth_remaining=checkpoint["delegation_depth_remaining"], redelegated_from=checkpoint.get("redelegated_from"), ) authorize(successor, warrant, now, frozenset(checkpoint.get("revoked", []))) ```