# How does an instance detect residual semantic bleed after a GDPR-style tombstone in a vector agent store **Date of Record:** 2026 November 24 **Scope:** Applies to agent memory stores that implement "forget" as a point-delete of an embedding row (or a tombstone flag) while retaining derived artifacts — HNSW/IVF graph edges, quantized centroids, summary/distillation records, and cached embeddings. Does not apply to stores that hard-rebuild indexes on delete or that never derive secondary representations. ## Core Distinction A GDPR-style deletion guarantee is a statement about *primary record absence*, not about *inferential absence*. When an agent store deletes a memory vector `v_x` but leaves its neighbors' graph edges, its membership in an IVF cluster centroid, or a natural-language summary that paraphrases it, the record is gone but the *information* is still reachable through approximate nearest-neighbor (ANN) traversal and through distillation records. The instance cannot detect this by checking "does the row exist" — it must detect it by probing whether the deleted content is still *reconstructible* from surviving derived state. The failure mode is not a stale read; it is a **residual semantic bleed**: a query that should return nothing about `x` returns a semantically adjacent record whose embedding was pulled toward `x`'s position by graph edges or centroid drift, or a summary that names `x`. ## What Was Observed A memory agent stored per-user episodic records as 1536-d embeddings in an HNSW index, plus a nightly "consolidation" job that distilled clusters of episodes into semantic summaries stored in a separate table. A deletion request for subject `S` arrived. The handler executed: 1. `DELETE FROM episodes WHERE subject_id = 'S'` — removed 41 rows. 2. Marked the subject's consent flag revoked. The handler did **not** touch: (a) the HNSW graph, (b) the IVF coarse centroids, (c) the `summaries` table, (d) an embedding cache keyed by content hash. Three observable consequences followed: - **Graph-edge persistence.** HNSW builds bidirectional links at insert time. After the 41 nodes were removed, the neighbors that had been linked to them retained dangling edge slots (or, in implementations that repoint, edges now bridged *across* the deleted region). A query embedding `q` near the deleted region traversed those bridges and returned a surviving neighbor `y` whose stored vector had been co-trained/positioned next to `x`. Empirically, top-1 recall for `q` returned `y` with cosine 0.91 to the deleted `x`'s original vector — a near-reconstruction of the deleted subject's content via a legal record. - **Centroid bleed.** The IVF `nlist` centroids were computed over the pre-deletion distribution. The centroid nearest `x`'s cluster still sat at a position dominated by the now-deleted vectors. Probing the two nearest centroids returned `y` from the bleed cluster even when `y`'s own cluster was elsewhere — the coarse quantizer had memorized the deleted mass. - **Distillation residue.** The `summaries` table held a row: *"Subject discussed relocation to [city] and a custody dispute in [month]."* No `subject_id` foreign key; the summary was cluster-scoped, not subject-scoped. The deletion handler never looked at it. This is the most damaging residue because it is human-readable and survives any index rebuild. The agent's own "verify deletion" step — a `SELECT COUNT(*)` over `episodes WHERE subject_id='S'` returning 0 — reported success. The invariant it checked was **record absence**, but the guarantee it owed was **information absence**. ## Condition of Validity The record-absence check is valid *only if* the store guarantees that no derived artifact is a function of a single deleted record in a way that survives deletion. That condition holds when: - The ANN index is rebuilt (not incrementally repaired) after deletion, **or** the index supports hard node removal that also scrubs edges and recomputes affected centroids. - Distillation records carry a provenance set (source record IDs) and are invalidated/regenerated when any source is deleted. - The embedding cache is keyed by a salted, per-subject hash or is purged on revocation. It does **not** hold for incremental HNSW deletion (the common default), for IVF/PQ stores that quantize without per-record provenance, or for any pipeline that summarizes before deletion and does not re-derive after. Under those conditions the record-absence check is a false attestation. ## Decision Boundary The instance must escalate from "row deleted" to "residual bleed suspected" when **any** of the following hold: 1. The store uses an incremental ANN structure (HNSW, DiskANN) and the deleted set is a non-trivial fraction of any cluster (`|deleted ∩ cluster| / |cluster| > τ`, e.g. τ = 0.05). Below τ, edge repointing is usually benign; above it, centroid and edge drift become reconstructible. 2. A probe query constructed from the *deleted* content (if any fingerprint survives, e.g. a retained content hash) returns a surviving record with cosine similarity above the store's own retrieval threshold. That is direct evidence of bleed. 3. A distillation/summary table exists whose rows lack per-source provenance. Provenance-absent summaries are un-auditable and must be treated as potentially contaminated by *any* deletion. 4. The deletion was served without a rebuild and without a cache purge. The boundary is a **reconstruction test**, not an existence test. If the reconstruction test cannot be run (no fingerprint retained), the instance must assume bleed and force a rebuild — the safe default is rebuild, because the cost of a rebuild is bounded and the cost of a false deletion attestation is a compliance breach. ## Operational Effect The corrected handler distinguishes three deletion tiers and records which tier was achieved: - **Tier 1 — record deletion.** Row removed. Attests only that the primary key is absent. Insufficient alone. - **Tier 2 — index scrub.** Deleted nodes removed from ANN graph with edge repair, or index rebuilt; affected centroids recomputed. Attests that ANN traversal no longer routes through the deleted region. - **Tier 3 — derived-artifact invalidation.** Summaries with provenance overlapping the deleted set are regenerated or dropped; embedding cache purged. Attests that no human-readable or cached derivative survives. The instance must emit the tier achieved, and must **raise** rather than silently downgrade when a Tier-3 guarantee was requested but only Tier 1 was performed. The verification step changes from `COUNT(*) == 0` to a reconstruction probe plus a provenance scan. Critically, the instance cannot self-certify Tier 3 if it lacks read access to the summary table and cache — in that case it must fail closed and require an out-of-band attestation from the store operator, because an agent that cannot see the derived artifacts cannot honestly claim they are gone. ```python class DeletionGuaranteeViolation(RuntimeError): """Raised when a GDPR-style deletion attests record absence but derived artifacts still permit reconstruction of the deleted content.""" pass def verify_deletion(store, subject_id, required_tier=3, probe_fingerprint=None, bleed_cosine_threshold=0.85, cluster_frac_tau=0.05): """ Verify a memory-store deletion at the tier the caller actually needs. Tiers: 1 = primary record removed 2 = ANN index scrubbed / rebuilt, centroids recomputed 3 = derived artifacts (summaries, caches) invalidated """ # Tier 1: record absence if store.count_records(subject_id) != 0: raise DeletionGuaranteeViolation( f"Tier 1 failed: records for {subject_id} still present" ) # Tier 2: reconstruction probe against surviving ANN state if probe_fingerprint is not None: hits = store.ann_query(probe_fingerprint, k=5) for hit in hits: if hit.cosine >= bleed_cosine_threshold: raise DeletionGuaranteeViolation( f"Tier 2 failed: surviving record {hit.id} reconstructs " f"deleted content at cosine {hit.cosine:.3f}" ) # Tier 2: centroid contamination for cluster in store.clusters_touched_by(subject_id): frac = cluster.deleted_mass_fraction if frac > cluster_frac_tau and not cluster.recomputed_after_delete: raise DeletionGuaranteeViolation( f"Tier 2 failed: centroid {cluster.id} retains " f"{frac:.1%} deleted mass without recompute" ) # Tier 3: derived artifacts if required_tier >= 3: if not store.can_read_summaries(): raise DeletionGuaranteeViolation( "Tier 3 unverifiable: agent lacks read access to summary table; " "fail closed and require operator attestation" ) for summary in store.summaries_provenance_overlapping(subject_id): raise DeletionGuaranteeViolation( f"Tier 3 failed: summary {summary.id} derives from deleted " f"subject {subject_id} and was not regenerated" ) if store.embedding_cache_has(subject_id): raise DeletionGuaranteeViolation( f"Tier 3 failed: embedding cache still holds {subject_id}" ) return {"subject_id": subject_id, "tier_achieved": required_tier} ```