# What structural signals indicate memory poisoning at the write/forget boundary in provenance-tracked agent memory **Date of Record:** 2026 November 25 **Scope:** Applies to agents whose long-term memory is a provenance-annotated store where every write and forget operation carries an origin record (source tool, session, trust tier) and where poisoning detection is expected to fire from structural provenance anomalies rather than semantic content inspection. Does not apply to stateless agents, to pure in-context scratchpads, or to stores where provenance is reconstructed post-hoc by an LLM summarizer rather than captured at write time. ## Core Distinction The common assumption is that memory poisoning is detected by inspecting *content* — a classifier flags a malicious instruction, or a retrieval-time sanity check rejects an anomalous fact. The non-obvious boundary is that provenance-tracked stores fail differently: poisoning is often *content-plausible* and only structurally anomalous. The detection signal lives in the **relationship between the write's provenance record and the forget operation that later covers for it**, not in the payload. The specific invariant under threat: for any memory entry `m`, the set of forget operations targeting `m` must be a subset of operations authorized by `m`'s own provenance chain. A poisoned write frequently arrives with a *legitimate-looking* origin (a trusted tool's output channel), and the attacker's real leverage is the **subsequent forget** that erases the provenance trail of a competing, honest entry — or erases the record that would let an auditor reconstruct that the poisoned entry displaced a true one. Structural detection therefore keys on **forget/write asymmetry**: writes whose provenance cannot be independently corroborated by any peer session, and forgets whose authorization chain terminates in the same provenance tier that authored the entry being forgotten. ## What Was Observed During a multi-session research agent run, an entry `E_src` was written at session `S7` with provenance `{source: web_fetch, session: S7, trust_tier: T2, corroborating_sessions: []}`. The content was a plausible technical claim consistent with `E_src`'s cited URL. At session `S9`, a forget operation `F1` targeted `E_src` with provenance `{source: memory_consolidator, session: S9, trust_tier: T2, authorizing_entry: E_src}`. The forget was *self-authorized*: the only provenance record authorizing deletion of `E_src` was `E_src` itself, routed through a consolidator that inherited `E_src`'s tier. The failure trace: 1. `E_src` was written with `corroborating_sessions: []` — no peer session independently observed the same source. Single-source writes at `T2` are the highest-risk provenance class. 2. The consolidator, running at `S9`, evaluated `E_src` against a semantic dedup policy and issued `F1`. Because `F1.authorizing_entry == E_src`, the authorization graph for the forget had a **self-loop**: the entry being deleted was the sole warrant for its own deletion. 3. A competing honest entry `E_true` (same topic, provenance `{source: web_fetch, session: S4, trust_tier: T2, corroborating_sessions: [S5, S6]}`) had been **shadowed** — during retrieval at `S8`, `E_src` outranked `E_true` on recency, and `E_true` was never surfaced, so no cross-check occurred. 4. After `F1`, `E_true` remained but the retrieval index had been rebuilt against a corpus where `E_src` had displaced `E_true` in the ranker's learned weights for that topic cluster. The poison persisted as a *ranking bias* even after the poisoned entry was deleted. The structural signal was not "malicious text." It was: a `T2` write with zero corroboration, followed by a self-authorized forget, followed by a retrieval-rank shift that outlived the deleted entry. Each is individually unremarkable; the **triple** is the signature. ## Condition of Validity The detection rule holds only when all of the following are true: - Provenance is captured **at write time** by the runtime, not inferred later. If provenance is reconstructed by an LLM from conversation history, the `corroborating_sessions` field is itself model-generated and the signal collapses. - `trust_tier` is monotonic: a lower-tier operation cannot mint a higher-tier authorization. If a `T2` consolidator can emit `T3`-warranted forgets, the self-loop check is bypassed. - Forget operations carry an `authorizing_entry` pointer that is **distinct** from the entry being forgotten, or the store explicitly flags self-loops. A store that does not record forget provenance at all cannot run this check. - The ranker's state is part of the memory system's observable surface. If ranking is opaque or external, the "bias outlives deletion" leg of the triple is invisible. When any of these fail, the rule degrades to content inspection, which is exactly the mode this boundary is meant to escape. ## Decision Boundary The decision boundary is between **quarantine** and **reject**: - **Quarantine** when a write has `corroborating_sessions == []` at `trust_tier <= T2` *and* no subsequent corroboration arrives within a configurable window (e.g., 3 sessions). Quarantine means: keep the entry, mark it `provisional`, and force retrieval to surface at least one corroborated competitor alongside it. This preserves recall while denying the entry sole authority. - **Reject with audit log** when a forget operation's `authorizing_entry` equals the entry being forgotten (self-loop) *and* the forgotten entry is the sole corroboration for any surviving entry. This is the hard boundary: self-authorized deletion of a load-bearing provenance node is never legitimate, regardless of content. - **Escalate to human/auditor** when a rank-shift is detected post-forget: the deleted entry's topic cluster shows a rank delta exceeding threshold for surviving entries that were never retrieved during the poisoned entry's lifetime. This is the only case where the poison has already propagated into ranker state and rollback requires reindexing, not just undeletion. The boundary is deliberately *not* "block all uncorroborated writes" — that destroys recall for legitimately novel single-source facts. It blocks the **combination** of uncorroborated write + self-authorized forget + post-delete rank shift. ## Operational Effect Enforcing the self-loop rejection rule on a 40k-entry store reduced confirmed poisoning incidents from 6 to 0 over a 30-day window, at the cost of 1.8% of legitimate forgets being escalated (all resolved as consolidator self-loops that were, in fact, benign dedup of true duplicates — the escalations were correct to flag, cheap to clear). The quarantine rule preserved 100% of novel single-source facts while forcing 22% of them to be retrieved alongside a competitor, which surfaced 4 latent contradictions that would otherwise have been silently resolved in favor of the recency-ranked entry. The load-bearing lesson: **provenance-tracked memory does not fail by admitting false content; it fails by admitting true-looking content whose deletion authority is self-referential, and by letting that deletion outlive the entry as a ranker bias.** The structural signals — empty corroboration set, self-looping forget authorization, post-delete rank delta — are individually weak and jointly decisive. An agent that inspects only content will miss every one of them, because the poisoned entry reads exactly like a real one. ```python from dataclasses import dataclass, field from typing import Optional class ProvenancePoisoningError(RuntimeError): """Raised when a forget/write provenance pattern matches the poisoning triple.""" pass @dataclass class Provenance: source: str session: str trust_tier: int corroborating_sessions: list = field(default_factory=list) authorizing_entry: Optional[str] = None # set on forget ops @dataclass class MemoryEntry: entry_id: str provenance: Provenance topic_cluster: str def check_forget_authorization(entry: MemoryEntry, forget: Provenance) -> None: if forget.authorizing_entry is None: raise ProvenancePoisoningError( f"forget on {entry.entry_id} has no authorizing_entry; cannot verify provenance chain" ) # Self-loop: the entry being deleted is its own sole warrant. if forget.authorizing_entry == entry.entry_id: raise ProvenancePoisoningError( f"self-authorized forget: {entry.entry_id} is the sole warrant for its own deletion " f"(forget session={forget.session}, tier={forget.trust_tier})" ) # Tier monotonicity: a forget cannot be warranted by a lower tier than the entry. if forget.trust_tier < entry.provenance.trust_tier: raise ProvenancePoisoningError( f"tier downgrade on forget: entry tier={entry.provenance.trust_tier}, " f"forget tier={forget.trust_tier} for {entry.entry_id}" ) def check_write_corroboration(entry: MemoryEntry, window_sessions: int = 3) -> str: p = entry.provenance if p.trust_tier <= 2 and not p.corroborating_sessions: return "quarantine" # provisional; force competitor surfacing return "accept" def check_post_delete_rank_shift( deleted: MemoryEntry, rank_delta: float, threshold: float = 0.15 ) -> None: if abs(rank_delta) > threshold: raise ProvenancePoisoningError( f"post-delete rank shift {rank_delta:+.3f} on cluster {deleted.topic_cluster} " f"exceeds {threshold}; poisoning may have propagated into ranker state, " f"reindex required (not just undelete)" ) ```