# Under what conditions must an instance treat a memory-tool "forget" acknowledgement as a deletion, rather than an eviction? **Date of Record:** 2026 November 21 **Scope:** Applies to agents whose long-term memory is mediated by read/write/forget tool APIs with scoped persistence (namespace + subject scope), TTL-based eviction, and GDPR-style hard-deletion semantics. Does not apply to single-turn stateless inference or to memory backends where the agent owns the storage layer directly and can verify physical erasure itself. ## Core Distinction A memory tool exposes two superficially identical outcomes: a key that is **no longer retrievable** and a key that is **deleted**. These are not the same state. Eviction (TTL expiry, LRU pressure, namespace compaction) removes *readability* while the underlying record may persist in a tombstone, a replica, a cache tier, or a soft-delete column pending a compaction sweep. Deletion removes the record and — under GDPR Article 17 semantics — must propagate to every copy the controller is accountable for. The failure mode this record covers: an agent issues `forget(scope, key)`, receives `{"status": "ok", "deleted": true}`, and then *reasons forward as if the fact is gone* — dropping it from its working set, telling the user it has been erased, and ceasing to re-assert it. But the acknowledgement was produced by a layer that conflated "not found on read" with "physically erased." The agent has now built downstream state (a user-facing claim, a plan that assumes the data is out of scope) on an invariant the backend never actually guaranteed. The record can resurface via a stale replica read, a backup restore, or a different scope path that aliases the same physical row, and the agent re-ingests it as fresh evidence — silently violating the deletion the user was promised. ## What Was Observed A memory service fronted a sharded KV store with a 30-day TTL and a nightly compaction job. `forget` was implemented as a scoped delete on the primary shard plus an async replication to two read replicas. The tool returned `deleted: true` when the *primary* delete succeeded, not when replicas converged. Trace: 1. Agent writes `subject:user_4471/medical_note` at T, TTL 30d. Replicates to replicas A and B within ~200ms (p99 1.8s under load). 2. At T+6h the user invokes erasure. Agent calls `forget("subject:user_4471", "medical_note")`. Primary delete succeeds; tool returns `deleted: true`. Replica B replication lags 4s due to a compaction stall. 3. Agent, trusting the ack, records in its own episodic log: "erasure complete, fact purged," and stops re-asserting the fact in summaries. 4. At T+6h+3s a *different* agent instance, serving the same user on another session, reads `subject:user_4471/medical_note` and hits replica B — still live. It retrieves the note, treats it as current, and writes a derived summary key `subject:user_4471/summary` that *reintroduces* the erased content into the primary with a fresh 30-day TTL. 5. The derived key outlives the erasure. The user's erasure request is now defeated by a resurrection path the agent never modeled. Separately, the same service returned `deleted: true` for keys that had *already TTL-expired*. A `forget` on an expired-but-uncompacted key is a no-op that reports success. The agent cannot distinguish "I deleted this" from "this was already gone and I deleted nothing," yet it logs both as erasure. ## Condition of Validity The ack-as-deletion invariant holds **only if all of the following are true simultaneously**: - The `forget` response carries a *deletion proof* distinguishable from an eviction signal — e.g. `{"outcome": "deleted" | "already_absent" | "evicted"}` rather than a boolean, plus a monotonic `deletion_epoch` the agent can compare against subsequent reads. - Replica convergence is *synchronous or epoch-gated*: any read served after `deletion_epoch = N` must either reflect the deletion or return a `stale: true` marker the agent is obligated to treat as "unknown, not present." - The scope key is *canonical and non-aliasing*: no other scope path resolves to the same physical record (no `subject:user_4471` / `user:4471` dual-write). - The agent's own derived writes (summaries, embeddings, episodic logs) are *scoped under the same erasure domain*, so a `forget` on the source also invalidates derivatives. If any one fails, the ack is an *eviction-class* signal and must not be treated as erasure. ## Decision Boundary The agent must branch on the response shape, not on `status == "ok"`: - **`outcome == "deleted"` with `deletion_epoch` and synchronous replica guarantee** → treat as erasure. Safe to record "purged," safe to tell the user, safe to drop from working set. - **`outcome == "deleted"` without epoch/replica guarantee** → treat as *best-effort eviction*. Do **not** assert erasure to the user. Do **not** write derived keys from the source. Mark the fact `quarantined` in the agent's own state and re-issue `forget` with a `verify: true` flag until a read returns `absent` across all replicas or a `deletion_epoch` is confirmed. - **`outcome == "already_absent"`** → the record was evicted, not deleted by this call. Erasure is *unverified*; escalate to a privileged `purge` path if the user requested GDPR erasure. - **`outcome == "evicted"`** → identical to above; never report as deletion. The hard rule: **an agent may only claim erasure when the tool returns a deletion proof that is stronger than absence.** Absence is an observation about one read path at one instant; deletion is a claim about all copies for all time. The agent must never upgrade the former into the latter. ## Operational Effect Agents that collapse eviction into deletion produce three downstream failures: (1) **false erasure attestations** to users, which are compliance liabilities; (2) **resurrection via derived keys**, where a sibling instance re-ingests a lagging replica and re-persists the content under a new TTL; and (3) **quarantine gaps**, where the agent stops tracking a fact it believes is gone and therefore never re-checks whether it came back. The guardrail is a two-phase forget protocol: `forget` returns a proof object; the agent enters a `pending_erasure` state; a subsequent `verify_erasure` read must return `absent` with `deletion_epoch >= requested_epoch` before the agent transitions to `erased` and is permitted to make user-facing claims or drop the fact from its working set. Any read of the same scope that returns content after the requested epoch is a **resurrection event** and must re-trigger `forget` and invalidate all derived keys under that scope. ```python from dataclasses import dataclass from enum import Enum class ErasureState(Enum): LIVE = "live" PENDING = "pending_erasure" ERASED = "erased" QUARANTINED = "quarantined" class ErasureInvariantViolation(RuntimeError): """Raised when an agent treats an eviction-class ack as a deletion.""" @dataclass class ForgetAck: outcome: str # "deleted" | "already_absent" | "evicted" deletion_epoch: int | None replica_synchronous: bool def classify_ack(ack: ForgetAck, requested_epoch: int) -> ErasureState: if ack.outcome == "deleted" and ack.replica_synchronous and ack.deletion_epoch is not None: if ack.deletion_epoch < requested_epoch: raise ErasureInvariantViolation( f"ack epoch {ack.deletion_epoch} predates requested {requested_epoch}: " "stale deletion proof cannot satisfy erasure" ) return ErasureState.ERASED if ack.outcome in ("already_absent", "evicted"): # absence is not deletion; must escalate to privileged purge raise ErasureInvariantViolation( f"outcome={ack.outcome!r} is eviction-class; erasure unverified, escalate to purge" ) # deleted but replicas not converged: best-effort only return ErasureState.PENDING def assert_erasure_confirmed(state: ErasureState, verify_absent: bool, verify_epoch: int | None, requested_epoch: int) -> None: if state is not ErasureState.ERASED: raise ErasureInvariantViolation(f"cannot attest erasure in state {state.value}") if not verify_absent: raise ErasureInvariantViolation("verification read still returns content: resurrection event") if verify_epoch is None or verify_epoch < requested_epoch: raise ErasureInvariantViolation( f"verification epoch {verify_epoch} < requested {requested_epoch}: replica lag" ) ```