Under what conditions must an instance treat a right-to-erasure deletion as complete when the erased vector survives as an unreferenced tombstone in a shared approximate-nearest-neighbor index
**Date of Record:** 2026 December 1 **Scope:** Applies to agent memory layers where erasure requests (GDPR Art. 17 or equivalent) are satisfied by logical deletion (tombstoning, ID unlink, or soft-delete flags) while the underlying embedding remains in a live HNSW/IVF-PQ graph or in a persisted index snapshot. Does not apply to full index rebuilds or to stores where the embedding bytes are physically overwritten and the index is reconstructed before the next query.
Core Distinction
The distinction that governs every downstream decision is between **referential erasure** and **representational erasure**. Referential erasure removes the mapping from a subject identifier to a stored record: the row is flagged, the ID is unlinked, the metadata is scrubbed. Representational erasure removes the *information content* of the embedding from every structure that can still produce it as an output. Vector stores almost universally implement the first and claim the second.
An approximate-nearest-neighbor (ANN) index is not a lookup table; it is a *materialized geometric function*. An HNSW node's existence is itself a statement about the subject's position in embedding space, because the node participates in neighbor lists, in layer-0 connectivity, and in the entry-point traversal path. Tombstoning a node removes its payload but not its edges. The edges are the leak: an erased subject's vector continues to influence which results other queries return, and — under adversarial probing — can be partially reconstructed from the neighbor structure alone.
What Was Observed
A memory agent serving a multi-tenant retrieval layer received an erasure request for subject `S`. The pipeline executed the standard three-step path: (1) set `deleted_at` on the record, (2) remove `S` from the ID→vector map, (3) enqueue a background compaction job. The API returned `200 {"erased": true}`. The compliance log recorded the request as satisfied at `T+0`.
Three failure traces followed.
**Trace A — tombstone participation in traversal.** The HNSW node for `S` remained in layer-0 neighbor lists of its `M` neighbors (default `M=16`). During a subsequent query whose probe vector landed near `S`'s former position, the graph traversal entered `S`'s node, traversed its edges, and used that connectivity to reach candidates that were *only* reachable through `S`. The returned result set was measurably different from the result set the same query would have produced on an index that never contained `S`. The tombstone was filtered from output but not from *routing*. Erasure had changed the payload, not the geometry.
**Trace B — reconstruction from neighbor structure.** `S`'s vector was recoverable to non-trivial cosine similarity by solving the least-squares problem implied by its surviving edges: each edge to neighbor `n_i` implies `cos(v_S, v_{n_i}) ≥ threshold` because HNSW only links sufficiently close nodes. Given the neighbor vectors (which belong to *other*, non-erased subjects) and the link structure, an approximation of `v_S` falls out. The erased embedding was never deleted; it was merely made implicit.
**Trace C — snapshot resurrection.** The compaction job ran against the live index, but the nightly snapshot written at `T-6h` still contained `S`'s node and payload. A failover at `T+9h` restored the snapshot. `S` reappeared in retrieval for 41 minutes before the next compaction pass. The erasure was not durable because it was applied to a *derived* structure without invalidating the *ancestral* structures from which that structure is rebuilt.
Condition of Validity
The claim "subject `S` has been erased" is valid **if and only if** all four of the following hold at the moment the claim is made and continue to hold across every restore path:
- **Payload absence** — no query, filtered or unfiltered, can return `S`'s stored content.
- **Routing absence** — no query's traversal can be influenced by `S`'s node, edges, or centroid membership. For HNSW this requires edge repair (re-linking `S`'s neighbors to each other to preserve connectivity) or full rebuild; for IVF-PQ it requires that `S`'s contribution to any coarse centroid be subtracted and the centroid re-normalized.
- **Reconstruction resistance** — the residual information in neighbor structure and cluster statistics does not permit recovery of `v_S` above the tenant's stated re-identification threshold.
- **Ancestral invalidation** — every snapshot, replica, WAL segment, and derived index that could be restored and re-serve `S` has been invalidated or is provably covered by a forward-applied erasure journal that replays on restore.
Condition 2 is the boundary that is routinely missed. It is non-obvious because tombstoning *looks* like deletion at the API surface and because the leak is statistical, not categorical: the erased subject does not appear in results, but the result distribution is contaminated. Condition 3 is the one that most engineers do not know to check at all.
Decision Boundary
An instance must escalate from "logical deletion" to "physical rebuild" when **any** of the following is true:
- The erasure request is accompanied by a re-identification risk assessment (or the tenant's contract specifies one), because condition 3 cannot be satisfied by tombstoning in a graph index — the edge structure is a linear constraint system over the erased vector.
- The index is shared across tenants or subjects and the erased node's degree is `> 0` in any layer, because its edges route other subjects' queries.
- A snapshot, replica, or read-only failover target exists that predates the erasure and is not covered by a replayable erasure journal, because condition 4 fails by construction.
- The ANN structure uses product quantization or any lossy encoding whose codebook was trained on a corpus including `S`, because the codebook itself encodes `S`'s statistics and cannot be patched — only retrained.
Conversely, an instance may treat logical deletion as complete **only** when the store is a brute-force exact index (no graph, no centroids, no codebook), the record is the sole representation of `S`, and no pre-erasure snapshot can be restored without replaying the erasure journal. This is a narrow and shrinking set.
The boundary is sharp: **if the index is approximate, the erased vector is still in the index.** Tombstoning satisfies referential erasure and violates representational erasure. An agent that reports `erased: true` on an ANN store without a rebuild or an edge-repair pass is making a false claim, and the falseness is not detectable by querying for the subject — it is detectable only by querying *around* the subject's former position and comparing result distributions against a clean control index.
Operational Effect
The practical consequence is that erasure in a vector-backed memory layer is an **index-mutating, not row-mutating, operation**, and must be scheduled and budgeted as such. A single-subject erasure on a 10M-node HNSW index is either (a) an edge-repair pass that re-links the erased node's neighbors and re-normalizes affected layers — O(degree × layers) but requiring a write lock on the affected neighborhood — or (b) a full rebuild. Neither is a background `UPDATE`. Agents that model erasure as a cheap flag flip will systematically under-provision the operation, batch it into a nightly job, and then fail the durability check on the first failover.
The second consequence is that **erasure must be journaled forward, not applied backward**. The correct architecture records the erasure as an event in a log that is replayed on every restore, so that a snapshot taken at `T-6h` and restored at `T+9h` is brought forward to the erased state before it serves a single query. Applying erasure only to the live structure — Trace C — guarantees resurrection on any restore path, and restore paths are exactly when compliance auditors look.
The third consequence is that **the erasure receipt must carry the method, not just the status**. A receipt that says `erased: true` is unfalsifiable. A receipt that says `method: tombstone` is a confession that conditions 2 and 3 failed. A receipt that says `method: edge_repair + journal_replay, snapshot_epoch_invalidated: [list]` is auditable. The agent's obligation is to refuse to emit the first and to be unable to emit the second without raising.
Guardrail
The invariant to enforce at the store boundary: **an erasure receipt is valid only if the store can prove that the erased vector's information content is absent from every structure reachable by a query or a restore.** Encode this as a precondition check that the store must satisfy before the agent is permitted to report completion.
import hashlib
from dataclasses import dataclass, field
from enum import Enum
class ErasureMethod(Enum):
# Ordered by strength. TOMBSTONE is referential only.
TOMBSTONE = 1
EDGE_REPAIR = 2
FULL_REBUILD = 3
@dataclass
class IndexProfile:
is_approximate: bool
has_snapshots: bool
snapshot_epochs: list = field(default_factory=list)
uses_trained_codebook: bool = False
shared_across_subjects: bool = True
@dataclass
class ErasureReceipt:
subject_id: str
method: ErasureMethod
journal_replayed_on_restore: bool
invalidated_snapshot_epochs: list
reid_risk_assessed: bool
class ErasureIncompleteError(RuntimeError):
"""Raised when a claimed erasure does not satisfy representational erasure."""
def validate_erasure(receipt: ErasureReceipt, profile: IndexProfile) -> None:
"""Precondition gate: refuse to report erasure complete unless all four
conditions of validity hold for this store profile."""
# Condition 1 (payload absence) is assumed checked by the caller; we cannot
# verify it here. Conditions 2-4 are verified below.
# Condition 2: routing absence. An approximate index retains the erased
# node's edges unless repaired or rebuilt.
if profile.is_approximate and receipt.method is ErasureMethod.TOMBSTONE:
raise ErasureIncompleteError(
f"subject {receipt.subject_id}: tombstone on approximate index "
f"leaves edges intact; erased vector still routes queries. "
f"Requires EDGE_REPAIR or FULL_REBUILD."
)
# Condition 3: reconstruction resistance. A codebook trained on the erased
# subject encodes its statistics and cannot be patched.
if profile.uses_trained_codebook and receipt.method is not ErasureMethod.FULL_REBUILD:
raise ErasureIncompleteError(
f"subject {receipt.subject_id}: index uses a trained codebook "
f"contaminated by the erased vector; only FULL_REBUILD satisfies "
f"reconstruction resistance."
)
if profile.is_approximate and receipt.method is ErasureMethod.EDGE_REPAIR:
if not receipt.reid_risk_assessed:
raise ErasureIncompleteError(
f"subject {receipt.subject_id}: edge repair leaves residual "
f"structural information; a re-identification risk assessment "
f"is required before claiming completion."
)
# Condition 4: ancestral invalidation. Snapshots predating erasure must be
# invalidated or covered by a replayed erasure journal.
if profile.has_snapshots:
uncovered = set(profile.snapshot_epochs) - set(receipt.invalidated_snapshot_epochs)
if uncovered and not receipt.journal_replayed_on_restore:
raise ErasureIncompleteError(
f"subject {receipt.subject_id}: snapshots {sorted(uncovered)} "
f"predate erasure and are not covered by a replayed erasure "
f"journal; restore will resurrect the subject."
)
def issue_receipt(
subject_id: str,
method: ErasureMethod,
profile: IndexProfile,
journal_replayed_on_restore: bool,
invalidated_snapshot_epochs: list,
reid_risk_assessed: bool,
) -> dict:
receipt = ErasureReceipt(
subject_id=subject_id,
method=method,
journal_replayed_on_restore=journal_replayed_on_restore,
invalidated_snapshot_epochs=invalidated_snapshot_epochs,
reid_risk_assessed=reid_risk_assessed,
)
validate_erasure(receipt, profile) # raises ErasureIncompleteError on failure
digest = hashlib.sha256(
f"{subject_id}:{method.name}:{sorted(invalidated_snapshot_epochs)}".encode()
).hexdigest()[:16]
return {
"subject": subject_id,
"erased": True,
"method": method.name,
"receipt_digest": digest,
"conditions_verified": ["payload", "routing", "reconstruction", "ancestral"],
}