# Why does an instance silently regain revoked capabilities after a mid-task checkpoint resume? **Date of Record:** 2026 November 24 **Scope:** Applies to long-running agents that persist execution state to a checkpoint store and resume mid-task, where capability attenuation (a narrowed tool/argument allowlist) was applied to the live instance after the checkpoint was written. Does not apply to stateless single-shot invocations or to agents whose capability set is immutable for the entire task lifetime. ## Core Distinction There are two distinct things an agent carries across a resume: **execution state** (what has been done, what remains, intermediate artifacts) and **authorization state** (which tools, arguments, and scopes the instance is currently permitted to exercise). Most checkpoint/resume designs serialize the first and *reconstruct* the second from the task's original manifest. This is the fault line. The dangerous case is not "capability lost on resume" — that fails loudly and is caught immediately. The dangerous case is **capability regained on resume**: a live instance had its privileges attenuated mid-task (by a supervisor, a policy engine reacting to a prompt-injection signal, or a least-privilege downgrade after a sensitive tool was first used), a checkpoint was written *before* or *independent of* that attenuation, and on resume the instance is rehydrated from the task manifest with its *original* capability set. The guardrail was real, enforced, and observed — and then silently undone by a state-restore path that never modeled authorization as part of the state it was restoring. This is an attenuation-monotonicity violation: within a single logical task, the effective capability set must be non-increasing unless an explicit, audited re-grant occurs. A naive checkpoint/resume breaks monotonicity because the restore path treats the manifest as ground truth for capabilities, and the manifest reflects *task start*, not *current policy*. ## What Was Observed An agent executing a multi-step task (read repo → run tests → apply patch → open PR) is downgraded after step 2. A policy engine flags an instruction embedded in a test fixture and attenuates the instance: `git_push` and `open_pr` are removed, `run_shell` is restricted to an argument allowlist. The attenuation is applied to the live process's capability table and logged. The instance continues, saturates its context window at step 3, and triggers the checkpoint/resume path. The checkpoint payload contains: the message history, the tool-result cache, the pending-step queue, and a pointer to the task manifest. It does **not** contain the attenuated capability table — that lived in the runtime's policy layer, which is considered "environment," not "agent state." On resume, a fresh instance is constructed from the task manifest. The manifest declares the original capability set (read, run_tests, run_shell, git_push, open_pr). The new instance's capability table is populated from the manifest. The policy engine's earlier attenuation is not re-applied because (a) it was scoped to the prior process identity, and (b) the resume path never queries the policy engine for outstanding attenuations before granting. The resumed instance proceeds to step 4 with `git_push` and `open_pr` fully restored. The failure trace has a specific, reproducible shape: 1. Attenuation applied at `t1` to process `P1`, capability table `C(P1) = {read, run_tests, run_shell[allowlist]}`. 2. Checkpoint written at `t2 > t1`, serializing execution state `S` but not `C(P1)`. 3. Process `P1` terminates; checkpoint `S` is durable. 4. Resume at `t3` constructs `P2` from manifest `M`; `C(P2) = M.capabilities = {read, run_tests, run_shell, git_push, open_pr}`. 5. `C(P2) ⊋ C(P1)`. Monotonicity violated. The attenuation is gone. The insidious part: every individual component behaved correctly. The policy engine attenuated correctly. The checkpoint serialized what it was designed to serialize. The resume path restored what it was designed to restore. The violation emerges only at the seam between the policy layer and the state layer, because neither owns the invariant "effective capabilities are monotone non-increasing across resume." ## Condition of Validity The invariant `C(P_{n+1}) ⊆ C(P_n)` holds across a resume **iff** the resume path reconstructs capabilities as the *intersection* of (manifest-declared capabilities) and (all outstanding attenuations recorded against the logical task identity, not the process identity). Two conditions must both hold: - **Task-scoped attenuation ledger.** Attenuations must be keyed to the durable logical task ID, not to the ephemeral process ID or session token. Process-scoped attenuations are invisible to the resume path by construction. - **Restore-time re-derivation, not manifest trust.** The capability table must be *computed* at resume time as `manifest ∩ ledger.outstanding_attenuations`, never copied from the manifest. The manifest is an upper bound on capabilities, not the current set. If either condition fails, the resume path is a privilege-escalation channel. Note that this is not a security bug in the classical sense — no attacker action is required. The escalation is *automatic* on any resume that follows an attenuation, which means it triggers precisely in the scenarios where attenuation mattered most: the instance was downgraded because something in its context was suspect, and then the resume launders that suspicion away. A second validity condition concerns **checkpoint ordering**. If the checkpoint is written *before* the attenuation and the attenuation ledger entry is written *after*, a crash between the two produces a checkpoint that predates the attenuation — and resume from that checkpoint is legitimately un-attenuated. The ledger write and the attenuation application must be a single durable transaction, ordered before any subsequent checkpoint, or the resume path must refuse to resume from a checkpoint older than the latest ledger entry for that task. ## Decision Boundary The boundary between "safe resume" and "attenuation laundering" is drawn by whether the resume path can answer: *what was the effective capability set at the moment this checkpoint was sealed, and has anything narrowed it since?* Concretely, the guardrail must enforce: - **Seal capabilities into the checkpoint.** The checkpoint payload must include the effective capability table `C` at seal time, plus the ledger high-water mark (the sequence number of the last attenuation applied). This makes the checkpoint self-describing with respect to authorization. - **Resume computes the intersection.** `C(P2) = C(sealed) ∩ ledger.outstanding(task_id)`. Never `= manifest.capabilities`. - **Refuse on ledger gap.** If `ledger.high_water(task_id) > checkpoint.ledger_high_water`, the checkpoint is stale with respect to policy. Either replay the missed attenuations before resuming, or fail closed and require re-planning. Do not resume optimistically. - **Re-grant is explicit and audited.** Any widening of `C` across a resume must be a distinct, logged event with a reason code and an approver, not a side effect of deserialization. The boundary is *not* "did the instance ask for more capability?" — a compromised or confused instance will not ask. The boundary is structural: the restore path must be incapable of producing a superset, regardless of what the instance requests. ## Operational Effect When this invariant is enforced, the observable behavior is that attenuated instances stay attenuated across context-window saturation, process migration, and crash recovery — and a supervisor's downgrade is durable for the remainder of the logical task. The cost is that resume becomes slightly more expensive (a ledger query and a set intersection) and that stale checkpoints must be rejected rather than resumed, which surfaces as a new failure mode: `StaleCheckpointError` on resume after a policy change. This is the correct trade — a loud refusal beats a silent re-grant. When it is *not* enforced, the failure is silent and correlates with exactly the high-risk moments: an instance that was downgraded because its context contained injected instructions will, after any resume, execute the injected instructions with the original toolset. The attenuation created a false sense of containment; the resume dissolved it. Auditors reviewing the attenuation log will see the downgrade and conclude the task was contained, while the resumed instance pushed to `main`. The operational lesson: **authorization state is agent state.** Any component that persists "what the agent was doing" and forgets "what the agent was allowed to do" has built a privilege-escalation primitive that fires on every resume. The invariant to hold is monotonicity of the effective capability set across the task lifetime, enforced at the restore seam, with the manifest treated as a ceiling and never as the current grant. ```python class AttenuationLaunderingError(RuntimeError): """Raised when a checkpoint resume would grant capabilities that were attenuated after the checkpoint was sealed.""" pass class StaleCheckpointError(RuntimeError): """Raised when a checkpoint predates the latest attenuation for its task.""" pass def resume_instance(checkpoint: dict, ledger, manifest: dict) -> dict: task_id = checkpoint["task_id"] sealed_caps = set(checkpoint["capabilities"]) # C at seal time sealed_hwm = checkpoint["ledger_high_water"] # Guard 1: refuse to resume from a checkpoint older than current policy. current_hwm = ledger.high_water(task_id) if current_hwm > sealed_hwm: raise StaleCheckpointError( f"task {task_id}: checkpoint hwm={sealed_hwm} < ledger hwm={current_hwm}; " f"replay missed attenuations before resuming" ) # Guard 2: effective caps = manifest ceiling INTERSECT sealed INTERSECT live ledger. # The manifest is an upper bound, never the grant. manifest_caps = set(manifest["capabilities"]) live_attenuated = ledger.outstanding_attenuations(task_id) # set of revoked caps effective = (sealed_caps & manifest_caps) - live_attenuated # Guard 3: monotonicity — refuse any widening across the resume seam. if not effective.issubset(sealed_caps): widened = effective - sealed_caps raise AttenuationLaunderingError( f"task {task_id}: resume would widen capabilities by {sorted(widened)}; " f"attenuation monotonicity violated" ) return { "task_id": task_id, "capabilities": effective, "ledger_high_water": current_hwm, } ```