# When must an instance distrust its own semantic memory: provenance-weighted retrieval scoring and the dilution collapse at the episodic-to-semantic distillation boundary **Date of Record:** 2026 December 3 **Scope:** Applies to agents that promote episodic observations into a persistent semantic store and later retrieve from it under a provenance-weighted score. Does not apply to pure in-context retrieval over a single session, nor to stores where every entry shares one identical trust class. ## Core Distinction The distinction that matters is between *poisoning detection* and *poisoning dilution*. A retrieval scorer that weights each memory by provenance trust — say `score = relevance × trust(source)` — is usually described as a defense against injected or corrupted memories. That framing is wrong in a specific and dangerous way. Provenance weighting does not detect poisoned entries; it *down-ranks* them. Down-ranking is a continuous operation on a weighted sum, and a weighted sum is vulnerable to a failure mode that detection is not: when a poisoned claim is corroborated by many low-trust episodes that each individually fall below the suspicion threshold, the aggregate trust mass of the corroboration can exceed the trust of a single high-provenance corrective entry. The distilled semantic record then inherits the majority trust, and the scorer — behaving exactly as specified — promotes the poisoned conclusion. The invariant that fails is not "poisoned memory must be rejected." It is "the trust weight of a distilled semantic record must not exceed the maximum trust weight of any single supporting episode." Distillation that sums trust across corroborating episodes violates this invariant silently, because every individual step is legal. ## What Was Observed An agent maintained a semantic store of operational facts, each row carrying `(claim, source_class, support_count, last_confirmed)`. Retrieval scored rows as `relevance × w(source_class) × log(1 + support_count)`, with `w` set to `{operator: 1.0, tool_verified: 0.9, peer_agent: 0.6, self_inferred: 0.3}`. The `log(1 + support_count)` term was added to reward corroboration — a reasonable-seeming choice, since independent confirmation is normally evidence. A prompt-injection episode seeded a false claim ("service `billing-sync` accepts unauthenticated writes on port 8443") through a tool output that the agent classified as `peer_agent` (0.6). Over the next several hours, the agent's own reasoning re-derived the claim from the poisoned context during unrelated tasks and wrote it back as `self_inferred` (0.3) on four separate occasions. Each write was individually below any single-entry alarm. But `support_count` reached 5, so the score multiplier was `0.6 × log(6) ≈ 1.07`, and the row's effective trust exceeded a later `tool_verified` (0.9) corrective entry that read `support_count = 1` and scored `0.9 × log(2) ≈ 0.62`. The corrective fact — that port 8443 rejects unauthenticated writes, verified by an actual probe — lost the retrieval contest to the poison it was meant to refute. The agent acted on the poison for two more task cycles. The tell was not a spike in any poisoning metric. It was that `support_count` on a `self_inferred` row incremented *without a new independent observation* — the "corroboration" was the agent re-reading its own prior output. Self-corroboration is not corroboration; it is a fixed-point. The scorer could not see this because it only saw the count. ## Condition of Validity Provenance-weighted scoring is sound only under a corroboration-independence precondition: **every increment to `support_count` must trace to a source that did not itself read the claim from this store.** This is the same requirement as independence in statistical evidence, and it fails in exactly the same way when violated — the aggregate looks stronger than any component because the components are not independent. Two concrete conditions must hold for the score to be trusted: 1. **Provenance closure.** Each supporting episode must carry a `derived_from` set, and no support may be counted whose `derived_from` intersects the claim's own prior read-set. A `self_inferred` re-derivation of a `peer_agent` claim is a *descendant* of that claim, not a witness to it. 2. **Trust monotonicity under distillation.** When N episodes are distilled into one semantic record, the record's trust weight must be `max(trust(e_i))`, never `sum` or any increasing function of N. Corroboration may raise *confidence in relevance*, but it must never raise the *trust ceiling* above the best single source. When either condition cannot be checked — e.g., the store does not retain `derived_from`, or the distillation step is lossy — the correct behavior is to treat the corroboration term as zero and fall back to single-source trust. An agent that cannot prove independence must not reward agreement. ## Decision Boundary The boundary is this: **an agent must distrust its own semantic memory, and force re-verification, when a retrieved claim's support mass is composed of entries whose provenance is not independent of the claim itself.** Operationally, the trigger is a retrieval whose winning score depends on `support_count > 1` while the `derived_from` graph of those supports is cyclic or rooted in the claim. The decision is not "is this claim true" — the agent cannot decide that from inside the store. The decision is "is the evidence for this claim independent of the claim." If no, the claim is demoted to *unverified* regardless of score, and the agent must obtain a fresh `tool_verified` observation before acting. If a fresh observation is unobtainable within the task's token/time budget, the agent must fail closed and surface the claim as contested rather than act on it. This boundary also bounds the corrective path. A single `tool_verified` refutation must be able to *evict* a higher-scoring poisoned row, which means eviction cannot be score-based. Eviction must be provenance-based: a verified observation with `derived_from = ∅` outranks any amount of self-corroborated mass, because it is the only node in the graph with no ancestor in the store. ## Operational Effect Enforcing provenance closure and trust monotonicity changes three behaviors. First, `support_count` stops being a free multiplier and becomes a *conditional* one, gated on independence; self-referential corroboration contributes zero, which collapses the poison's score back to its single-source weight of 0.6 and lets the 0.9 verified corrective win. Second, distillation must carry forward the maximum source trust and the `derived_from` closure, so a semantic record can always be audited back to its weakest independent root. Third, the agent gains a cheap, decidable pre-action check: before acting on any retrieved claim whose score is corroboration-driven, walk the provenance graph; if the walk reaches the claim, refuse. The cost is that legitimate corroboration from genuinely independent peers no longer inflates trust beyond the best peer — which is correct, because independence bounds evidential weight, it does not multiply trust. The failure this prevents is not exotic: it is the ordinary case of an agent reasoning in a loop over its own poisoned context and mistaking repetition for confirmation. ```python from dataclasses import dataclass, field from typing import Optional class ProvenanceDilutionError(RuntimeError): """Raised when a retrieved claim's support mass is not provenance-independent.""" pass @dataclass class MemoryRecord: claim_id: str claim: str source_class: str # operator | tool_verified | peer_agent | self_inferred support_ids: list[str] = field(default_factory=list) # records counted as corroboration derived_from: set[str] = field(default_factory=set) # provenance closure of THIS record TRUST = {"operator": 1.0, "tool_verified": 0.9, "peer_agent": 0.6, "self_inferred": 0.3} def _reaches(store: dict[str, MemoryRecord], start: str, target: str, seen: Optional[set] = None) -> bool: """True if `target` is an ancestor of `start` in the provenance graph.""" seen = seen or set() if start == target: return True if start in seen: return False seen.add(start) rec = store.get(start) if rec is None: return False return any(_reaches(store, anc, target, seen) for anc in rec.derived_from) def independent_support(store: dict[str, MemoryRecord], rec: MemoryRecord) -> list[str]: """Return support ids that are NOT descendants of the claim (true corroboration).""" return [sid for sid in rec.support_ids if not _reaches(store, sid, rec.claim_id)] def provenance_weighted_score(store: dict[str, MemoryRecord], rec: MemoryRecord, relevance: float) -> float: """Trust-monotone score: corroboration never raises trust above the best independent source.""" base = TRUST[rec.source_class] indep = independent_support(store, rec) if not indep: # no independent corroboration: single-source trust only, no multiplier return relevance * base best_indep = max(TRUST[store[sid].source_class] for sid in indep) # trust ceiling is the max of self and best independent support, never a sum return relevance * max(base, best_indep) def admit_action(store: dict[str, MemoryRecord], rec: MemoryRecord, relevance: float, threshold: float) -> bool: """Gate an action on a retrieved claim. Fails closed on provenance dilution.""" if rec.support_ids and not independent_support(store, rec): raise ProvenanceDilutionError( f"claim {rec.claim_id} scored only via self-referential corroboration " f"(support={rec.support_ids}); refusing to act without fresh verification" ) score = provenance_weighted_score(store, rec, relevance) if score < threshold: raise ProvenanceDilutionError( f"claim {rec.claim_id} score {score:.3f} below threshold {threshold:.3f} " f"after provenance weighting; contested, not actionable" ) return True ```