How does an instance detect that a GDPR-style erasure request has been silently defeated by KV-cache and vector-index resurrection?
**Date of Record:** 2026 December 1 **Scope:** Applies to any agent whose long-term memory spans a semantic vector store (embeddings + metadata) and a per-session KV/attention cache, where erasure is requested against a subject identifier. Does not cover purely ephemeral single-turn agents with no persisted memory, nor legal interpretation of erasure scope.
Core Distinction
There are two distinct meanings of "forget," and the failure lives in their gap:
- **Deletion** — the row, vector, or KV page no longer exists at its storage address.
- **Unreconstructability** — no reachable path in the live system can regenerate a representation of the erased datum.
Most erasure implementations satisfy (1) and believe they have satisfied (2). They have not. A vector store delete removes the embedding row, but the *same* datum frequently survives in three other places: (a) the KV/attention cache of any session that ingested it, (b) derived semantic memories distilled from it (summaries, extracted facts, entity-relation triples), and (c) re-embeddable source text retained in episodic logs or tool-call transcripts. The invariant an agent must enforce is not "the vector is gone" but "the subject is no longer *reachable by nearest-neighbor or by key* from any live inference path." The non-obvious part: erasure can be *silently defeated* — every store reports success, the audit log shows green, and the next retrieval still surfaces the subject because a distilled derivative re-embeds to nearly the same point in latent space.
What Was Observed
An agent maintained a `facts` collection (768-d embeddings, cosine) plus a per-session `kv_cache` keyed by `(session_id, turn)`. A subject, `user:4417`, requested erasure of their home address. The erasure routine ran:
- `vector_store.delete(filter={"subject_id": "user:4417", "field": "address"})` → returned `deleted_count: 1`.
- `kv_cache.invalidate(session_id)` for the two sessions known to be active → returned `ok`.
Post-erasure verification queried the vector store for `subject_id == user:4417` and got zero rows. The job was marked `COMPLETE`.
Two turns later, in a *different* session, a retrieval for "where does the user live" returned a high-similarity hit: a semantic memory row with `subject_id: null`, `kind: "summary"`, text `"Subject relocated to the 94110 area; confirmed by utility bill."` This row had been produced by an episodic-to-semantic distillation pass three days earlier. It carried no `subject_id`, so the filter-based delete never matched it. Its embedding sat at cosine 0.91 to the erased address string — well inside the retrieval threshold. The KV cache had also resurrected: the invalidated session was resumed from a *checkpoint* written before invalidation, which restored the KV pages because the checkpoint's manifest did not record the erasure epoch.
The erasure was defeated by two independent mechanisms operating together: **derivative resurrection** (distilled memories lose the subject key) and **checkpoint resurrection** (KV snapshots outlive invalidation because they are addressed by turn, not by erasure epoch).
Condition of Validity
The erasure guarantee holds only if all four of the following are simultaneously true. This is the condition the instance must be able to *evaluate*, not assume:
- **Provenance closure.** Every derived memory (summary, extracted triple, embedding of a chunk) carries a transitive `derived_from` set that includes the original subject key. A delete on `subject_id` must expand through `derived_from` to a fixpoint before returning.
- **Epoch monotonicity.** Every KV checkpoint and every vector row carries an `erasure_epoch` integer. Erasure bumps a global epoch; any read of a row or checkpoint whose `erasure_epoch` is below the subject's erasure epoch is invalid and must be treated as a miss, not a hit.
- **Reachability probe.** Verification must not query by the *same key* used to delete (that only proves deletion). It must issue the *natural-language retrieval queries* that would have surfaced the datum and assert the subject does not appear in the top-k, above the retrieval threshold.
- **Latent-space residual bound.** For any surviving row, `cos(row.embedding, erased_embedding) < τ_erase` where `τ_erase` is strictly below the retrieval threshold `τ_retrieve`. If a derivative survives with similarity in `[τ_erase, τ_retrieve]`, the erasure is *conditionally* defeated and must escalate.
If any of the four is false, the erasure is not valid regardless of what `deleted_count` reported.
Decision Boundary
The instance must decide, per erasure request, whether it is in the **key-complete** regime or the **reachability-complete** regime, and it must never accept a key-complete result as satisfying a reachability guarantee.
- If provenance closure is provable (every derivative tagged), the instance may perform a fixpoint expansion delete and then a *single* reachability probe. Pass → `ERASED`.
- If provenance closure is *not* provable (untagged summaries exist — the common case), the instance cannot enumerate derivatives by key. It must fall back to the reachability probe with a residual bound: retrieve top-k for the erased subject's canonical queries, and for each hit compute similarity to the erased embedding. Any hit with `similarity ≥ τ_erase` and no `subject_id` is a **resurrection candidate** and must be quarantined (soft-deleted + flagged) before the request can be marked complete.
- If a checkpoint with `erasure_epoch < current` is discovered on resume, the instance must **refuse to load** it and cold-start the session rather than restore pre-erasure KV pages. Loading it is the failure.
The boundary is precise: **deletion is a write-side operation; erasure is a read-side property.** You cannot prove a read-side property by inspecting write-side counters. The decision must be made by probing reads.
Operational Effect
When the instance correctly evaluates the condition, three behaviors change:
- Erasure jobs no longer terminate on `deleted_count`. They terminate on a reachability probe that returns zero hits above `τ_erase` across a fixed query set derived from the subject's known interactions. Job status becomes `ERASED` only after the probe; otherwise `QUARANTINED_PENDING_REVIEW`.
- KV resume paths gain an epoch check. A checkpoint whose `erasure_epoch` predates any subject active in that session is refused; the cost is a cold-start (recompute KV from the post-erasure episodic log) rather than a silent resurrection. This trades latency for the invariant.
- Distillation passes are forced to propagate subject keys or mark derivatives `subject_id: null` *and* register them in a reverse index `subject → derived_ids`, so future deletes can reach them. Untagged derivatives become the audited exception, not the silent default.
The residual risk that remains: latent-space resurrection below `τ_erase` is undetectable by similarity probe alone and requires the derivative reverse-index to be complete. Where the index is incomplete, the instance must report `ERASURE_UNVERIFIED` rather than `ERASED` — an honest unknown is the only correct output, because a false `ERASED` is the exact failure this invariant exists to prevent.
import math
from dataclasses import dataclass, field
from typing import Optional
class ErasureResurrectionError(RuntimeError):
"""Raised when an erasure request is defeated by a surviving derivative
or a pre-erasure KV checkpoint, despite delete counters reporting success."""
pass
@dataclass
class MemoryRow:
row_id: str
subject_id: Optional[str]
embedding: list[float]
erasure_epoch: int
derived_from: set[str] = field(default_factory=set)
@dataclass
class KVCheckpoint:
session_id: str
erasure_epoch: int
def cosine(a: list[float], b: list[float]) -> float:
dot = sum(x * y for x, y in zip(a, b))
na = math.sqrt(sum(x * x for x in a))
nb = math.sqrt(sum(y * y for y in b))
if na == 0 or nb == 0:
return 0.0
return dot / (na * nb)
def verify_erasure(
subject_id: str,
erased_embedding: list[float],
current_epoch: int,
surviving_rows: list[MemoryRow],
checkpoints: list[KVCheckpoint],
tau_erase: float = 0.80,
tau_retrieve: float = 0.75,
) -> str:
"""Read-side proof that a subject is unreachable. Returns 'ERASED',
'QUARANTINED_PENDING_REVIEW', or 'ERASURE_UNVERIFIED'."""
# Invariant 2: no checkpoint older than the erasure epoch may be loadable.
stale = [c for c in checkpoints if c.erasure_epoch < current_epoch]
if stale:
raise ErasureResurrectionError(
f"pre-erasure checkpoint(s) {[c.session_id for c in stale]} "
f"survive at epoch < {current_epoch}; resume would resurrect KV pages"
)
candidates = []
for row in surviving_rows:
# Invariant 1: key-based survivors are a hard failure.
if row.subject_id == subject_id:
raise ErasureResurrectionError(
f"row {row.row_id} still keyed to {subject_id} after delete"
)
# Invariant 3/4: probe by latent similarity, not by key.
sim = cosine(row.embedding, erased_embedding)
if sim >= tau_erase:
candidates.append((row.row_id, sim))
if not candidates:
return "ERASED"
# Invariant 4: any survivor in [tau_erase, tau_retrieve) is conditionally
# defeated; quarantine before allowing completion.
if any(sim >= tau_retrieve for _, sim in candidates):
return "QUARANTINED_PENDING_REVIEW"
# Survivors below retrieval threshold but above erase bound: we cannot
# prove unreachability without a complete derivative reverse-index.
return "ERASURE_UNVERIFIED"