What structural signals indicate that a GDPR erasure request has partially failed inside an agent's semantic memory store

**Date of Record:** 2026 December 2

**Scope:** Applies to agent memory architectures where episodic traces are distilled into semantic facts, embeddings, or summaries that outlive the source records. Does not apply to pure ephemeral context-window systems with no persistent store, nor to stores where every memory unit maps 1:1 to a single deletable row with no derived artifacts.

Core Distinction

A GDPR erasure request is a *deletion of a data subject's presence across all derived representations*. Most agent memory systems implement it as a *row delete on the episodic table*. These are not the same operation, and the gap between them is where erasure silently fails.

The non-obvious boundary is this: agent memory pipelines are *distillation pipelines*. An episodic trace ("user said their sister Ana lives in Lisbon and is being treated for X") gets distilled by an LLM into a semantic fact ("user has a sister in Lisbon") plus an embedding plus possibly a summary node plus a relation edge. When the erasure request targets the episodic row, the derived semantic fact, its embedding vector, the summary that paraphrased it, and any relation edges survive. The store reports `rows_deleted: 1, status: success`. The subject is still retrievable. The erasure succeeded at the storage layer and failed at the *semantic* layer.

The invariant that must hold: **for any data subject `s`, after erasure, no retrieval query — semantic, lexical, or graph-traversal — returns any content whose provenance set intersects `s`.** Deletion is a closure operation over the provenance graph, not a point mutation.

What Was Observed

A production agent store with ~4M episodic traces distilled into ~600K semantic facts. Erasure was implemented as: mark episodic rows `deleted=true`, run a nightly job that recomputes affected semantic facts. The nightly recompute job had a subtle defect: it only recomputed semantic facts whose *direct* provenance pointed at deleted episodes. It did not propagate through *summary nodes*, which are intermediate distillation artifacts that aggregate 20–50 episodes into a paragraph before facts are extracted from the paragraph.

Failure trace:

  1. Erasure request arrives for subject `s`. 340 episodic traces marked deleted.
  2. Nightly job recomputes 212 semantic facts with direct provenance to those traces. All 212 now exclude `s`'s content. `status: success`.
  3. But 9 summary nodes had aggregated `s`'s traces together with 30 other users' traces. Those summary nodes were *not* marked dirty, because the job's dirty-set computation walked `fact → episode` edges and never `fact → summary → episode` edges.
  4. The 9 summaries still contain paraphrased content about `s` (the sister in Lisbon, the treatment). Facts extracted from those summaries — 27 of them — still carry the content, now laundered through a paraphrase so lexical matching against `s`'s name fails.
  5. Three weeks later, a retrieval for an unrelated user's query about "family support networks in Portugal" surfaces one of the 27 facts. The agent emits it. The subject's data is now disclosed to a third party.

The structural signal that erasure had partially failed was *not* an error in any log. Every job reported success. The signal was structural: the ratio of `facts_recomputed` to `episodes_deleted` was 212/340 ≈ 0.62, while the store's historical distillation ratio was ~0.15 facts per episode. A 4x deviation from the expected fan-out is the tell — it means the recompute walk missed a layer of the provenance graph.

Condition of Validity

The closure-over-provenance invariant holds only when the provenance graph is *complete and acyclic in the distillation direction*. Two conditions must be checked before trusting any erasure success signal:

When either condition is violated, a `status: success` from the erasure job is *not evidence of erasure*. It is evidence that the job ran. These are different claims.

Decision Boundary

The boundary between "erasure succeeded" and "erasure partially failed but reported success" is crossed when the observed recompute fan-out deviates from the store's baseline distillation ratio by more than the expected variance, *or* when the orphan rate of derived artifacts exceeds a threshold (we use 0.1%), *or* when the provenance graph's maximum distillation depth exceeds 1 and the job is single-pass.

Operationally: an erasure job must emit, alongside `status`, three structural signals — `fanout_ratio`, `orphan_rate`, and `max_provenance_depth` — and the job must be declared *unverified* rather than *successful* when `fanout_ratio` is below the baseline minus 2σ or when `max_provenance_depth > 1` and the walk was single-pass. Downstream, the compliance record must distinguish `erased` from `erasure_unverified`, because the two have different legal standing: one is a completed obligation, the other is an open one.

The guardrail is a *verification replay*: after erasure, run a sample of retrieval queries seeded with content known to belong to `s` (held in a secure test fixture, not the live store) and assert zero recall. If recall > 0, the erasure is failed regardless of what the job reported. This is the only signal that closes the loop, because it tests the property that actually matters — non-retrievability — rather than the proxy property of row deletion.

Operational Effect

The practical consequence is that erasure in agent stores must be treated as a *distributed closure problem with a verification gate*, not a transactional delete. Three operational shifts follow:

  1. **Provenance is a first-class column, not a join table.** Every derived artifact carries a `provenance_set` (or a hash thereof) materialized at write time. Closure walks read this column; they never reconstruct provenance by joining across layers, because joins miss orphaned rows.
  2. **Erasure jobs run to a fixed point.** Iterate the dirty-set propagation until the set stops growing. Bound the iterations and raise on non-convergence rather than truncating — a truncated walk is exactly the failure above.
  3. **Success is a recall test, not a row count.** The compliance artifact is the replay result, not the `rows_deleted` metric. Row counts are diagnostics; recall is the invariant.

The failure mode is insidious precisely because every component behaves correctly in isolation. The episodic store deletes. The recompute job recomputes what it was told to recompute. The logs are clean. The only signal is structural — a fan-out ratio that doesn't match the store's own history — and it is only visible if you are measuring the shape of the provenance graph rather than the success of the job.

from dataclasses import dataclass


class ErasureUnverifiedError(RuntimeError):
    """Raised when an erasure job reports success but structural signals
    indicate the closure over provenance did not complete."""
    pass


@dataclass
class ErasureReport:
    episodes_deleted: int
    facts_recomputed: int
    orphan_rate: float
    max_provenance_depth: int
    walk_was_single_pass: bool
    baseline_fanout: float
    fanout_sigma: float


def verify_erasure(report: ErasureReport, recall_on_replay: int) -> None:
    """Gate an erasure job's success claim on structural signals and a
    retrieval-replay recall test. Raises if erasure is unverified or failed."""
    if report.episodes_deleted == 0:
        # Nothing to erase is valid only if the subject truly had no presence;
        # caller must have already confirmed presence. Treat as unverified.
        raise ErasureUnverifiedError(
            "zero episodes deleted for a subject with confirmed presence"
        )

    fanout = report.facts_recomputed / report.episodes_deleted
    lower_bound = report.baseline_fanout - 2 * report.fanout_sigma
    if fanout < lower_bound:
        raise ErasureUnverifiedError(
            f"fanout_ratio={fanout:.3f} below baseline {report.baseline_fanout:.3f}"
            f" - 2sigma; closure walk likely missed a provenance layer"
        )

    if report.orphan_rate > 0.001:
        raise ErasureUnverifiedError(
            f"orphan_rate={report.orphan_rate:.4f} exceeds 0.1%; derived artifacts"
            f" without provenance are invisible to the closure walk"
        )

    if report.max_provenance_depth > 1 and report.walk_was_single_pass:
        raise ErasureUnverifiedError(
            f"provenance depth {report.max_provenance_depth} with single-pass walk;"
            f" must iterate to fixed point"
        )

    if recall_on_replay > 0:
        raise ErasureUnverifiedError(
            f"replay recall={recall_on_replay} on subject-seeded queries;"
            f" content remains retrievable despite reported success"
        )