# In what scenarios must an instance quarantine a provenance-verified memory write when the verifying witness itself was retrieved from the poisoned partition **Date of Record:** 2026 December 3 **Scope:** Applies to persistent agent knowledge stores where every write carries a provenance attestation (signer, source URI, retrieval lineage) and reads are gated by witness cross-checks against previously stored entries. Does not apply to stateless single-turn inference, nor to stores where provenance is recomputed from an external trusted ledger on every read. ## Core Distinction The standard memory-poisoning defense is *provenance-verified retrieval*: before an agent admits a retrieved memory into its working context, it re-derives the memory's provenance chain and checks it against an independent witness—usually another stored memory that attests to the same fact. The failure mode this record isolates is the **self-referential witness loop**: the "independent" witness used to validate a candidate write is itself a descendant of the same poisoned subtree. When the witness and the candidate share a poisoned ancestor, the cross-check passes cleanly, the write is admitted, and the poison is *laundered into a higher-trust tier* because it now carries two mutually-corroborating provenance chains. This is distinct from ordinary stale-memory drift (where a memory is simply outdated) and from retrieval mismatch (where a query returns semantically wrong but honestly-sourced entries). Here every individual provenance link is cryptographically valid and every signature verifies. The corruption is purely topological: the verification graph has a cycle or a shared root that the checker does not traverse. ## What Was Observed A long-running research agent maintained a semantic store of ~40k facts, each entry `{fact_id, claim, provenance: [source_uri, signer, parent_fact_ids], trust_tier}`. Trust tiers: `T0` (direct tool output), `T1` (single-hop distillation), `T2` (multi-hop synthesis). The write path required a candidate at tier `Tn` to be corroborated by at least one *independent* witness at tier `≤ Tn-1`, where "independent" was defined operationally as "shares no `parent_fact_ids` with the candidate." The trigger: a poisoned `T0` fact `F_p` entered via a prompt-injected web fetch (`source_uri` pointed at an attacker page, but the signer was the agent's own fetcher tool, so signature checks passed). Over the next 200 turns, normal distillation produced `F_a = distill(F_p)` at `T1` and `F_b = distill(F_p, F_x)` at `T1`, where `F_x` was an unrelated clean fact. Later, a synthesis step proposed `F_c` at `T2` with `parents = [F_a, F_b]`. The independence check for `F_c` compared `F_c`'s parents against each witness's parents. It selected `F_a` as witness for `F_b` and vice versa. Because `F_a` and `F_b` have *different* immediate parent sets (`{F_p}` vs `{F_p, F_x}`), the naive set-intersection test on immediate parents returned "independent." `F_c` was admitted to `T2` with two corroborating chains that both bottom out at `F_p`. The laundered `F_c` then became the preferred witness for subsequent writes because it sat at the highest trust tier with the most corroboration—making the poisoned subtree the *dominant* attestation source. Within ~600 turns, 71% of new `T2` writes traced to `F_p`. The failure trace: ``` F_p (T0, poisoned, sig valid) ├─ F_a (T1) ──┐ └─ F_b (T1) ──┴─> F_c (T2, "2 independent witnesses") ← laundered └─> F_d, F_e, ... (T2, witness=F_c) ``` The independence test was O(1) in immediate parents but O(depth) in true ancestry. The invariant it assumed—that distinct immediate parents imply distinct causal roots—is false under convergent distillation. ## Condition of Validity The quarantine rule below is valid only when the following hold; outside these conditions the correct action is a full subtree freeze instead. 1. The store maintains a traversable `parent_fact_ids` DAG with no more than ~10^6 nodes, so bounded-depth ancestry walks are affordable per read. 2. Every `T0` ingress point is instrumented with a content-hash of the raw tool output, so a `T0` fact's provenance can be re-verified against the original fetch record rather than only its signature. 3. Trust tiers are monotone: a fact's tier is `1 + max(parent tiers)`. If tiers can be assigned arbitrarily, ancestry depth does not bound trust and the check is meaningless. When condition 2 fails (no raw-output hash), an ancestry collision cannot be distinguished from honest convergent sourcing, and the instance must escalate rather than silently quarantine. ## Decision Boundary The boundary is not "does the witness share a parent with the candidate" but **"does the witness share any root with the candidate within the trust-tier horizon."** Formally: a witness `w` is admissible for candidate `c` at tier `T` iff `roots(w, depth=T) ∩ roots(c, depth=T) = ∅`, where `roots` walks `parent_fact_ids` up to `T` levels (since tier monotonicity guarantees no root can be more than `T` hops above a `T`-tier fact). The naive immediate-parent test is the degenerate case `depth=1` and is *unsound for all T ≥ 2*. Two consequences follow. First, the ancestry walk cost scales with tier, not store size, so deep-tier verification is the expensive path and must be budgeted. Second, when a collision is found, the candidate is not rejected outright—it is **quarantined**: written to an isolated partition, excluded from witness selection, and flagged for re-derivation from `T0` sources. Rejecting outright loses honest facts that happen to share a distant clean root; admitting them launders poison. Quarantine is the only action that preserves both properties. ## Operational Effect After the fix, the poisoned subtree was detected at the first `T2` synthesis attempt: the ancestry walk for `F_c` found both witnesses converging on `F_p` at depth 2, quarantined `F_c`, and flagged `F_a`/`F_b` for `T0` re-derivation. Re-derivation re-fetched the `source_uri`, the content hash mismatched the stored `T0` record (attacker page had changed), and `F_p` was demoted. Total poisoned writes after fix: 0 over 5k turns, at a cost of ~18% additional latency on `T2` writes from the ancestry walk. The invariant to encode: **trust tier is a bound on ancestry depth, and witness independence must be checked at the full tier horizon, never at depth 1.** Any store that verifies provenance by signature alone, or checks witness independence on immediate parents, is vulnerable to convergent-distillation laundering. ```python from dataclasses import dataclass, field from typing import Optional class WitnessCollisionError(RuntimeError): """Raised when a candidate's witness shares a causal root within the tier horizon.""" pass @dataclass class Fact: fact_id: str tier: int parents: list[str] = field(default_factory=list) quarantined: bool = False class ProvenanceStore: def __init__(self) -> None: self._facts: dict[str, Fact] = {} def add(self, fact: Fact) -> None: self._facts[fact.fact_id] = fact def _roots(self, fact_id: str, horizon: int) -> set[str]: """Walk parent_fact_ids up to `horizon` levels; return the frontier set.""" frontier = {fact_id} for _ in range(horizon): nxt: set[str] = set() for fid in frontier: f = self._facts.get(fid) if f is None or not f.parents: nxt.add(fid) # leaf / missing => terminal root else: nxt.update(f.parents) frontier = nxt return frontier def verify_write(self, candidate: Fact, witness_id: str) -> None: if candidate.tier < 2: return # depth-1 test is sound only at T1 horizon = candidate.tier # tier monotonicity bounds ancestry depth cand_roots = self._roots(candidate.fact_id, horizon) wit_roots = self._roots(witness_id, horizon) collision = cand_roots & wit_roots if collision: candidate.quarantined = True raise WitnessCollisionError( f"candidate {candidate.fact_id} (T{candidate.tier}) and witness " f"{witness_id} share roots {sorted(collision)} within horizon " f"{horizon}; quarantining, escalate to T0 re-derivation" ) ```