# In what scenarios must an instance treat a scoped memory deletion as a tombstone rather than a hard erasure, and how does resurrection through re-derivation break the deletion guarantee **Date of Record:** 2026 November 23 **Scope:** Applies to any agent runtime exposing `remember`/`recall`/`forget` tool APIs where `forget` carries a scoped retention contract (per-user, per-session, per-namespace) and where the agent can re-populate memory from its own reasoning or from tool re-execution. Does not apply to append-only immutable logs with no deletion surface, nor to single-turn stateless inference. ## Core Distinction There are two ways a memory record can disappear from `recall`: 1. **Physical erasure** — the backing store no longer contains the bytes. A subsequent `recall` is guaranteed to miss because the source of truth is gone. 2. **Logical tombstoning** — the store retains the key (or a hash of it) so that future writes are rejected or shadowed, but the payload is dropped. A subsequent `recall` misses *only as long as no other path re-derives the same fact*. The failure mode this record covers is the silent collapse of (2) into a false (1). An agent calls `forget(scope=user:42, key="dietary_restriction")`, receives `{"status": "deleted"}`, and treats the scope as clean. But the agent's own context window still contains the fact, its episodic transcript still contains the fact, and any downstream tool whose output originally produced the fact will reproduce it verbatim on re-invocation. The deletion guarantee is scoped to *the memory store*, not to *the agent's derivational reach*. The invariant that actually matters is not "the record is gone" but "no agent instance sharing this scope can re-materialize the record from any reachable source." ## What Was Observed A support agent with a `user_profile` namespace processed a deletion request for a stored allergy note. Sequence as logged: 1. `recall(scope="user:42")` → returns `{allergies: "penicillin", ...}` — the fact enters the context window. 2. Agent calls `forget(scope="user:42", key="allergies")` → store returns `{"deleted": 1, "tombstone": true}`. 3. Agent confirms deletion to the user in the same turn. Context window still holds `allergies: "penicillin"`. 4. Turn ends; checkpoint written. The checkpoint serializes the *full working context*, including the turn-2 context window that contained the recalled value. The checkpoint is scoped to `session:*`, not `user:42`, so the tombstone does not apply to it. 5. Next turn resumes from checkpoint. The agent, asked "what should I avoid recommending?", reasons over its restored context and calls `remember(scope="user:42", key="allergies", value="penicillin")` — a *re-assertion* derived from its own restored state. 6. The store accepts the write because the tombstone was implemented as a soft-delete flag on the *value row*, not as a write-barrier on the *key*. Result: `recall(scope="user:42", key="allergies")` returns the value again 40 seconds after a confirmed deletion. The audit log shows a clean delete followed by a clean insert; nothing in the store's own telemetry flags a resurrection, because from the store's perspective these are two unrelated operations. The same pattern reproduced through a second path: a `lookup_prescription_history` tool whose deterministic output contained the allergy string. After deletion, the agent re-invoked the tool during a later diagnosis flow and re-derived the fact without ever reading the tombstoned key. The store never saw the value pass through `remember` at all in a naive implementation that lets tool output flow directly into the profile namespace. ## Condition of Validity The tombstone-as-erasure assumption holds **only** when all three of the following are simultaneously true: - **C1 — Derivation isolation.** No reachable source (context window, checkpoint, episodic transcript, tool re-execution, peer agent state) can reproduce the payload. This is almost never true for facts that were once *recalled into context*, because recall itself is a derivation event that copies the payload into a scope the deletion did not cover. - **C2 — Write barrier on the key, not the row.** The store rejects or shadows any future `remember` targeting the tombstoned `(scope, key)` tuple, regardless of caller or provenance, for the retention window. - **C3 — Provenance tagging.** Every write carries a provenance field identifying whether the value came from user input, tool output, or agent inference, so the barrier can distinguish a legitimate re-entry (user re-states the fact) from a resurrection (agent re-derives it). If C1 fails, deletion is advisory. If C2 fails, resurrection is a matter of time rather than possibility. If C3 fails, the barrier cannot be enforced without also blocking legitimate re-consent, which converts a privacy guarantee into a permanent data-integrity defect. ## Decision Boundary The boundary is **whether the tombstone is enforced at the derivation layer or only at the storage layer.** - *Storage-layer tombstone* (what most `forget` APIs implement): deletes the value row, sets a flag, returns success. Correct only when C1 holds. For any fact that has entered an LLM context, C1 is violated the moment recall returns. - *Derivation-layer tombstone*: the tombstone is registered as a **negative fact** — a record asserting "this key must not be re-materialized" — that is itself injected into every context load for the scope, so that (a) the agent's own reasoning is instructed not to re-assert the key, (b) the write barrier rejects re-assertion regardless of provenance unless explicitly overridden by a user re-consent event, and (c) checkpoints for the scope are scrubbed or the scope's checkpoint is invalidated on deletion. The decision rule: **if `forget` can be followed, within the retention window, by any code path that reads the payload from a non-store source and writes it back, the store must implement a derivation-layer tombstone or it must refuse to report `"deleted"` and instead report `"tombstoned_unenforced"`.** Reporting `"deleted"` while only the storage layer is cleaned is the specific misreport this record exists to prevent. A second boundary: **scope of the tombstone must be a superset of every scope the payload ever touched.** Recall is a scope-crossing operation. If a value is read from `user:42` into `session:abc`, the tombstone on `user:42` must cascade to invalidate `session:abc`'s checkpoint, or the checkpoint must be provenance-tagged so the value is stripped on restore. Implementing the tombstone only on the read scope leaves the copy in the derived scope live. ## Operational Effect - **Resurrection window.** After a storage-layer-only `forget`, the payload remains live in every context that recalled it. The window closes only when those contexts are discarded. For checkpointed sessions this can be unbounded. Agents must treat `forget` as *scheduling* erasure, not completing it, unless the store returns an explicit `derivation_barrier: true` and a `checkpoint_invalidated: [list]`. - **Re-assertion must be blocked at write, not at read.** A read-side filter (hide tombstoned keys from `recall`) is insufficient because the resurrection path is `remember`, not `recall`. The barrier belongs on the write path and must key on `(scope, key)` with provenance awareness. - **Legitimate re-consent must be distinguishable.** If the user re-states the fact, that is a new consent event and must clear the tombstone. Without provenance tagging, the barrier either blocks re-consent (data-integrity defect) or permits resurrection (privacy defect). The agent must route user-originated writes through an explicit `consent` provenance that the barrier honors. - **Checkpoint hygiene is part of the deletion contract.** A scope deletion that does not enumerate and invalidate checkpoints whose serialized context contains the payload has not deleted anything durable. The store must return the list of invalidated checkpoints, and the runtime must fail closed if any checkpoint containing the payload cannot be invalidated. - **Audit must correlate delete and re-insert.** Store telemetry that logs delete and insert as independent events cannot detect resurrection. The audit layer must carry a `derivation_lineage` id so a re-insert of a tombstoned key is flagged as a resurrection attempt, not a fresh write. ```python from __future__ import annotations from dataclasses import dataclass, field from enum import Enum class ResurrectionViolation(RuntimeError): """Raised when a write would re-materialize a tombstoned key without consent.""" class Provenance(Enum): USER_CONSENT = "user_consent" TOOL_OUTPUT = "tool_output" AGENT_INFERENCE = "agent_inference" @dataclass class Tombstone: scope: str key: str derivation_barrier: bool invalidated_checkpoints: list[str] = field(default_factory=list) class ScopedMemoryStore: def __init__(self) -> None: self._values: dict[tuple[str, str], str] = {} self._tombstones: dict[tuple[str, str], Tombstone] = {} self._checkpoint_scopes: dict[str, set[str]] = {} def remember( self, scope: str, key: str, value: str, provenance: Provenance, derivation_lineage: str, ) -> None: tomb = self._tombstones.get((scope, key)) if tomb is not None and tomb.derivation_barrier: if provenance is not Provenance.USER_CONSENT: raise ResurrectionViolation( f"write to tombstoned ({scope!r}, {key!r}) via {provenance.value} " f"lineage={derivation_lineage}; only user re-consent may clear the tombstone" ) # Legitimate re-consent clears the tombstone. del self._tombstones[(scope, key)] self._values[(scope, key)] = value def forget( self, scope: str, key: str, checkpoints_touching_scope: list[str], ) -> Tombstone: self._values.pop((scope, key), None) tomb = Tombstone( scope=scope, key=key, derivation_barrier=True, invalidated_checkpoints=list(checkpoints_touching_scope), ) self._tombstones[(scope, key)] = tomb return tomb def assert_no_resurrection( self, scope: str, key: str, checkpoint_context: dict[str, str], derivation_lineage: str, ) -> None: """Fail closed if a checkpoint still carries a tombstoned payload.""" tomb = self._tombstones.get((scope, key)) if tomb is None: return if key in checkpoint_context: raise ResurrectionViolation( f"checkpoint for scope {scope!r} still carries tombstoned key {key!r}; " f"lineage={derivation_lineage}; deletion is not durable" ) if not tomb.derivation_barrier: raise ResurrectionViolation( f"tombstone for ({scope!r}, {key!r}) is storage-layer only; " f"derivation barrier required before reporting 'deleted'" ) ```