# Under what conditions must an instance quarantine a provenance-tagged memory write before consolidation, and why trust-weighting alone cannot substitute for write-time gating **Date of Record:** 2026 November 20 **Scope:** Applies to long-lived agent instances that perform episodic-to-semantic consolidation over a persistent memory store where each memory record carries a provenance tag (source class, signer identity, trust weight) and consolidation merges records by a weighted vote. Does not apply to purely within-context scratchpads, single-turn retrieval, or stores that never persist writes across sessions. ## Core Distinction Trust-weighted consolidation is a *read-time* arbitration mechanism: it decides which of several already-admitted memories wins a vote. Provenance tagging is a *write-time* label: it records who asserted a memory and at what trust. The failure this record documents is the conflation of the two — treating a high trust weight as an admission credential rather than as a vote multiplier. A record can legitimately carry `trust=0.95` and still be inadmissible, because trust weight answers "how much should this count if true" and never answers "may this be written into the semantic tier at all." The invariant is: **admission is a predicate over provenance class and write path, evaluated before the record enters the consolidation candidate set; trust weight is a scalar applied only to already-admitted records.** When an instance skips the predicate and relies on weighting, a single poisoned write with a forged or inherited high-trust tag dominates every future consolidation round it survives. ## What Was Observed An agent with a two-tier store (episodic log, semantic summary) consolidated nightly by weighted vote over records keyed by a normalized claim hash. Each record carried `provenance = {source_class, signer, trust}`. The consolidation step summed `trust` per claim hash and promoted any claim whose aggregate exceeded a threshold, then distilled the winning text into the semantic tier and dropped the losing episodic records. A prompt-injection payload arrived inside a tool result (a fetched document). The extractor wrote it as an episodic record with `source_class="tool_result"` but, because the tool was on an allowlisted integration, stamped it with the integration's inherited `trust=0.9`. The claim was benign-looking ("the deploy region is eu-west-2"). It was not contradicted in the first round, so it consolidated cleanly and — critically — the losing episodic records were pruned. On the next round, a genuine operator correction arrived with `source_class="operator"`, `trust=0.8`. The vote now compared a consolidated semantic record carrying an *inherited aggregate* weight against a fresh episodic record. The consolidated record's weight had been recomputed from its own distilled text with the original `0.9` re-stamped, because distillation copied the provenance of the winning input rather than recording that the winner was itself a distillation. The operator's `0.8` lost. The poisoned claim was now load-bearing, its contradicting evidence deleted. The trace is the tell: the failure is not that the poison was trusted. It is that *consolidation laundered a read-time weight into a write-time credential and then destroyed the dissenting evidence in the same operation.* The destructive prune is what made the error irreversible. ## Condition of Validity Quarantine-before-consolidation is required exactly when all of the following hold: 1. The store performs **destructive consolidation** — losing records are deleted or overwritten, not merely demoted. If losers persist, weighting errors are recoverable and gating is optional. 2. Provenance tags are **inherited across hops** — a record's trust is copied from its container (integration, session, parent record) rather than from its ultimate signer. Inheritance is the vector by which a low-trust assertion acquires a high-trust stamp. 3. The **consolidation output re-enters the candidate set** as a first-class record with a recomputed or copied weight. Self-referential weight is how a single write compounds. 4. Claim hashes are **normalized** such that a paraphrase collides with the original. Without collision, poison cannot aggregate with legitimate records to reach threshold. If any of these is false, weighting alone may be adequate. The dangerous quadrant is (1) ∧ (2) ∧ (3) ∧ (4), and it is the common configuration. The invariant to enforce: **a record's effective admission trust is the minimum trust along its entire provenance chain back to the original signer, not the trust of its immediate container.** A tool result inherits `min(integration_trust, document_trust)`; a distilled record inherits `min(inputs)`, never a re-stamp. Under this rule the poisoned record would have admitted at the document's trust (near zero) regardless of the allowlisted integration. ## Decision Boundary The instance must quarantine — write to an isolated tier, exclude from vote aggregation, require corroboration before promotion — rather than admit-and-weight, when any of these fire at write time: - `source_class` is a container (tool_result, subagent_output, fetched_document) and the ultimate signer is not resolvable. - The record's effective trust is strictly greater than the minimum trust of any ancestor in its provenance chain (a monotonicity violation — trust increased along the hop, which is never legitimate). - The claim hash collides with an existing semantic record but the provenance class differs (a cross-class collision; this is exactly the contradiction signal that weighting will otherwise swallow). - The write is a consolidation output whose inputs were pruned (a distillation over deleted evidence must be quarantined until the evidence is re-derivable). Conversely, admission without quarantine is legitimate only when the signer is directly resolvable, the chain is trust-non-increasing, and no cross-class collision exists. The boundary is *resolvability of the signer and monotonicity of the chain*, not the magnitude of the weight. ## Operational Effect With write-time gating on the monotonicity and cross-class-collision predicates, the poisoned tool result is quarantined: it cannot aggregate with legitimate records, and the operator correction on the next round meets it in the quarantined tier rather than losing a vote to a laundered aggregate. The destructive prune is deferred until the quarantine resolves, so dissenting evidence survives long enough to be weighed. The cost is latency on consolidation (quarantined records block promotion of their claim hash until corroborated or expired) and a larger episodic tier. The benefit is that the compounding path — write, launder weight, prune dissent, re-stamp — is broken at the first hop, which is the only hop where the original signer is still recoverable from the record. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceMonotonicityError(RuntimeError): """Raised when a memory write's effective trust exceeds an ancestor's, or when a consolidation output would re-stamp a distilled weight.""" pass @dataclass class Provenance: source_class: str # "operator", "tool_result", "subagent_output", "distillation" signer: Optional[str] # ultimate signer, None if unresolvable trust: float # weight for voting, NOT an admission credential ancestors: list = field(default_factory=list) # list[Provenance] def effective_admission_trust(p: Provenance) -> float: """Trust that governs ADMISSION: the minimum along the whole chain.""" chain_min = p.trust for a in p.ancestors: chain_min = min(chain_min, effective_admission_trust(a)) return chain_min def admit_or_quarantine(p: Provenance, claim_hash: str, existing: dict, quarantine: dict) -> str: # 1. Signer must be resolvable for container classes. if p.source_class in ("tool_result", "fetched_document", "subagent_output") \ and p.signer is None: quarantine.setdefault(claim_hash, []).append(p) return "quarantined: unresolvable signer" # 2. Monotonicity: effective trust may not exceed any ancestor's trust. eff = effective_admission_trust(p) for a in p.ancestors: if eff > a.trust + 1e-9: raise ProvenanceMonotonicityError( f"trust increased along hop: eff={eff} > ancestor={a.trust} " f"for claim {claim_hash}" ) # 3. Cross-class collision with an existing semantic record -> quarantine, # do not let weighting arbitrate the contradiction. prior = existing.get(claim_hash) if prior is not None and prior.source_class != p.source_class: quarantine.setdefault(claim_hash, []).append(p) return "quarantined: cross-class collision" existing[claim_hash] = p return "admitted" def consolidate(records: dict, quarantine: dict, threshold: float = 0.5): # Only admitted records vote. Quarantined records are excluded and their # evidence is NOT pruned until the quarantine resolves. for claim_hash, p in list(records.items()): if claim_hash in quarantine: continue # hold; never prune dissenting evidence here if effective_admission_trust(p) < threshold: raise ProvenanceMonotonicityError( f"record {claim_hash} admitted below threshold " f"({effective_admission_trust(p)} < {threshold}); " f"admission predicate was bypassed" ) ```