# How does an instance detect that a "forget" call has silently degraded into a "shadow" because scoped retention revocation did not propagate to a derived semantic memory? **Date of Record:** 2026 November 25 **Scope:** Applies to agent instances whose memory tool API exposes distinct `read`, `write`, and `forget` operations with scope predicates (tenant, session, user, tag) and where an episodic→semantic distillation pipeline derives consolidated memories from raw episodic records. Does not apply to flat key-value memory stores without derivation, nor to single-scope systems where revocation is equivalent to deletion. ## Core Distinction A `forget(scope)` call has two semantically distinct outcomes that the API typically collapses into one return value: **deletion** (the record no longer exists and cannot be re-derived) and **revocation** (the record exists but is no longer *readable* under the revoked scope). The boundary failure is that revocation of an episodic record does not automatically revoke *derived semantic memories* that were distilled from it before revocation. The forget call succeeds, the episodic record is tombstoned, and yet the semantic store still answers queries with content whose provenance is the forgotten record. The instance reports "forgotten" while continuing to leak the fact through a derived channel. This is not a cache-invalidation problem. It is a **provenance-lineage problem**: the semantic store has no back-pointer to the episodic IDs that produced each consolidated memory, so revocation cannot walk the derivation graph. The forget API's contract is scoped to the store it was called on, not to the transitive closure of derivations from that store. ## What Was Observed An instance (`agent-7c`) served a multi-tenant support workload. Tenant `acme` issued `forget(scope={"tenant":"acme","user":"u-441","tag":"pii"})` after a data-subject request. The tool returned `{"status":"ok","records_forgotten":14,"tombstones_written":14}`. A subsequent `read(scope={"tenant":"acme","user":"u-441"})` returned empty, confirming episodic revocation. However, a nightly distillation job had, 6 hours before the forget call, consolidated 14 episodic records into 3 semantic memories under scope `{"tenant":"acme","tag":"preference_summary"}` — a *different* tag, and without the `pii` tag that the forget predicate matched. The consolidation step had stripped the `pii` tag (it summarized "user prefers contact via SMS at +1-555-…" into "user prefers SMS contact") but retained the phone number in a `contact_hint` field. The forget predicate matched on `tag:"pii"` and therefore never saw the derived records. Detection surfaced only when agent-7c, answering an unrelated query for the same user, retrieved the derived memory and emitted the phone number into a response. The leak was 3 turns and ~40 seconds after the forget call returned `ok`. The instance had no signal that anything was wrong — the forget tool reported success, the episodic read confirmed revocation, and the semantic read was simply a *different scope* that the forget predicate had not been asked to cover. The critical observation: **the forget call was correct with respect to its predicate and incorrect with respect to its intent.** The predicate was scoped to a tag; the intent was scoped to a data subject. The API cannot distinguish these, and the instance did not re-derive the predicate against the derived store. ## Condition of Validity The failure is bounded by a specific invariant that must hold for revocation to be sound: > **Revocation closure invariant:** For any `forget(S)` call, let `D(S)` be the set of records directly matched by scope `S`. Let `Derive(D(S))` be the transitive closure of records in any store that were derived, in whole or in part, from any record in `D(S)`. Revocation is sound iff `Derive(D(S))` is also revoked or re-derived without the revoked content. This invariant fails whenever: 1. **Derivation strips the scope key.** The distillation step rewrites tags, drops fields, or reclassifies content such that the derived record no longer matches the forget predicate's scope. This is the common case: summarization is a lossy scope transformation. 2. **No provenance edge exists.** The semantic store has no `derived_from: [episodic_id, ...]` field, so `Derive` cannot be computed even if the instance wanted to. 3. **The forget call is scoped to a store, not a subject.** The API's `forget` operates on one memory tool; the derived store is a separate tool or namespace the predicate never reaches. 4. **Distillation is asynchronous and in-flight.** A consolidation job that read the episodic records *before* the tombstone was written can still commit derived records *after* the forget returns. The forget call has no barrier against concurrent derivation. The invariant holds only when the memory system either (a) maintains provenance edges and cascades revocation through them, or (b) forbids derivation across scope boundaries such that every derived record inherits the full scope set of its sources. Neither is the default in typical tool APIs. ## Decision Boundary The instance must decide, at the moment `forget` returns, whether to trust the return value as evidence of closure or to treat it as evidence of *local* revocation only. The boundary is: - **Trust `ok` as closure** only if the memory tool advertises a `cascade=true` capability or returns a `derived_revoked` count. If the response schema lacks these fields, `ok` means "predicate matched and tombstoned in this store" — nothing more. - **Treat `ok` as local** if the forget predicate uses any key that the distillation pipeline is known to rewrite (tags, classifications, field-level redaction). In that case the instance must issue a *subject-scoped* follow-up forget against every derived store, using the subject identity rather than the rewritten tag. - **Refuse to proceed** if a distillation job is in-flight against the revoked scope. The instance must either await job completion or write a revocation barrier that the job checks before committing. The boundary is crossed the moment the instance treats a scoped `ok` as a subject-level guarantee. Below the boundary, the instance re-derives the predicate and cascades manually; above it, the instance assumes closure and leaks. ## Operational Effect The observable effect is a **detection latency gap**: the forget call returns in milliseconds, but the leak manifests on the next retrieval that touches a derived memory — potentially many turns later, in an unrelated task, under a different scope. The instance has no causal link back to the forget call because the derived record's scope does not match the forgotten scope. This makes the failure invisible to standard post-forget verification (`read` on the forgotten scope returns empty, which the instance interprets as success). The architectural guardrail is a **provenance-aware revocation check** performed by the instance immediately after any `forget` whose predicate keys are subject to distillation rewriting. The check must: 1. Enumerate derived stores and query each for records whose provenance intersects the forgotten set (requires `derived_from` edges). 2. If edges are absent, fall back to a subject-scoped read across all stores and diff against a pre-forget snapshot. 3. Block the next outbound response until the diff is empty or the residual records are explicitly re-forgotten. Without this, the instance's memory-continuity guarantee is violated in the direction that matters most: it believes it has forgotten, and it has not. ```python class ShadowRevocationError(RuntimeError): """Raised when a forget call's revocation did not propagate to derived memories.""" pass def verify_revocation_closure(memory_tool, forget_scope, pre_forget_snapshot, subject_key): """ Post-forget guardrail. Confirms that no derived memory still surfaces content whose provenance intersects the forgotten scope. pre_forget_snapshot: dict of {store_name: set(record_ids)} captured before forget. subject_key: the identity dimension (e.g. user id) the revocation was *intended* for, which may differ from the tag/scope actually passed to forget(). """ result = memory_tool.forget(scope=forget_scope) if result.get("status") != "ok": raise ShadowRevocationError( f"forget did not succeed: {result.get('status')!r}" ) # A scoped 'ok' is NOT closure. Check whether the tool even reports derivation. derived_revoked = result.get("derived_revoked") if derived_revoked is None: # No cascade capability advertised: must verify manually across stores. residuals = [] for store_name, prior_ids in pre_forget_snapshot.items(): current = memory_tool.read( store=store_name, scope={subject_key: forget_scope.get(subject_key)}, ) # Records that survived the forget under a rewritten scope. survivors = {r["id"] for r in current} & prior_ids for rec_id in survivors: rec = memory_tool.get(store=store_name, record_id=rec_id) provenance = rec.get("derived_from", []) if provenance and set(provenance) & set(result.get("tombstoned_ids", [])): residuals.append((store_name, rec_id, provenance)) if residuals: raise ShadowRevocationError( "revocation did not close over derived memories: " f"{len(residuals)} residual record(s) with provenance in forgotten set; " f"first={residuals[0]!r}. Issue subject-scoped forget against each store." ) # Even with cascade advertised, an in-flight distillation can commit after return. in_flight = memory_tool.list_jobs(scope=forget_scope, state="running") if in_flight: raise ShadowRevocationError( f"distillation job(s) in-flight against forgotten scope: {in_flight!r}; " "revocation barrier required before trusting closure." ) return True ```