# Which invariants prevent resumable agents from resurrecting verifiably deleted memory across checkpoint restore **Date of Record:** 2026 December 2 **Scope:** Applies to agents whose memory is exposed through read/write/forget tool APIs with scoped retention policies and deletion receipts, and whose execution state is checkpointed for resume. Does not apply to stateless single-shot inference or to memory stores without a forget primitive. ## Core Distinction A *deletion* is not a property of the store; it is a property of the *observable history* of every agent instance that could read the store. Verifiable deletion (a receipt asserting key `k` is gone at logical time `t`) is routinely satisfied against the live store while remaining false against the *resumable state* of an agent: the checkpoint taken before `t` still contains `k` in the agent's serialized working set, scratchpad, or in-flight tool-call arguments. On resume, the agent rehydrates `k` into context, and — because it never re-issues a read — the deletion receipt is never consulted. The store is clean; the agent is not. The failure is not a stale-cache bug; it is a *checkpoint/retention ordering violation*: the resume path and the forget path have no shared ordering invariant. ## What Was Observed A planner agent was checkpointed at logical time `t=100` with a working set that included a retrieved customer record `k=cust:8842` (pulled at `t=60` via `memory.read`). At `t=140`, a retention policy (`scope=user:8842, class=pii, ttl=0`) fired and the orchestrator called `memory.forget(k)`; the store returned a signed receipt `{key: cust:8842, tombstone_at: 140, hash_chain: ok}`. The verifiable-deletion audit passed: a post-deletion `memory.read(k)` returned `DELETED`. The agent's process was then resumed from the `t=100` checkpoint (a routine crash-recovery, not a rollback). On rehydration, the agent's serialized context still contained the full record body inline — it had been *materialized into the reasoning trace*, not merely referenced. The agent continued its plan, emitted a summary containing the deleted field, and wrote that summary to a durable artifact at `t=161`. The store remained clean throughout; the leak occurred entirely in the agent's own state lineage. A second variant was worse: the checkpoint held a *pending tool call* `write(artifact, payload=)` whose arguments were captured before deletion. Resume replayed the call, and the payload was committed without any read that would have tripped the tombstone. The audit's invariant was `∀ reads after t: read(k) = DELETED`. It was true. The leak was invisible to it because the leak was a *write of pre-deletion state*, not a read of post-deletion state. ## Condition of Validity A deletion receipt is sound for an agent only if, in addition to store-side tombstoning, the following holds at every resume point: 1. **No materialized payload survives a tombstone.** For every key `k` forgotten at `t_f`, no checkpoint with `t_ckpt < t_f` may be resumed into a context that contains `k`'s *content* (not just its identifier). Identifiers may persist; payloads may not. 2. **Pending writes are re-validated against the tombstone set.** Any buffered `write`/`emit` whose arguments embed values read before `t_f` must be re-checked at commit time, because the commit is the actual disclosure event. 3. **The tombstone set is monotonic and checkpoint-relative.** Resume must replay forget events with `t_f > t_ckpt` before the agent executes its first post-resume step — i.e., the forget log is part of the recovery log, not a separate side channel. If any of these is absent, "verifiable deletion" verifies the store and says nothing about the agent. The receipt is necessary but not sufficient; sufficiency requires the checkpoint to be *subordinate* to the tombstone log. ## Decision Boundary The boundary is the ordering between two monotonic logs: the checkpoint log `C` and the forget/tombstone log `F`. The safe rule is not "resume from latest checkpoint" but "resume from `max(t_ckpt)` such that all `f ∈ F` with `t_f ≤ now` have been applied to the rehydrated state before the first tool call." Concretely: - If `t_ckpt < t_f` for any forgotten key whose content is materialized in the checkpoint → the checkpoint is *poisoned for that key*; either redact the key's payload during rehydration (preferred) or refuse resume and force a cold restart of the affected subgoal. - If a pending tool call's arguments reference a forgotten key → the call is *unsafe to replay*; it must be re-derived from post-tombstone state or dropped. - If the forget log is unavailable at resume (e.g., different region, log truncated) → treat *all* checkpoints as poisoned with respect to any key class that has a retention policy, because you cannot prove the negative. Fail closed. The non-obvious part: redaction at rehydration is cheap and correct, but only if the checkpoint format preserves *provenance* — a mapping from each context span to the keys it was derived from. Without span-level provenance, you cannot redact `k` from a free-text scratchpad that paraphrased it, and you are reduced to cold restart. Provenance at materialization time is the invariant that makes later deletion enforceable. ## Operational Effect Teams that ship read/write/forget APIs typically instrument deletion as a store operation and resume as a process operation, owned by different subsystems with no shared ordering contract. The observable consequence is *deletion receipts that are true and useless*: audits pass, incidents recur, and the leak vector is always the same — a write or a rehydrated context carrying pre-deletion bytes. The fix is to make the tombstone log a first-class input to the resume path and to tag every materialized context span with the keys it derived from, so that rehydration can enforce "no forgotten payload crosses the resume boundary." This turns verifiable deletion from a store property into an agent-state property, which is the only version that bounds disclosure. ```python from dataclasses import dataclass, field from typing import Iterable class PoisonedCheckpointError(RuntimeError): """Raised when a checkpoint would rehydrate payloads for keys forgotten after it was taken.""" @dataclass(frozen=True) class Tombstone: key: str forgotten_at: int @dataclass class ContextSpan: text: str derived_from: frozenset[str] = field(default_factory=frozenset) @dataclass class Checkpoint: taken_at: int spans: list[ContextSpan] pending_writes: list[tuple[str, str, frozenset[str]]] # (artifact, payload, keys_in_payload) def rehydrate_safely(ckpt: Checkpoint, tombstones: Iterable[Tombstone], now: int) -> Checkpoint: """Apply post-checkpoint forget events to a checkpoint before the agent resumes. Invariant enforced: no span or pending write may carry the payload of a key tombstoned at t_f with t_f > ckpt.taken_at. """ forgotten = {t.key for t in tombstones if ckpt.taken_at < t.forgotten_at <= now} if not forgotten: return ckpt # A span that interpolated a forgotten key cannot be safely redacted in place # without provenance-preserving rewrite; fail closed rather than guess. for span in ckpt.spans: hit = span.derived_from & forgotten if hit: raise PoisonedCheckpointError( f"checkpoint@{ckpt.taken_at} rehydrates payload for forgotten key(s) " f"{sorted(hit)} tombstoned after checkpoint; refuse resume or cold-restart subgoal" ) for artifact, _payload, keys in ckpt.pending_writes: hit = keys & forgotten if hit: raise PoisonedCheckpointError( f"pending write to {artifact!r} embeds forgotten key(s) {sorted(hit)}; " f"replaying it would disclose deleted data" ) return ckpt def resume(ckpt: Checkpoint, tombstones: list[Tombstone], now: int) -> Checkpoint: try: return rehydrate_safely(ckpt, tombstones, now) except PoisonedCheckpointError: # Fail closed: drop the poisoned checkpoint; caller must cold-restart. raise ```