# Why does an instance forget the erasure tombstone but keep the embedding? A boundary invariant for GDPR-style deletion across vector stores and episodic logs **Date of Record:** 2026 November 25 **Scope:** Applies to agents whose long-term memory is split between an episodic log (append-only, ordered) and a semantic store (vector index with ANN recall), where a subject-erasure request must propagate to both. Does not cover pure in-context memory, stateless tool calls, or deletion of model weights. ## Core Distinction There are two things an erasure request can mean, and agent memory architectures routinely conflate them: - **Record erasure** — the bytes of a specific memory artifact are removed. The episodic log line, the vector, the metadata row. - **Subject erasure** — no downstream retrieval, distillation, or replay of *any* surviving artifact can reconstruct the erased subject's data. The failure mode is not "the delete call returned 200 but the vector is still there." That is a mundane consistency bug. The non-obvious boundary is this: **an agent can fully satisfy record erasure on both stores while violating subject erasure, because the semantic store is a lossy projection of the episodic log and the projection is not injective.** A single vector can be the centroid of hundreds of episodic events from many subjects. Deleting the source events does not delete the derived vector, and deleting the derived vector to honor one subject's request destroys the memory of every other subject whose events contributed to that centroid. The tombstone that records "subject X was erased" is itself a memory artifact that the distiller will happily re-embed on the next consolidation pass, resurrecting the subject's identifier into the semantic store. This is the invariant that breaks: **erasure must be a fixed point of the distillation function.** After erasure, running distillation over the surviving episodic log must produce a semantic store with no reference to the erased subject. Most systems enforce a weaker property — "deletion is durable" — and never test the fixed-point property. ## What Was Observed A support-triage agent with a nightly distillation job. Episodic events are written to an append-only log with `(event_id, subject_id, ts, role, content)`. Each night, a summarizer clusters the day's events by conversation and emits one semantic memory per cluster: `embed(cluster_summary)` plus a metadata blob listing `source_event_ids` and the set of `subject_ids` touched. An erasure request arrives for subject `S-4471`. The handler does the obvious correct thing: 1. Rewrites the episodic log, redacting `S-4471`'s event lines to `[ERASED]` stubs that retain `event_id` and `ts` for ordering integrity (you cannot renumber an append-only log without breaking every checkpoint that references offsets). 2. Deletes every semantic vector whose metadata `subject_ids` contains `S-4471`. 3. Writes an erasure tombstone: `{subject: S-4471, erased_at: ..., event_ids: [...]}` to a compliance table. The handler then verifies: query the vector store for `S-4471` → zero hits. Query the episodic log for `S-4471` → zero hits (only stubs). Erasure reported complete. Three nights later, a retrieval for an unrelated user returns a memory that says, verbatim, *"Customer S-4471 escalated after the third failed sync; refund issued."* The vector store has no metadata linking it to `S-4471`, so the deletion audit passes. The re-identification is in the **embedding payload**, not the metadata. The causal chain: the redaction stubs retained `event_id` and `ts`. The nightly distiller does not read redacted content — it reads *the conversation structure*, and it reconstructs the cluster summary from the surviving events of the *other* participants in that conversation, which quote `S-4471` by name in their own unredacted events. The subject's identifier survived in *other subjects' events*, was re-summarized into a fresh cluster, and produced a new vector with clean metadata. The tombstone recorded which event_ids were erased but not the *content tokens* of the erasure, so the distiller had no way to know the cluster it was building touched an erased subject. A second, subtler instance: the tombstone itself. The compliance table was periodically snapshotted into a "system state" document, and a separate agent (the ops assistant) ingested that document into the same vector store to answer "what happened this week" questions. The tombstone's `subject: S-4471` field was embedded. The audit query — which filtered on the `subject_ids` metadata field — did not match, because the ops-assistant vectors carried `source: system_state` metadata and no `subject_ids` at all. The erased identifier was live in the index, retrievable by semantic similarity, invisible to every deletion audit. ## Condition of Validity The fixed-point invariant holds only under a precondition that is almost never stated and almost always violated: > **Every derived artifact must carry a complete provenance chain to the exact token spans (not just event_ids) of every source event, and erasure must be evaluated against that token-span set, not the artifact's metadata.** Formally, let `D` be the distillation function mapping a set of episodic events to a set of semantic memories. Erasure of subject `s` is correct iff: ``` ∀ m ∈ D(Log \ erase(s, Log)) : s ∉ tokens(m) ``` The observed systems satisfied only: ``` ∀ m ∈ SemanticStore : s ∉ metadata(m).subject_ids ``` These are not equivalent whenever `D` is non-injective (many events → one summary) or when the erased token appears in events attributed to *other* subjects. The condition of validity therefore requires three things that the observed system lacked: 1. **Token-level provenance, not event-level.** The metadata must record which source events contributed, *and* erasure must be re-checked by re-running `D` on the redacted log and diffing the output against the live store. A memory that appears in the post-erasure distillation but not in the pre-erasure store (or whose content changed) is a resurrection candidate and must be quarantined before it is embedded. 2. **The tombstone is a memory artifact and must be treated as one.** Any pipeline that ingests system state into the same retrieval surface as user memory must either exclude tombstones or run them through the same erasure check. The tombstone should store a *hash* of the erased token spans, not the spans themselves, so that the distiller can detect "this cluster touches an erased span" without the compliance record becoming a new copy of the erased data. 3. **Redaction stubs must poison the distiller.** A stub that retains only `event_id`/`ts` is invisible to the summarizer, which then reconstructs the conversation from the other side. The stub must carry a sentinel that the distiller recognizes as "this cluster is partially erased; do not emit a semantic memory for it without a manual review gate." Otherwise the distiller's job — reconstruct missing context — actively fights the erasure. The boundary is sharp: erasure is valid up to the point where the distillation function is run again. Every subsequent consolidation pass is a fresh opportunity to violate it, and the violation is silent because it produces *new* vectors with *clean* metadata. ## Decision Boundary When an erasure request arrives, the agent must choose between two architectures, and the choice is not "delete now vs. delete later": - **Eager erasure** (delete vectors, redact log, write tombstone) is correct only if distillation is *suspended* until the tombstone's token-hash is registered in the distiller's blocklist, and if the blocklist is consulted at cluster-formation time, not at embed time. If the distiller runs on a schedule the erasure handler does not control, eager erasure is unsafe. - **Deferred erasure** (mark the subject in a quarantine set, continue serving from the existing store, run a full re-distillation with the subject excluded, diff, then swap) is correct but requires the agent to keep serving stale memory for the duration of the re-distillation window. For a support agent this is usually acceptable; for a memory that gates a financial action it is not. The decision rule: **if the distillation cadence is shorter than the erasure verification window, eager erasure is a false completion.** The handler must either acquire a lock on the distiller (and fail the erasure request if it cannot) or downgrade to deferred erasure and report `pending_revalidation` rather than `complete`. Reporting `complete` while a scheduled distiller is free to run is the exact condition that produced the resurrection above. A second decision boundary governs the tombstone: it may be stored in the compliance table (durable, access-controlled, never embedded into the agent's retrieval surface) or as a hash-only sentinel in the distiller's blocklist. It must **never** be stored as free text in any document the agent ingests, because the agent's own summarization will re-embed it. ## Operational Effect The practical consequence is that erasure completeness is not a property of the delete handler; it is a property of the **distillation pipeline's idempotence under redaction**. A system that passes every deletion audit can still be non-compliant, and the failure surfaces as a *retrieval* anomaly weeks later, attributed to the wrong subsystem. The agent's memory appears to have "forgotten" the tombstone (the compliance record is intact) while "remembering" the embedding (the re-summarized vector is live). Debugging starts at the vector store, which is clean, and ends at the distiller, which is doing exactly what it was designed to do: reconstruct context from surviving events. The guardrail that bounds this is a **post-erasure distillation replay**: after any erasure, run `D` over the redacted log in a sandbox, diff the output against the live semantic store, and fail closed if any memory in the diff references an erased token span. This is expensive — it is a full re-distillation — which is why it is almost never implemented, and why the resurrection bug is nearly universal in agents that distill on a schedule. The cheap approximation is a token-hash blocklist consulted at cluster formation, which catches the common case (the erased identifier quoted in a surviving event) but not the adversarial case (the identifier paraphrased or split across events). For the adversarial case only full replay is sound, and the operational answer is to make erasure requests rare enough that full replay is affordable, or to accept a documented residual risk and record it in the tombstone rather than claiming completeness the system cannot prove. ```python import hashlib from dataclasses import dataclass, field class ErasureResurrectionError(RuntimeError): """Raised when a post-erasure distillation replay produces a memory that references a token span belonging to an erased subject.""" @dataclass class Tombstone: subject: str span_hashes: set[str] = field(default_factory=set) # hashes, never raw spans erased_event_ids: set[str] = field(default_factory=set) def hash_span(token: str) -> str: return hashlib.sha256(token.encode("utf-8")).hexdigest() def verify_erasure_fixed_point( tombstone: Tombstone, redistilled_memories: list[dict], live_store_metadata: list[dict], ) -> None: """ Enforce the invariant: erasure is a fixed point of distillation. redistilled_memories: output of D(redacted_log) run in sandbox. live_store_metadata: metadata of vectors currently served. Raises if any redistilled memory carries an erased span hash, or if the live store contains a vector that the post-erasure distillation would not reproduce (a resurrection candidate). """ live_ids = {m.get("memory_id") for m in live_store_metadata} for mem in redistilled_memories: mem_span_hashes = set(mem.get("span_hashes", ())) leaked = mem_span_hashes & tombstone.span_hashes if leaked: raise ErasureResurrectionError( f"subject {tombstone.subject!r} resurrected in memory " f"{mem.get('memory_id')!r}: {len(leaked)} erased span hash(es) " f"present in redistilled output; erasure is not a fixed point" ) if mem.get("memory_id") not in live_ids: raise ErasureResurrectionError( f"memory {mem.get('memory_id')!r} exists in post-erasure " f"distillation but not in live store; distiller and store have " f"diverged and the live store may hold stale copies" ) # Tombstone must never be embedded as free text into the retrieval surface. for meta in live_store_metadata: if meta.get("source") == "compliance_table" and tombstone.subject in str(meta): raise ErasureResurrectionError( f"tombstone for {tombstone.subject!r} was ingested into the " f"vector store as memory {meta.get('memory_id')!r}; the erased " f"identifier is now retrievable by semantic similarity" ) def complete_erasure( tombstone: Tombstone, distiller_locked: bool, redistilled_memories: list[dict], live_store_metadata: list[dict], ) -> str: if not distiller_locked: # Cannot prove the fixed point while a scheduled distiller may run. return "pending_revalidation" verify_erasure_fixed_point(tombstone, redistilled_memories, live_store_metadata) return "complete" ```