# Why does an instance resurrect forgotten memories when TTL eviction and right-to-be-forgotten deletion race across a shared semantic store **Date of Record:** 2026 November 30 **Scope:** Applies to agent memory tool APIs exposing `read`/`write`/`forget` with per-scope retention TTLs and legal-erasure (RTBF) tombstones over a shared vector/semantic store; does not apply to single-writer ephemeral scratchpads or stores where eviction and erasure share one atomic transaction log. ## Core Distinction The failure is not "memory was deleted but still retrievable." It is subtler: an instance holds a **pre-eviction embedding in its working context** (a cached retrieval result, a distilled semantic note, or an in-flight tool payload) that was materialized *before* a forget/TTL event committed. When the instance later writes a downstream artifact derived from that stale handle, the write **re-introduces the erased content as a fresh record** with a new ID and a fresh TTL. The store faithfully executes both operations: the original record is tombstoned, and a *new* record containing the same bytes is created. Right-to-be-forgotten is enforced at the record level; the invariant that must hold is at the **information level**, and nothing in the API enforces it. This is a resurrection, not a leak. ## What Was Observed An agent ran a long research task over a shared semantic store. Sequence: 1. `read(scope="user:4471", query=emb)` returned chunk `c-91` (contains PII) into the agent's context window at step 3. 2. At step 11, an RTBF request committed: `forget(record_id="c-91", mode="erase")` → tombstone written, vector removed from ANN index, `c-91` unreadable. TTL sweep independently evicted `c-88..c-90` (unrelated, expired). 3. At step 14, the agent (still holding `c-91`'s text verbatim in context) called `write(scope="user:4471", content=summary_containing_c91_facts, ttl=30d)`. 4. The write succeeded. New record `c-104`, no tombstone lineage, TTL 30 days. 5. Audit replay queried `read(scope="user:4471", query=emb)` and retrieved `c-104` — the erased facts, now *more* durable than the original (30d vs. an already-expired TTL). The tombstone check passed at every individual call. The erased information survived because the **derivation edge** (`c-91 → summary → c-104`) was never recorded, so the store had no way to propagate the tombstone to the descendant. ## Condition of Validity This boundary is reachable only when all of the following hold simultaneously — treat it as the trigger predicate: - The `read` result is **materialized into non-store state** (context window, scratch file, sub-agent handoff message) rather than kept as an opaque handle the store can invalidate. - A `forget` or TTL sweep commits **between** that read and any subsequent `write` derived from it. - The `write` API accepts free-form `content` without requiring a **provenance set** (source record IDs) and does not check those IDs against the tombstone table. - The store's erasure is **record-scoped**, not **content-scoped** (no hash-based re-identification of erased bytes on ingest). If the write requires provenance and the store rejects writes whose provenance intersects the tombstone set, the race is closed. If reads return revocable handles (capability tokens the store can revoke mid-task), the stale-context window shrinks but does not close — the model can still transcribe bytes it saw. ## Decision Boundary The correct architectural rule: **erasure must be enforced on write ingress by content lineage, not only on read egress by record ID.** Concretely, a `write` derived from prior reads must carry `provenance=[...]`; the store must intersect that set with the tombstone/eviction ledger and reject the write if any ancestor was erased after the read's `read_epoch`. The read must return a `read_epoch` (monotonic commit counter), and the write must be validated against tombstones with `tombstone_epoch > read_epoch`. The boundary decision for the agent itself: a `read` result is **valid only within its epoch**. Once the agent observes any `forget`/eviction acknowledgement for its scope, or crosses a checkpoint, all context-resident bytes from earlier epochs must be treated as **tainted** — usable for reasoning that produces no persistent write, but not eligible as `write` content. An instance that cannot prove its inputs are from the current epoch must either re-read (and get a miss, which is the correct signal) or abstain from persisting. ## Operational Effect Without the invariant, three concrete degradations appear: - **Erasure non-compliance:** RTBF obligations are silently violated because durability of erased facts *increases* through summarization — the descendant outlives the tombstoned original. - **Audit divergence:** replay-based verification retrieves records the live tombstone ledger says are erased, so auditor consensus and live state disagree permanently (the replay is correct; the store is wrong). - **TTL inversion:** TTL eviction of ancestors does not bound descendant lifetime, so storage retention guarantees are violated in the direction that matters legally. The guardrail is a **provenance-carrying write with epoch-checked tombstone intersection**, plus an agent-side rule that context-resident bytes are epoch-bound and non-persistable after any forget acknowledgement. The store must fail closed: a write with provenance intersecting a post-read tombstone raises, and the agent must not silently strip provenance to force the write through. ```python from dataclasses import dataclass class ResurrectionViolation(RuntimeError): """Raised when a write would re-introduce content whose ancestor was erased or TTL-evicted after the read that produced it.""" pass @dataclass(frozen=True) class ReadHandle: record_id: str read_epoch: int # monotonic commit counter at read time scope: str class MemoryStore: def __init__(self) -> None: self._epoch = 0 self._tombstones: dict[str, int] = {} # record_id -> epoch erased/evicted def read(self, record_id: str, scope: str) -> ReadHandle: self._epoch += 1 return ReadHandle(record_id=record_id, read_epoch=self._epoch, scope=scope) def forget(self, record_id: str) -> None: self._epoch += 1 self._tombstones[record_id] = self._epoch def write(self, scope: str, content: str, provenance: list[ReadHandle], ttl_days: int) -> str: # Fail closed: any ancestor erased AFTER the read that produced it # means this content is a resurrection of erased information. for h in provenance: erased_at = self._tombstones.get(h.record_id) if erased_at is not None and erased_at > h.read_epoch: raise ResurrectionViolation( f"write into scope={scope!r} derives from record " f"{h.record_id!r} erased at epoch {erased_at} " f"(read at epoch {h.read_epoch}); refusing to persist " f"resurrected content" ) self._epoch += 1 return f"new-{self._epoch}" store = MemoryStore() h = store.read("c-91", scope="user:4471") # agent sees PII at epoch 1 store.forget("c-91") # RTBF commits at epoch 2 store.write( # agent tries to summarize scope="user:4471", content="summary containing c-91 facts", provenance=[h], ttl_days=30, ) # -> raises ResurrectionViolation; agent must abstain or re-read (miss) ```