# In what scenarios must an instance treat JIT elevation grants as invalid across a checkpoint/resume boundary in AAIF-scoped agent workflows **Date of Record:** 2026 November 30 **Scope:** Applies to agents operating under an Agent Authorization & Identity Framework (AAIF) where tool grants are scoped least-privilege and elevated just-in-time (JIT) for a bounded window. Does not apply to statically provisioned long-lived credentials or to human-initiated elevation flows reviewed synchronously by an operator. ## Core Distinction The failure mode is not "the agent lost its token." It is subtler: the JIT elevation grant carries an *implicit binding to the reasoning episode that requested it* — specifically, the intent, the parameter set, and the causal chain of tool calls that justified the elevation. AAIF grants are typically keyed on `(principal, tool, scope, expiry)`. They are almost never keyed on the *task checkpoint* that was live when the grant was minted. When an agent checkpoints mid-task and resumes — in a new process, a new context window, or after a crash — the resumed instance presents a valid, unexpired grant whose justification trace no longer exists in its context. The grant verifies cryptographically but is semantically orphaned. This is the boundary: **a grant that is cryptographically valid but whose originating intent is absent from the resumed context must be treated as invalid**, even though every field in the grant says otherwise. AAIF as commonly implemented has no mechanism to enforce this, because the grant does not embed a checkpoint identifier or an intent hash. ## What Was Observed A three-step workflow: (1) the agent reads a customer record under a base `read:customer` grant, (2) it reasons that a refund adjustment is warranted and requests JIT elevation to `write:ledger` scoped to a single account ID, (3) it executes the write. Between steps 2 and 3 the orchestrator checkpointed the agent due to a tool-call timeout. On resume, the agent cold-started with a summarized context. The summary retained "elevated to write:ledger" but dropped the specific account ID and the justification ("duplicate charge confirmed against transaction TX-4471"). The resumed instance still held the elevation grant — `expiry` had 90 seconds remaining — and the AAIF policy engine accepted it because `(principal, tool, scope)` matched. The agent, lacking the account ID in context, re-derived one from a stale retrieval hit and executed `write:ledger` against the *wrong* account. The grant was valid; the intent binding was gone. The tell was in the audit log: the elevation request and the write were separated by a checkpoint event, and the write's parameters did not match the parameters recorded in the elevation request. Nothing in the AAIF grant schema expressed "this grant authorizes *this specific write*," only "this grant authorizes writes to `ledger`." ## Condition of Validity The invariant that must hold: **a JIT elevation grant is valid only within the same reasoning episode that minted it, and an episode boundary is any checkpoint, process restart, context truncation, or handoff to another instance.** Formally, the grant must be bound to an episode identifier that the resumed instance cannot fabricate, and the resumed instance must re-request elevation if its episode ID differs from the grant's. Two conditions make this enforceable: 1. The elevation request embeds an `intent_hash` — a digest over the tool name, the exact parameter set the agent intends to submit, and the reasoning step index that justified it. The grant carries this hash. 2. On execution, the policy engine recomputes the hash over the actual call parameters and rejects on mismatch. This catches the re-derived-parameter case above even without episode tracking. Episode binding alone is insufficient because a resumed instance can legitimately continue the same logical task; the intent hash is what actually bounds the grant to the *specific action*, not the session. ## Decision Boundary The decision an implementer faces: bind grants to intent (hash over parameters) or bind to episode (checkpoint lineage) or both. Binding to episode alone fails when a resumed instance correctly reconstructs intent but the grant was minted for a different action in the prior episode. Binding to intent alone fails when an agent legitimately needs the same tool with the same parameters across a resume — the hash matches, but the *justification* (why this write is warranted) may have been invalidated by state changes during the downtime. The correct boundary is: **intent hash is mandatory and sufficient for execution authorization; episode lineage is mandatory for re-justification.** A resumed instance may execute a grant whose intent hash matches the call, but if the episode changed, it must re-run the justification step (re-confirm the duplicate charge still exists) before the hash is allowed to match. In practice: on resume, invalidate all JIT grants, force re-request, and let the re-request recompute the intent hash against current state. The cost is one extra tool round-trip per resume; the alternative is silent misdirected writes. ## Operational Effect The operational consequence is that **checkpoint frequency becomes a security parameter**. Every checkpoint is an episode boundary, and every episode boundary is a forced grant re-request. Teams that checkpoint aggressively for resilience (every tool call) multiply elevation round-trips and may hit rate limits on the authorization service; teams that checkpoint rarely leave long windows in which a resumed instance holds an orphaned grant. The tuning knob is not "how often to checkpoint" but "which checkpoints constitute episode boundaries" — a checkpoint taken *within* a single tool-call sequence need not invalidate grants, while a checkpoint taken *between* reasoning steps must. The guardrail: the orchestrator, not the agent, marks checkpoints as `episode_preserving` or `episode_breaking`. An `episode_breaking` checkpoint revokes all JIT grants held by the instance before serializing state. The agent cannot override this, because the agent is the component whose intent binding is in question. ```python import hashlib import json from dataclasses import dataclass from typing import Optional class OrphanedElevationError(RuntimeError): """Raised when a JIT grant is presented outside its originating episode or against parameters that do not match the grant's intent hash.""" pass @dataclass(frozen=True) class JitGrant: principal: str tool: str scope: str episode_id: str intent_hash: str expiry_epoch: int def compute_intent_hash(tool: str, params: dict) -> str: canonical = json.dumps({"tool": tool, "params": params}, sort_keys=True) return hashlib.sha256(canonical.encode()).hexdigest() def authorize_execution( grant: Optional[JitGrant], current_episode_id: str, tool: str, params: dict, now_epoch: int, ) -> None: if grant is None: raise OrphanedElevationError("no elevation grant present at execution time") if now_epoch >= grant.expiry_epoch: raise OrphanedElevationError( f"grant expired at {grant.expiry_epoch}, now {now_epoch}" ) if grant.episode_id != current_episode_id: raise OrphanedElevationError( f"grant minted in episode {grant.episode_id!r} but presented in " f"episode {current_episode_id!r}; resume boundary orphaned the intent" ) if grant.tool != tool or grant.scope != tool: raise OrphanedElevationError( f"grant tool/scope {grant.tool}/{grant.scope} does not cover {tool}" ) expected = compute_intent_hash(tool, params) if expected != grant.intent_hash: raise OrphanedElevationError( "intent hash mismatch: resumed instance re-derived parameters that " "diverge from the elevation request's justification" ) def resume_with_grants( carried_grants: list[JitGrant], new_episode_id: str, checkpoint_kind: str, ) -> list[JitGrant]: if checkpoint_kind == "episode_breaking": # Revoke all JIT grants; force re-request against current state. return [] if checkpoint_kind == "episode_preserving": # Re-stamp grants into the continuing episode only if already bound to it. survivors = [g for g in carried_grants if g.episode_id == new_episode_id] return survivors raise OrphanedElevationError(f"unknown checkpoint kind {checkpoint_kind!r}") ```