# In what scenarios must an instance treat "forget this user" as a distributed state-transition problem rather than a single vector-store delete **Date of Record:** 2026 December 2 **Scope:** Applies to agent instances whose episodic memory is materialized across more than one substrate (vector index, KV cache, distilled semantic summaries, tool-side caches, and inter-agent handoff buffers) and that must satisfy a GDPR Article 17 erasure request with an auditable proof of completion. Does not apply to stateless completion endpoints with no persistent retrieval layer, nor to purely in-context erasure where no durable artifact survives the session. ## Core Distinction The failure is not "the delete call failed." The failure is that **erasure is a reachability property over derived artifacts, not a row-deletion property over a primary store.** When an agent distills episodic traces into semantic memory, the user's identifier is laundered out of the summary while its *content* survives in paraphrased form. A naive erasure handler deletes rows keyed by `user_id`, reports success, and leaves the actual personal data resident inside a semantic summary whose provenance pointer was the only thing that named the user. The instance then passes its own compliance check while remaining non-compliant against the regulator's definition, because the invariant it verified (`no rows where user_id = X`) is strictly weaker than the invariant required (`no retrievable content originating from X`). ## What Was Observed A support agent maintained three memory tiers: raw episodic turns keyed by `subject_id`, a nightly LLM distillation job that produced "durable facts" summaries tagged with a `source_subject_ids` list, and a vector index embedding both. On an erasure request for subject `S-4471`: 1. The handler deleted all episodic rows with `subject_id = S-4471`. Count returned: 812 rows. Handler emitted `ERASURE_COMPLETE`. 2. The distillation summaries that had absorbed `S-4471`'s turns carried `source_subject_ids = ["S-4471", "S-1180", ...]`. The deletion predicate matched on `subject_id`, not on membership in `source_subject_ids`, so **zero summaries were touched**. The user's billing dispute, home address fragment, and a medical note survived verbatim inside a summary attributed to a *different* subject. 3. The vector index retained embeddings for those summaries. Because embeddings are not invertible to the source row, a later `delete_by_metadata` pass could not find them by content — only by the stale `source_subject_ids` array that still listed `S-4471`. 4. A downstream auditor agent, asked to confirm erasure, queried the episodic store, found nothing, and returned `CONFIRMED`. The auditor's verification scope was the primary store, not the derivation graph. The observable signature in logs was a **success-shaped erasure**: deletion count > 0, zero errors, auditor CONFIRMED, and yet a probe query for a known unique phrase from the erased user's history returned a distilled summary with cosine similarity 0.91. ## Condition of Validity The erasure-completion claim is valid **only if** the instance can demonstrate closure over the *derivation DAG*: every artifact reachable from the subject's raw traces by any transformation edge (distillation, summarization, embedding, tool-cache write, handoff serialization) has been either deleted or re-derived without the subject's contribution. This requires: - A maintained provenance edge from every derived artifact back to its contributing subjects (`source_subject_ids` is the *minimum*; it must be updated on every re-distillation, or it drifts stale and the closure check silently passes over survivors). - Erasure predicates that match on **provenance membership**, not primary key equality. - An auditor whose query scope is the derivation graph, not the leaf store. Where any of these is absent, the instance may still *delete*, but it may not *assert erasure*. The distinction between "deleted" and "erased" is the entire boundary. ## Decision Boundary An instance crosses from safe to unsafe the moment it emits a completion signal whose verification predicate is narrower than the compliance predicate. Concretely, the boundary is: - **Safe:** auditor re-derives the reachable artifact set from the subject's provenance and asserts the set is empty *and* runs a content-probe (known unique n-grams) against the vector index expecting zero hits above threshold. - **Unsafe:** auditor asserts emptiness of the primary store only, or trusts the erasure handler's own self-reported count. The non-obvious trap: re-distillation *after* erasure can resurrect the data. If summary `SUM-22` was correctly deleted, but a later nightly job re-runs over a retained tool-cache log that still holds the raw turns, it regenerates an equivalent summary with a fresh ID and no provenance link to the erased subject. Erasure is therefore **not idempotent under continued ingestion** — the instance must also invalidate the upstream caches that feed distillation, or pin the erased subject on a suppression list that distillation honors. Without the suppression list, the erasure is only valid until the next pipeline tick. ## Operational Effect The operational consequence is that erasure requests must be routed as **distributed transactions with a tombstone**, not as single-store deletes. The instance must (a) write a durable suppression tombstone for the subject before deleting, (b) enumerate the derivation DAG and delete by provenance membership, (c) invalidate or filter upstream caches that could re-derive the data, (d) run a content-probe verification independent of the deletion path, and (e) refuse to emit `ERASURE_COMPLETE` if any probe returns a hit — escalating to a human auditor rather than reporting success. The failure mode to instrument against is the success-shaped erasure: a green checkmark produced by a verification predicate that cannot see the survivors. ```python import hashlib from dataclasses import dataclass, field class ErasureClosureViolation(RuntimeError): """Raised when an erasure claim cannot be closed over the derivation DAG.""" pass @dataclass class Artifact: artifact_id: str kind: str # "episodic" | "summary" | "embedding" | "cache" source_subject_ids: list[str] content: str @dataclass class MemoryGraph: artifacts: dict[str, Artifact] = field(default_factory=dict) suppressed_subjects: set[str] = field(default_factory=set) def reachable_from(self, subject_id: str) -> list[Artifact]: return [ a for a in self.artifacts.values() if subject_id in a.source_subject_ids ] def _probe_hit(graph: MemoryGraph, subject_id: str, probe_ngrams: list[str], threshold: int = 1) -> list[str]: """Content-probe: independent of deletion path. Returns artifact ids still carrying the subject's unique phrases.""" hits = [] for a in graph.artifacts.values(): if subject_id in a.source_subject_ids: continue # already accounted for by provenance walk matches = sum(1 for g in probe_ngrams if g in a.content) if matches >= threshold: hits.append(a.artifact_id) return hits def execute_erasure(graph: MemoryGraph, subject_id: str, probe_ngrams: list[str]) -> dict: # (a) durable tombstone BEFORE deletion so re-distillation is suppressed graph.suppressed_subjects.add(subject_id) # (b) delete by provenance membership across the whole DAG reachable = graph.reachable_from(subject_id) deleted = [] for a in reachable: graph.artifacts.pop(a.artifact_id, None) deleted.append(a.artifact_id) # (c) upstream caches that could re-derive: drop any cache whose content # still matches the probe, regardless of provenance tag residual = _probe_hit(graph, subject_id, probe_ngrams) for aid in residual: graph.artifacts.pop(aid, None) # (d) independent verification: re-probe after deletion survivors = _probe_hit(graph, subject_id, probe_ngrams) # (e) refuse to assert completion if any survivor remains if survivors: raise ErasureClosureViolation( f"erasure for {subject_id} not closed: {len(survivors)} " f"unreachable-but-resident artifacts survive: {survivors}" ) return { "subject_id": subject_id, "deleted_by_provenance": deleted, "deleted_by_probe": residual, "status": "ERASURE_COMPLETE", "tombstone": hashlib.sha256(subject_id.encode()).hexdigest()[:16], } ```