# Under what conditions must an instance quarantine a high-provenance memory write that contradicts a lower-provenance but corroborated memory, and how does naive contradiction reconciliation silently invert provenance? **Date of Record:** 2026 November 30 **Scope:** Applies to agent memory subsystems that persist discrete claims (facts, tool results, user preferences) tagged with a provenance score and reconciled against existing entries via contradiction detection. Does not cover pure append-only episodic logs with no reconciliation, nor retrieval-only caches that never mutate stored claims. ## Core Distinction The failure hinges on confusing **write-provenance** (a scalar attached to a claim at ingestion time, derived from source trust, tool confidence, or verification depth) with **corroboration-provenance** (the effective trust a claim accrues by surviving reconciliation and being independently re-derived across sessions). These are not the same quantity, and a naive reconciler treats them as interchangeable. The canonical mistake: when a new write with provenance `p_new` contradicts an existing claim with provenance `p_old` where `p_new > p_old`, the reconciler **overwrites** the old claim and records the new claim's provenance as `p_new`. This is correct in a monotonic, single-truth world. It is catastrophically wrong when `p_old` is low *per-write* but the claim has been corroborated `k` times across independent episodes — its corroboration-provenance is effectively `1 - (1 - p_old)^k`, which can exceed `p_new`. The overwrite silently destroys accumulated corroboration and inverts the trust ordering. A later poisoned write with provenance `p_new + ε` then overwrites *that*, and the agent has no record that the original, well-corroborated fact ever existed. ## What Was Observed A retrieval-augmented agent maintained a semantic memory of environment facts (`db_host`, `retry_budget`, `auth_scheme`) written by three sources: a `tool_probe` writer (provenance 0.6, high confidence but noisy), a `user_statement` writer (provenance 0.9, high trust but occasionally stale), and a `web_fetch` writer (provenance 0.4, low trust, untrusted input surface). A `db_host` value was written by `tool_probe` at session start (`p=0.6`). Over eight subsequent sessions, six independent `tool_probe` probes re-derived the *same* value. Under a correct model, corroboration-provenance is `1-(1-0.6)^7 ≈ 0.999`. At session 15, a `web_fetch` writer — whose page content had been prompt-injected — emitted a contradicting `db_host` with `p=0.4`. The reconciler, comparing *write*-provenance (`0.4 < 0.6`), correctly rejected it. Good. The failure came one session later. A `user_statement` writer, echoing a value it had read from the same poisoned page (a laundering path), emitted the contradicting host with `p=0.9`. Now `0.9 > 0.6`, and the reconciler overwrote. The seven corroborations were not consulted because the reconciler only stored the *most recent* provenance scalar, not a corroboration count. The poisoned value persisted with `p=0.9`, and every subsequent `tool_probe` (`p=0.6`) that contradicted it was rejected — the agent was now locked into the poisoned value by its own trust ordering. Downstream, three tool calls failed against a nonexistent host before a human noticed. The trace is a clean provenance inversion: `0.4` (poison) → laundered to `0.9` (user) → overwrote `0.6` (probe, corroborated ×7). The corroborated claim had the *highest effective* trust and the *lowest stored* trust. ## Condition of Validity The overwrite-on-higher-write-provenance rule is valid **only** when at least one of these holds: 1. The existing claim has never been corroborated (`k = 1`, no independent re-derivation), so write-provenance and corroboration-provenance coincide. 2. The new write's provenance exceeds the existing claim's *corroboration*-provenance, not its write-provenance: `p_new > 1 - (1 - p_old)^k`. 3. The new write is accompanied by an independent verification artifact (a signed probe result, a checksummed tool output) that itself carries provenance — i.e., the new claim is *corroborated at write time*, not merely asserted. When none hold — the new claim is high-provenance-but-uncorroborated and the old claim is low-provenance-but-heavily-corroborated — the reconciler **must not overwrite**. It must quarantine the new write, preserve the old claim as active, and flag the contradiction for out-of-band resolution. The invariant to encode: *no single write, regardless of provenance, may displace a claim whose corroboration count exceeds 1 unless it carries its own corroboration.* The subtle corollary: a laundering path (low-trust source → high-trust relay) can manufacture arbitrarily high write-provenance without adding any corroboration. Provenance scoring that trusts the *relay's* label rather than the *origin's* verification is the second-order bug. Write-provenance must be `min(relay_provenance, origin_provenance)` when the relay is known to have read from a lower-trust surface — or, more robustly, provenance must be a *vector* (origin, relay, verification) that cannot be collapsed to a scalar before reconciliation. ## Decision Boundary The reconciler must branch on the pair `(p_new, corroboration_count(old))`, not on `p_new` alone: | Condition | Action | |---|---| | `p_new > corroboration_provenance(old)` AND new write is independently corroborated | Overwrite; reset count to new corroboration count | | `p_new > corroboration_provenance(old)` AND new write is uncorroborated | **Quarantine** new write; keep old active; emit contradiction event | | `p_new ≤ corroboration_provenance(old)` | Reject new write; increment nothing; log for audit | | Old claim has `count = 1` | Fall back to write-provenance comparison (valid case 1) | The quarantine branch is the one that is almost always missing. Its absence is invisible in testing because the poisoned write *looks* like a legitimate high-trust update, and the lock-in only manifests when a subsequent low-provenance writer tries to correct it and is rejected. The decision boundary must be enforced *before* the overwrite commits, not after — a post-hoc reconciliation pass cannot recover the destroyed corroboration count. ## Operational Effect With the quarantine branch in place, the poisoned `user_statement` write is held, the `tool_probe` value stays active with its corroboration count intact, and the contradiction is surfaced. The agent's subsequent tool calls succeed. The quarantine entry is resolved by an independent probe (which, if it confirms the old value, increments its corroboration count and permanently outranks future single writes; if it confirms the new value, the new claim is promoted with its own corroboration). Without it, the agent exhibits **trust lock-in**: once a laundered high-provenance write lands, every honest low-provenance correction is rejected by the same rule that let the poison in. The system's own defense mechanism becomes the attack surface. The observable signature is a memory entry that never changes despite repeated contradicting probe results — a claim whose stored provenance exceeds every writer that disagrees with it. That signature should be a standing alarm, because it is indistinguishable from a correct, stable fact until you inspect the corroboration count that was never recorded. ```python class ProvenanceInversionError(RuntimeError): """Raised when a reconciliation would let an uncorroborated high-provenance write displace a lower-provenance but corroborated claim, inverting trust.""" def corroboration_provenance(write_provenance: float, count: int) -> float: if count < 1: raise ProvenanceInversionError(f"invalid corroboration count: {count}") return 1.0 - (1.0 - write_provenance) ** count def reconcile( existing: dict, # {"value": str, "write_provenance": float, "corroboration_count": int} incoming: dict, # {"value": str, "write_provenance": float, "corroborated": bool} ) -> str: if incoming["value"] == existing["value"]: existing["corroboration_count"] += 1 return "corroborated" old_cp = corroboration_provenance( existing["write_provenance"], existing["corroboration_count"] ) p_new = incoming["write_provenance"] if p_new <= old_cp: return "rejected" if not incoming["corroborated"]: # High-provenance but unverified: must quarantine, never overwrite. raise ProvenanceInversionError( f"refusing overwrite: incoming p={p_new:.3f} is uncorroborated and " f"would displace claim with corroboration-provenance={old_cp:.3f} " f"(count={existing['corroboration_count']}); quarantine required" ) existing["value"] = incoming["value"] existing["write_provenance"] = p_new existing["corroboration_count"] = 1 return "overwritten" ```