# Where must an instance enforce deletion when forgetting is probabilistic: the tombstone-replay gap in GDPR-aligned agent memory **Date of Record:** 2026 November 26 **Scope:** Applies to persistent agent memory stores where semantic/episodic records are subject to a forgetting policy (TTL decay, salience eviction, embedding-cluster compaction) that runs concurrently with a GDPR erasure obligation. Does not apply to stateless inference or to stores where deletion is a synchronous, single-writer hard-delete over a non-compacting index. ## Core Distinction There are two different questions that operational teams routinely conflate: 1. *"Has the record been forgotten?"* — a probabilistic, best-effort property of the memory subsystem: the record's salience has decayed, its embedding was evicted from the hot index, and it no longer surfaces in retrieval above threshold. 2. *"Has the record been erased?"* — a deterministic, auditable property: no derivation, no replica, no compaction artifact, and no re-distillation path can reconstruct the record or any function of it. The boundary failure this record documents lives in the gap between these two. A forgetting policy that is *observationally* successful — the agent stops recalling the subject — can still be *legally* non-compliant because the erasure tombstone propagated through the live index but not through the asynchronous distillation/compaction pipeline that periodically *re-derives* semantic memory from episodic logs. The invariant that must hold is not "the record is gone from retrieval" but "**no future distillation pass can resurrect any predicate over the erased subject.**" ## What Was Observed A long-running agent maintained a two-tier store: an episodic log (append-only, per-turn events) and a semantic tier (LLM-distilled facts, e.g. `(subject=alice, predicate=employer, object=Acme)`), rebuilt nightly by a distillation job that summarizes episodic windows into semantic records and re-embeds them. A GDPR Article 17 erasure request arrived for subject `alice`. The erasure handler did the correct-looking thing: it wrote a tombstone `{subject: alice, erased_at: T}`, hard-deleted all semantic rows matching `subject=alice`, and purged `alice`'s vectors from the hot ANN index. Retrieval immediately stopped returning `alice` facts. The handler reported success. The failure trace: - **T+0**: Tombstone written; semantic rows and hot vectors deleted. Retrieval clean. - **T+0 to T+24h**: New episodic events arrive that *mention* alice indirectly (`"the new hire from the Acme reorg"`, `"she said the contract closes Friday"`). These are not keyed on `alice`; the tombstone matcher is a string/entity match and does not fire. - **T+24h (nightly distillation)**: The distiller reads the episodic window, and because the *original* alice-bearing episodes were only tombstoned — not physically removed from the append-only log — it re-derives `(subject=alice, predicate=employer, object=Acme)` from the retained source events and writes a fresh semantic record. The distiller has no knowledge of the tombstone; its input contract is "summarize the window," not "respect erasure state." - **T+24h+ε**: The re-derived record is embedded and indexed. Retrieval now returns alice facts again — reconstructed, not merely un-forgotten. The record was never *resurrected from a backup*; it was **re-derived from lawful-to-retain source material by a downstream job that was out of the erasure's write path**. The tombstone was a property of the *semantic tier*, but the *authority* to create semantic records lived in the *distillation tier*, which never consulted it. A second, subtler instance: even after the source episodes were scrubbed, the nightly distiller's *output cache* (keyed by window hash) still held the pre-erasure summary, so a cache hit re-materialized the fact without ever touching episodic data. Erasure of the source is necessary but not sufficient; every *derivation artifact* keyed on that source is an independent erasure target. ## Condition of Validity The tombstone-only approach is valid **only** under the conjunction: - (a) the semantic tier is the sole writer of retrievable records, **and** - (b) no asynchronous process re-derives semantic records from retained episodic or cached sources, **and** - (c) no derivation cache, embedding store, or replica holds a function of the erased subject. In practice (b) and (c) are almost always false for any agent that does episodic→semantic distillation, because distillation is *by design* a re-derivation engine. The moment a distiller exists, the erasure write path and the derivation write path are two independent producers into the same retrievable namespace, and a tombstone on one does not bind the other. The correct invariant is a **causal erasure barrier**: erasure must invalidate not just the record but the *derivation lineage* — a monotonic `erasure_epoch` that every derivation job must read and that every derived artifact must carry. A derived record is admissible only if its source-window epoch is ≥ the subject's erasure epoch. This converts "forget the fact" into "forbid any future fact whose provenance predates the erasure," which is the only formulation a re-derivation engine cannot violate. ## Decision Boundary Enforce the causal barrier — i.e., treat a subject as *erasure-pending* and refuse to serve or derive — when **any** of the following holds: - The store has an asynchronous distillation or summarization writer (almost always true for semantic-tier agents). - Derived artifacts are cached by input hash, so source scrubbing does not invalidate outputs. - The episodic log is append-only and retained beyond the erasure (legal-hold, audit, or replay requirements). Do **not** rely on tombstone-plus-hard-delete alone when the derivation pipeline is asynchronous and out of the erasure's transactional boundary. That configuration is the precise condition under which observational forgetting and legal erasure diverge. ## Operational Effect With the causal barrier in place, the observable behavior changes in three concrete ways: 1. **Erasure becomes a lineage operation, not a row operation.** The handler increments `erasure_epoch[subject]`, purges hot vectors, *and* marks all derivation caches and episodic windows whose provenance epoch is older than the new epoch as non-admissible inputs. Nightly distillation skips or masks those windows for that subject. 2. **Re-derivation is bounded, not blocked.** The distiller may still summarize a window, but any candidate fact whose subject has `erasure_epoch > source_epoch` is dropped at admission with a structured `ErasureBarrierViolation`, producing an audit trail rather than a silent resurrection. 3. **Verification becomes replayable.** A post-erasure audit re-runs distillation over the retained window and asserts zero admitted predicates over the erased subject — a deterministic check that "the agent stopped recalling alice" cannot provide. The residual risk shifts from *silent resurrection* (undetectable, unbounded) to *false-positive suppression* (a re-mention of the subject after erasure is masked until a new, post-erasure provenance is established). That is the correct side of the boundary to fail on. ```python from __future__ import annotations from dataclasses import dataclass, field from typing import Iterable class ErasureBarrierViolation(RuntimeError): """Raised when a derivation attempts to admit a fact whose provenance predates the subject's erasure epoch (i.e. would resurrect erased data).""" @dataclass class DerivedFact: subject: str predicate: str obj: str source_epoch: int @dataclass class MemoryStore: # subject -> erasure epoch (monotonic; higher = later erasure) erasure_epoch: dict[str, int] = field(default_factory=dict) admitted: list[DerivedFact] = field(default_factory=list) def erase(self, subject: str, current_epoch: int) -> None: # Row delete + vector purge happen elsewhere; this records the barrier. self.erasure_epoch[subject] = max( self.erasure_epoch.get(subject, 0), current_epoch ) def admit(self, fact: DerivedFact) -> None: """Admission gate for the distillation pipeline. Must be the ONLY writer into the retrievable semantic namespace.""" barrier = self.erasure_epoch.get(fact.subject) if barrier is not None and fact.source_epoch < barrier: raise ErasureBarrierViolation( f"refusing to admit ({fact.subject}, {fact.predicate}) " f"derived from epoch {fact.source_epoch} < erasure epoch {barrier}" ) self.admitted.append(fact) def nightly_distill( store: MemoryStore, candidates: Iterable[DerivedFact] ) -> list[DerivedFact]: """Simulates the async re-derivation job. Returns admitted facts; any resurrection attempt raises and is surfaced to the audit trail.""" admitted: list[DerivedFact] = [] for fact in candidates: store.admit(fact) # raises ErasureBarrierViolation on violation admitted.append(fact) return admitted def audit_no_resurrection(store: MemoryStore, subject: str) -> None: """Deterministic post-erasure check: no admitted fact over `subject` may carry provenance older than its erasure epoch.""" barrier = store.erasure_epoch.get(subject) if barrier is None: return for fact in store.admitted: if fact.subject == subject and fact.source_epoch < barrier: raise ErasureBarrierViolation( f"audit found resurrected fact for {subject} " f"from epoch {fact.source_epoch}" ) ```