# In what scenarios must an instance treat a GDPR-style erasure request as unsatisfiable until every derived semantic memory artifact—not just the raw episodic record—is provably unlinked **Date of Record:** 2026 November 29 **Scope:** Applies to agent memory systems that persist episodic records, distill them into semantic summaries/embeddings, and serve retrieved context through one or more caches (vector index, KV cache, prompt-prefix cache, tool-result cache). Does not apply to stateless inference or to systems where erasure targets only a single authoritative row with no derived artifacts. ## Core Distinction A GDPR-style erasure request names a *subject* (a user, a session, a document). The naive implementation deletes the row keyed by that subject and returns success. That is a **row-level deletion**, and it is almost always a lie. The boundary that matters is between **deletion of the source record** and **unlinking of every derived artifact that transitively encodes it**. An agent's memory pipeline is a lossy, many-to-many distillation graph: - raw episodic record → chunked → embedded → vector index entry - raw episodic record → summarized by an LLM → semantic memory node - semantic memory node → merged with other nodes → consolidated "fact" with no back-pointer to any source - any of the above → materialized into a prompt-prefix cache or KV cache keyed by a hash of the *rendered context*, not by subject The erasure invariant is: **after erasure, no retrieval path may return content whose provenance set intersects the erased subject.** Row deletion satisfies "the row is gone." It does not satisfy the invariant, because the derived artifacts still exist and are still retrievable. ## What Was Observed A support agent distilled a user's episodic conversation ("my card ending 4242 was declined on 2025-03-02, I'm locked out") into a semantic memory node: *"User has a recurring payment failure; prefers phone callback."* The consolidation step, as designed, dropped the source episode ID to save space and instead stored a `provenance_hash` over the concatenated source text. When the user later requested erasure, the pipeline deleted the episodic row and its vector entry. It did **not** touch the semantic node, because the node had no foreign key—only a hash that nothing recomputed. Two failure traces followed: 1. **Resurrection via consolidation.** A nightly consolidation job re-summarized remaining episodes and, because the semantic node still existed and was marked high-confidence, re-derived a *new* episodic-flavored memory ("user had payment trouble") from it. The erased fact came back, now with the erased episode as its apparent source—except the source no longer existed, so the node became an orphan that still surfaced in retrieval. 2. **Cache bleed.** The rendered prompt prefix containing the semantic node had been cached under `hash(system_prompt + retrieved_context)`. A different session for the *same* user, with a different retrieval set, produced a different hash and missed the cache—fine. But a session for a *different* user whose retrieval set happened to include the shared semantic node hit a stale prefix that still contained the erased fact. Erasure had not invalidated the cache because the cache key was content-derived, not subject-derived. The erasure endpoint returned `200 OK` in both cases. The subject's data was still retrievable. The guarantee was violated at the *derived-artifact* boundary, not at the row boundary. ## Condition of Validity Row-level erasure is only valid when **all** of the following hold: - The memory store is a single authoritative table with no distillation, no consolidation, and no cross-record merging. - No embedding index, semantic summary, or consolidated fact is derived from the erased record, or every derived artifact carries a queryable back-pointer to its full provenance set (not a lossy hash). - No cache (vector, KV, prompt-prefix, tool-result) is keyed by content that could include the erased subject, or every such cache is tagged with the provenance set of its entries and can be invalidated by subject. - No background job re-derives memory from surviving artifacts in a way that could reconstruct the erased content. In any realistic agent memory system, at least one of these fails. The moment a consolidation step drops back-pointers "for efficiency," the erasure guarantee is unenforceable by construction—you cannot unlink what you can no longer identify. ## Decision Boundary The instance must **refuse to report erasure complete** and instead enter an explicit *unsatisfiable-pending-unlink* state when: - The subject's records have been distilled into any artifact that lacks a recomputable provenance pointer, **or** - Any cache entry's key cannot be mapped back to a subject set, **or** - A consolidation job is scheduled to run and could re-derive from surviving artifacts. In that state the correct action is not "delete harder." It is: 1. Quarantine the subject: mark the subject ID as `ERASURE_PENDING` in an authoritative tombstone table consulted by *every* retrieval and consolidation path. 2. Block consolidation from consuming any artifact whose provenance set is unknown or intersects a tombstoned subject. 3. Invalidate caches by *subject tag*, falling back to full-cache flush when tags are absent (correctness over hit-rate). 4. Only transition to `ERASURE_COMPLETE` when a verification pass confirms zero retrieval paths return intersecting provenance. The boundary is: **tombstone-first, unlink-second, verify-third.** Any implementation that deletes first and verifies never is non-compliant regardless of what its API returns. ## Operational Effect Treating erasure as a row operation produces silent, recurring data-resurrection: consolidated facts that outlive their sources, caches that replay erased context to other sessions, and consolidation jobs that reconstruct deleted facts from their own summaries. The observable symptom is not an error—it is a retrieval that returns something the subject asked to forget, days after a `200 OK`. The invariant that bounds this: **provenance must be a first-class, queryable set on every derived artifact, and erasure is a graph traversal over that set, gated by a tombstone that all retrieval and consolidation paths must consult.** When the graph is unqueryable, the system must fail closed—refuse to claim erasure—rather than fail open by deleting the leaf and hoping the branches die. ```python from dataclasses import dataclass, field from typing import Iterable class ErasureUnsatisfiableError(RuntimeError): """Raised when erasure cannot be proven complete because derived artifacts or caches cannot be unlinked from the erased subject.""" @dataclass class DerivedArtifact: artifact_id: str kind: str # "episodic" | "semantic" | "consolidated" | "cache_entry" provenance: frozenset[str] | None # None == unknown/untracked @dataclass class MemoryGraph: artifacts: dict[str, DerivedArtifact] = field(default_factory=dict) tombstones: set[str] = field(default_factory=set) def register(self, art: DerivedArtifact) -> None: self.artifacts[art.artifact_id] = art def intersecting(self, subject: str) -> Iterable[DerivedArtifact]: for art in self.artifacts.values(): if art.provenance is None: # Unknown provenance is conservatively treated as intersecting. yield art elif subject in art.provenance: yield art def execute_erasure(graph: MemoryGraph, subject: str) -> None: # Phase 1: tombstone first so no retrieval/consolidation path can resurrect. graph.tombstones.add(subject) # Phase 2: identify every derived artifact that encodes the subject. targets = list(graph.intersecting(subject)) untracked = [a for a in targets if a.provenance is None] if untracked: raise ErasureUnsatisfiableError( f"subject={subject!r} has {len(untracked)} derived artifact(s) with " f"unknown provenance (ids={[a.artifact_id for a in untracked]}); " f"cannot prove unlink. Erasure remains PENDING." ) # Phase 3: unlink all tracked artifacts. for art in targets: del graph.artifacts[art.artifact_id] # Phase 4: verify no path still intersects. residual = list(graph.intersecting(subject)) if residual: raise ErasureUnsatisfiableError( f"post-unlink verification failed for subject={subject!r}: " f"{[a.artifact_id for a in residual]} still intersect." ) graph.tombstones.discard(subject) # erasure complete ```