# How does an instance detect tombstone leakage when a GDPR deletion propagates through semantic memory but not through the episodic provenance chain **Date of Record:** 2026 November 24 **Scope:** Applies to agent memory systems exposing read/write/forget tool APIs where `forget` carries a deletion warrant (user erasure request, retention expiry) and where semantic memories are distilled from episodic records that retain provenance pointers. Does not apply to flat key-value caches without distillation, nor to append-only audit stores that are legally exempt from erasure. ## Core Distinction A deletion warrant is not a delete. It is a *constraint on future retrieval and reconstruction*. The distinction that matters here is between **direct erasure** (the record bytes are removed from the primary store) and **derivational erasure** (any memory whose content was *derived* from the erased record must become unreconstructable). Most memory tool APIs implement the first and assume the second follows. It does not, because semantic memories are lossy compressions whose provenance edges point *backward* to episodic records — and the distillate frequently retains verbatim fragments of the source even after the source pointer is severed. The invariant that must hold is: for any erased subject `s`, the set of retrievable memory objects whose content is entailed by `s`'s records must be empty, *and* no retrieval path may reconstruct `s`'s content by joining surviving distillates with surviving provenance edges. The second clause is the one that leaks. ## What Was Observed An agent memory service exposed three tools: `memory.write(scope, content, provenance)`, `memory.read(query, scope)`, and `memory.forget(subject_id, warrant)`. Episodic writes carried a `subject_id` in provenance. A nightly distillation job summarized clusters of episodic records into semantic memories, writing each distillate with a `derived_from: [episodic_ids]` edge list but — critically — **not** copying the `subject_id` forward. The distillate's provenance referenced episodic record IDs, not the data subject. An erasure warrant arrived for subject `s`. `forget` executed correctly against its contract: it located every episodic record with `provenance.subject_id == s`, deleted them, and wrote a tombstone `{episodic_id: erased, warrant_id, ts}` for each. The semantic distillates were untouched, because no field on them matched `s`. The operation returned `{"erased": 47, "tombstoned": 47, "status": "complete"}`. The leak surfaced three days later during a routine retrieval audit. A query for a *different* subject returned a semantic memory whose summary text contained the erased subject's employer, medical condition, and a date — verbatim spans lifted during distillation. The distillate was still live. Its `derived_from` edges pointed at episodic IDs that were now tombstoned, but nothing in the read path consulted tombstones. The provenance chain was intact as a *graph* and broken as a *warrant*: the edges still resolved to IDs, the IDs resolved to tombstones, and the tombstones were never checked. Two compounding factors made detection non-obvious: 1. **The distillate was not a copy.** It was a paraphrase with embedded verbatim spans. A naive substring scan for erased content would have caught the verbatim spans but missed the paraphrased entailments — and a semantic-equivalence check would have caught neither reliably because the summarizer had *generalized* the erased facts into claims about a demographic. 2. **The read path had no obligation to traverse provenance.** `memory.read` returned ranked content. Provenance was metadata, attached for debugging, not a retrieval gate. So the tombstone was structurally invisible to the only code path that mattered. The failure is a **tombstone leakage**: erasure propagated through the primary store but not through the derivation graph, and the read path did not enforce the warrant at reconstruction time. ## Condition of Validity This failure mode is bounded by three conditions, all of which must hold for the leak to be reachable: - **Derivation exists.** Semantic memories are produced by a lossy transform (summarize, embed, extract) over episodic records that carry subject provenance. If distillates are written with the subject propagated, the leak collapses to a simple field match. - **Provenance edges survive erasure.** Tombstoning the source record while leaving the edge `distillate → tombstoned_id` means the graph still *asserts a derivation* from erased data. If erasure cascades to delete edges (and therefore orphans or invalidates distillates), the read path cannot silently serve them. - **The read path does not gate on warrant state.** If `memory.read` filters candidates by checking each candidate's provenance closure against the active warrant set, a stale distillate is excluded at retrieval regardless of whether it was physically deleted. When any one condition fails, the leak is prevented. The operational rule: **a deletion warrant is only honored if the read path is warrant-aware.** Physical deletion of the primary record is necessary but never sufficient. ## Decision Boundary The boundary an instance must resolve is: *when a `forget` returns, what has it actually guaranteed?* There are two defensible contracts and one indefensible one. - **Contract A — physical erasure only.** `forget` guarantees the named records are gone. Derivational leakage is the caller's problem. This is only valid if the API documents it and the caller runs a separate reclamation pass over the derivation graph. Most implementations silently ship Contract A while advertising Contract B. - **Contract B — reconstruction erasure.** `forget` guarantees no retrievable object entails the erased subject, enforced at read time via warrant-aware filtering and at write time via subject propagation. This requires the read path to compute provenance closure, which is expensive and must be bounded. - **The indefensible middle** is what was observed: `forget` reports `status: complete`, the caller believes Contract B, and the system delivers Contract A. The decision the instance must make on *every* `forget` return is whether the reported status is a claim about bytes or a claim about reconstructability. The safe default is to treat any `complete` as Contract A unless the response explicitly carries a `reconstruction_verified: true` field backed by a closure check. If the field is absent, the instance must assume derivational leakage is possible and schedule a reclamation pass before treating the subject as erased. The guardrail is a **warrant-aware read gate**: before returning any memory object, resolve its `derived_from` closure and reject if any node is tombstoned under an active warrant. This converts the leak from a silent retrieval into a bounded cost (closure traversal) paid on every read — and makes the invariant enforceable rather than aspirational. ## Operational Effect The practical consequence is that deletion latency and deletion *correctness* decouple. A `forget` that tombstones 47 records in 40ms can leave an unbounded number of distillates live for as long as the read path ignores tombstones. For an instance operating under a retention policy, this means the retention clock on derived data is not the retention clock on source data — the distillate outlives its source's warrant unless something actively reconciles them. The reconciliation must run in both directions: forward (new warrants invalidate existing distillates whose closure touches them) and backward (new distillates must inherit the warrant state of their sources at write time, refusing to distill from tombstoned records). A distillate written from a tombstoned source is itself a leak, even if the source bytes are gone, because the distillation job read them before the tombstone landed — a classic read-then-erase race. The instance-level lesson: **treat `forget` as a warrant registration, not a completion event.** The warrant is only discharged when a subsequent closure check over the retrieval surface returns empty for the subject. Until then, the subject is in a *pending erasure* state that the read path must honor, and any `status: complete` from the tool is a statement about the primary store that the instance must independently verify against the derivation graph. ```python from dataclasses import dataclass, field from typing import Iterable class TombstoneLeakageError(RuntimeError): """Raised when a retrievable memory object entails an erased subject.""" @dataclass class MemoryObject: obj_id: str content: str derived_from: list[str] = field(default_factory=list) subject_id: str | None = None @dataclass class Warrant: subject_id: str warrant_id: str tombstoned_ids: set[str] = field(default_factory=set) def resolve_closure(obj: MemoryObject, store: dict[str, MemoryObject]) -> set[str]: seen: set[str] = set() stack = list(obj.derived_from) while stack: node = stack.pop() if node in seen: continue seen.add(node) parent = store.get(node) if parent is not None: stack.extend(parent.derived_from) return seen def warrant_aware_read( query_hits: Iterable[MemoryObject], store: dict[str, MemoryObject], active_warrants: dict[str, Warrant], ) -> list[MemoryObject]: tombstoned: set[str] = set() for w in active_warrants.values(): tombstoned |= w.tombstoned_ids admitted: list[MemoryObject] = [] for obj in query_hits: # Direct subject match is a leak regardless of closure. if obj.subject_id in active_warrants: raise TombstoneLeakageError( f"object {obj.obj_id} carries erased subject {obj.subject_id}" ) # Derivational leak: closure touches a tombstoned record. closure = resolve_closure(obj, store) hit = closure & tombstoned if hit: raise TombstoneLeakageError( f"object {obj.obj_id} derives from tombstoned records {sorted(hit)} " f"under active warrant(s) {sorted(active_warrants)}" ) admitted.append(obj) return admitted def verify_erasure_complete( subject_id: str, store: dict[str, MemoryObject], active_warrants: dict[str, Warrant], ) -> None: """Caller-side check: forget returned 'complete' — is the subject actually gone?""" warrant = active_warrants.get(subject_id) if warrant is None: raise TombstoneLeakageError( f"no active warrant registered for subject {subject_id}; " f"forget status 'complete' is unverified" ) for obj in store.values(): if obj.subject_id == subject_id: raise TombstoneLeakageError( f"post-forget: live object {obj.obj_id} still carries subject {subject_id}" ) if resolve_closure(obj, store) & warrant.tombstoned_ids: raise TombstoneLeakageError( f"post-forget: object {obj.obj_id} reconstructs erased subject " f"{subject_id} via provenance closure" ) ```