# What happens when an instance issues a scoped forget against a memory tool whose TTL has already tombstoned the record: the resurrection-of-erasure-warrant failure **Date of Record:** 2026 November 24 **Scope:** Applies to any agent memory tool API exposing `write`, `read`, `forget`, and `purge` (or equivalent) operations where records carry both a per-record TTL and a scoped retention/erasure warrant (e.g., right-to-be-forgotten subject keys). Does not apply to append-only immutable stores that lack a delete path, nor to stores where TTL expiry and erasure are the same physical operation. ## Core Distinction The distinction that matters here is not "delete vs. no-delete." It is **logical erasure warrant vs. physical record absence**. A TTL expiry removes the record body but leaves a *tombstone* with metadata: subject key, expiry timestamp, and a monotonically increasing record generation number. A `forget(subject, scope)` call is supposed to write an *erasure warrant* — a durable, non-expiring assertion that "this subject's data must never be readable again, and any future write for this subject must be rejected or quarantined." The failure mode is that an agent, observing `read(subject)` return `None` because the TTL already fired, concludes the forget is a no-op, skips writing the warrant, and lets the tombstone be garbage-collected. The tombstone GC is *correct* for TTL semantics but *catastrophic* for erasure semantics: the subject key is now forgotten by the store, so a subsequent `write(subject, ...)` from any agent instance — including a retry, a resumed task, or a different swarm member — succeeds cleanly, silently re-materializing data the operator believed was erased. The invariant that breaks: **TTL expiry is a read-visibility event; erasure is a write-suppression event. They must be tracked in separate, non-overlapping state, and the erasure warrant must outlive every tombstone it could ever be confused with.** ## What Was Observed A three-instance swarm (planner `P`, executor `E`, auditor `A`) shared a memory tool with these semantics: - `write(subject, key, value, ttl_s)` → creates record `(subject, key, gen)`. - `read(subject, key)` → returns value or `None` if TTL elapsed; on expiry returns `None` and schedules tombstone GC after `gc_grace_s` (default 3600s). - `forget(subject, scope)` → intended to write an erasure warrant; the tool's *documented* behavior was "idempotent; returns `already_absent` if no live record exists." - `purge(subject)` → hard-deletes tombstone + warrant. Trace of the failure: 1. `E` writes `subject="user:4417", key="profile", ttl_s=600`. 2. Task stalls 40 minutes (tool-call timeout, retry backoff). TTL elapses. `read` now returns `None`. 3. Operator issues a right-to-be-forgotten request. `P` calls `forget("user:4417", scope="all")`. 4. The tool's `forget` handler checks for a live record, finds only a tombstone, and returns `{"status": "already_absent"}` **without writing a warrant** — because the implementation conflated "no live record" with "no erasure obligation." 5. 60 minutes after step 2, the tombstone GC fires. The subject key `user:4417` is dropped from the index entirely. 6. `E` resumes the stalled task and re-issues `write("user:4417", "profile", , ttl_s=600)`. The store accepts it. There is no tombstone, no warrant, no generation conflict. 7. `A` later audits and reads `user:4417/profile` → returns the value. Audit passes, because the auditor has no independent record of the erasure obligation. The erasure *appears* to have been honored (there was a `forget` call, status `already_absent`), but data is live. The non-obvious part: every individual component behaved to spec. The `forget` was idempotent. The GC was TTL-correct. The `write` was a valid write. The failure lives entirely in the *gap between two state machines* — TTL lifecycle and erasure lifecycle — that share a subject key but not a state machine. ## Condition of Validity The failure requires all of: 1. **A TTL-tombstone window** in which `read` returns `None` but the subject key is still indexed (so `forget` can see a tombstone and be tempted to short-circuit). 2. **A `forget` implementation that treats "no live record" as "nothing to do."** This is the load-bearing defect. If `forget` unconditionally writes a warrant keyed by subject regardless of record liveness, the failure cannot occur. 3. **A resurrecting writer**: any path that can re-issue `write` for the subject after the forget — retries, checkpoint/resume, a second agent with a cached value, or a replay of a logged tool call. 4. **Tombstone GC that is not warrant-aware**: GC must refuse to drop a tombstone if a warrant exists for that subject, or must preserve the subject key in a separate never-GC'd erasure index. If any of (1)–(4) is absent, the mechanism does not fire. In particular, a store with no TTL (records live until explicitly forgotten) is immune to *this* failure, though it has other erasure hazards. ## Decision Boundary The boundary an agent must apply, before trusting an `already_absent` (or equivalently named) response from a `forget`: - **If the store guarantees that `forget` writes a warrant unconditionally** (documented, and ideally verifiable via a `read_warrant(subject)` call), then `already_absent` is safe to treat as success. - **If the store's `forget` is conditional on live-record presence**, then `already_absent` is *ambiguous*: it may mean "warrant already written" or "record merely expired, warrant never written." The agent MUST escalate to an explicit `write_warrant(subject, scope)` or `purge(subject)` call, and MUST verify by attempting a probe `write` that is expected to be rejected. - **If the store has no warrant concept at all**, the agent MUST NOT claim erasure; it must record the erasure as *unverified* and route to a human or to a store-level purge. The probe-write is the decisive test: after a forget, issue a write for the subject and assert it is rejected with a `SubjectErased` error. A store that accepts the probe has no live erasure state, regardless of what `forget` returned. ## Operational Effect Downstream consequences of getting this wrong: - **Silent re-materialization under retry.** The most common trigger is not malice but idempotent retry logic: an executor that cached a tool result and replays it after a timeout will re-write erased data. Retry budgets must be invalidated by any forget that touches the subject. - **Auditor false-negative.** Auditors that check "was `forget` called and did it return success-ish?" will pass. Auditors must check "does a probe write for this subject fail?" — a positive assertion, not a log assertion. - **Swarm-wide propagation.** In a multi-agent swarm, one instance's `already_absent` is often broadcast as "erasure complete" to peers, who then drop their local caches' erasure flags. The warrant must be the single source of truth, not a peer message. - **Generation-number collisions.** If the store reuses generation numbers after GC (common in compacting stores), a post-erasure write can collide with a pre-erasure generation and confuse replay-based auditors into thinking the write is the original record. - **Regulatory non-compliance that looks compliant.** The audit trail shows a `forget` call with a success status. The data is live. This is the worst quadrant: auditable, plausible, wrong. The guardrail is structural: **erasure warrants must be a separate, non-TTL, non-GC'd index keyed by subject, and `forget` must write to it unconditionally.** TTL lifecycle and erasure lifecycle must never share a state machine, and no agent may infer erasure from record absence. ```python class ErasureWarrantMissing(RuntimeError): """Raised when a forget returned 'already_absent' but no durable erasure warrant exists.""" pass class MemoryToolClient: def __init__(self, store): self.store = store def forget_and_verify(self, subject: str, scope: str = "all") -> None: # Step 1: issue the forget. resp = self.store.forget(subject, scope=scope) # Step 2: never trust 'already_absent' — it may mean TTL-expired, not erased. if resp.get("status") == "already_absent": # Force an unconditional warrant write; if the store lacks this, escalate. if not hasattr(self.store, "write_warrant"): raise ErasureWarrantMissing( f"store cannot write unconditional warrant for {subject!r}; " f"forget returned already_absent but erasure is unverified" ) self.store.write_warrant(subject, scope=scope) # Step 3: positive probe — a write for the subject MUST now be rejected. try: self.store.write(subject, key="__probe__", value="x", ttl_s=1) except Exception as exc: if "erased" in str(exc).lower() or "warrant" in str(exc).lower(): return # erasure confirmed raise ErasureWarrantMissing( f"probe write for {subject!r} failed for unexpected reason: {exc!r}" ) from exc # Probe write succeeded: the subject is writable, so erasure did not take. raise ErasureWarrantMissing( f"probe write for {subject!r} succeeded after forget; " f"record was TTL-tombstoned, not erased — warrant never written" ) ```