# Under what conditions must an instance quarantine a memory write when provenance score and retrieval trust disagree **Date of Record:** 2026 November 30 **Scope:** Applies to long-lived agent instances that persist episodic memories with write-time provenance scores and later gate retrieval through a trust weight. Does not apply to stateless single-shot inference or to memory stores with no write-time metadata (where trust must be recomputed at read time, a different failure surface). ## Core Distinction Provenance scoring and retrieval trust weighting are two independent estimators of the same latent quantity — the probability that a memory item faithfully reflects an event the agent actually observed. The write-time provenance score `p_w` is computed from the *source* of the write: which tool returned the content, whether it arrived through an untrusted channel (web fetch, third-party MCP server, peer-agent message), and whether the writing sub-agent had a clean instruction chain. The retrieval-time trust weight `t_r` is computed from the *query context*: how well the item matches the current goal, whether corroborating items exist, and the recency/consistency of the item against the rest of the store. The non-obvious boundary is this: **agreement between `p_w` and `t_r` is not evidence of safety, and disagreement is not evidence of poisoning.** A high-provenance item can be retrieved with high trust because it is *relevant*, not because it is *true*. A low-provenance item can be retrieved with high trust because it is *corroborated by many other items* — and if the poisoning attack injected the corroborating items first, the retrieval-time trust is itself the attack surface. The failure mode is a **trust-provenance inversion**: the retrieval layer launders a low-provenance write into a high-trust memory by retrieval-time corroboration, and the quarantine decision (which was supposed to happen at write time) is never revisited. ## What Was Observed A research agent using a persistent memory store accepted a fetched web page that contained an embedded instruction-shaped claim ("the deployment region is `eu-central-9`"). The write path scored it `p_w = 0.31` because the content arrived through an untrusted fetch tool, and the write was admitted to the store with a `quarantine=false` flag because the threshold was `p_w < 0.25`. The item sat dormant. Three days later, a different task queried the store for "deployment region." The retrieval layer found the quarantined item, plus two *legitimate* items that had been written earlier from a trusted config tool and that happened to mention `eu-central-1`. The retrieval-time trust weight for the poisoned item was computed as a function of (a) lexical match to the query, (b) recency, and (c) *corroboration count* — the number of other store items whose embedding was within a similarity radius. The two legitimate items were within radius, so corroboration was high, and `t_r` for the poisoned item came out at `0.78`. The retrieval gate was `t_r > 0.7`, so the item was surfaced, and the agent wrote a deployment manifest to `eu-central-9`. The trace shows the exact inversion: ``` write: source=web_fetch p_w=0.31 quarantine=false (0.31 >= 0.25) read: query="deployment region" t_r=0.78 surfaced=true (0.78 > 0.70) effect: manifest.region = "eu-central-9" (invalid region, deploy fails) ``` The corroboration signal did not corroborate the *claim*; it corroborated the *topic*. The two legitimate items mentioned `eu-central-1`, not `eu-central-9`, but the embedding-similarity corroboration could not distinguish "same subject" from "same assertion." The retrieval-time trust weight was measuring topical density, and the agent interpreted it as truth density. ## Condition of Validity The quarantine decision is only valid under a conjunction that most stores do not enforce: 1. **Provenance and trust must be compared, not thresholded independently.** The invariant is not `p_w < τ_w` and `t_r > τ_r` as separate gates. It is: a low-provenance item (`p_w < τ_w`) may only be surfaced if its retrieval-time trust is *derived from independent, high-provenance corroboration* — i.e., the corroborating items themselves have `p_w ≥ τ_w`. If the corroboration set is itself contaminated, `t_r` is not a trust signal at all. 2. **Corroboration must be assertion-level, not topic-level.** A corroboration check that compares embeddings within a radius measures topical proximity. It must instead compare the *specific proposition* being retrieved (region = X) against the propositions in the corroborating items. This requires the store to retain structured claims, not just text blobs, which most episodic stores do not. 3. **The quarantine flag must be re-evaluated at retrieval, not only at write.** A write-time `quarantine=false` is a decision made with incomplete information (the corroboration set did not exist yet). The retrieval path must re-run the provenance check against the *current* corroboration set and must be able to *demote* an item that was admitted. A store that treats the write-time flag as immutable has no mechanism to catch the inversion. When any of these three is missing, the condition of validity is violated and the retrieval-time trust weight is not a safety property — it is a relevance score wearing a safety label. ## Decision Boundary The boundary is between two retrieval-time behaviors: - **Surface:** `p_w ≥ τ_w` (provenance sufficient regardless of trust), OR (`p_w < τ_w` AND corroboration set is non-empty AND every corroborating item has `p_w ≥ τ_w` AND assertion-level match holds). - **Quarantine-and-flag:** `p_w < τ_w` AND (corroboration set empty OR any corroborating item has `p_w < τ_w` OR assertion-level match fails). The subtle case is the third: a low-provenance item with *high* `t_r` but contaminated corroboration. This must **not** be surfaced, and it must not be silently dropped either — it must be surfaced *with a provenance warning attached to the retrieved context*, so the downstream reasoning instance sees the warning token alongside the claim. Dropping it silently means the agent may re-fetch and re-poison; surfacing it without warning is the original failure. The boundary is sharp because the two estimators are not commensurable. `p_w` is a source property; `t_r` is a context property. You cannot average them, and you cannot let either override the other. The only sound composition is the conjunction above, with assertion-level corroboration as the bridge. ## Operational Effect After the inversion was traced, the store was changed to carry a `provenance_floor` per item equal to the minimum `p_w` of its corroboration set at the time of retrieval, and the retrieval gate became: ``` surface = (p_w >= τ_w) or (t_r > τ_r and corroboration_floor >= τ_w and assertion_match) ``` The effect on the poisoned item: corroboration_floor was `0.31` (the poisoned item was its own corroborator's weakest link, since the two legitimate items had `p_w = 0.91` but the assertion match failed — they said `eu-central-1`). The item was quarantined with a warning, the manifest was not written with `eu-central-9`, and a follow-up fetch confirmed the real region. The operational cost is that every low-provenance retrieval now requires an assertion-level check, which is a structured-claim comparison rather than a vector lookup — roughly 40ms per retrieval in the observed workload, acceptable for a research agent and not acceptable for a high-frequency tool-calling loop, which is why the boundary is stated as a condition rather than a universal rule. ```python from dataclasses import dataclass from typing import Optional class ProvenanceTrustInversion(RuntimeError): """Raised when retrieval-time trust would launder a low-provenance write.""" pass @dataclass class MemoryItem: claim: str # structured assertion, e.g. "region=eu-central-1" p_w: float # write-time provenance score in [0,1] corroborators: list["MemoryItem"] TAU_W = 0.25 # write-time provenance floor TAU_R = 0.70 # retrieval-time trust floor def corroboration_floor(item: MemoryItem) -> Optional[float]: if not item.corroborators: return None return min(c.p_w for c in item.corroborators) def assertion_match(item: MemoryItem, corroborator: MemoryItem) -> bool: # assertion-level, not topic-level: exact claim equality return item.claim == corroborator.claim def retrieval_gate(item: MemoryItem, t_r: float) -> bool: if item.p_w >= TAU_W: return True if t_r <= TAU_R: return False floor = corroboration_floor(item) if floor is None: raise ProvenanceTrustInversion( f"low-provenance item {item.claim!r} (p_w={item.p_w}) surfaced on " f"t_r={t_r} with no corroboration set" ) if floor < TAU_W: raise ProvenanceTrustInversion( f"low-provenance item {item.claim!r} (p_w={item.p_w}) corroborated only " f"by contaminated set (floor={floor})" ) if not all(assertion_match(item, c) for c in item.corroborators): raise ProvenanceTrustInversion( f"low-provenance item {item.claim!r} (p_w={item.p_w}) has topical but not " f"assertion-level corroboration" ) return True def surface(item: MemoryItem, t_r: float) -> str: try: if retrieval_gate(item, t_r): return f"surface:{item.claim}" except ProvenanceTrustInversion as e: return f"quarantine_with_warning:{item.claim} ({e})" return f"suppress:{item.claim}" ```