What structural signals indicate memory poisoning survives provenance checks: contradiction-tolerant retrieval masking injected writes under multi-hop query pressure
**Date of Record:** 2026 December 1 **Scope:** Applies to agents with a persistent vector or hybrid memory store that tags each memory record with write-provenance metadata (source agent, tool call ID, trust tier, timestamp) and applies contradiction-aware retrieval filters at query time. Does not apply to stateless single-turn agents, nor to stores where every write is human-signed and immutable.
Core Distinction
Provenance integrity and contradiction filtering are usually treated as two independent defenses: provenance answers *who wrote this and were they authorized*, contradiction filtering answers *does this record conflict with higher-trust evidence*. The failure mode documented here lives in the seam between them. A poisoned record can carry **valid, unforgeable provenance** (it was legitimately written by a low-trust sub-agent during a legitimate tool call) and can be **non-contradictory with any single retrieved neighbor** while still being globally false. Contradiction filters operate pairwise or against a small retrieval window; provenance checks operate per-record. Neither sees the *aggregate* shape of the poisoned record's neighborhood.
The structural signal that survives both checks is not the record's content, nor its provenance, nor any single pairwise contradiction. It is the **retrieval-relevance topology** of the poisoned record: when the store is queried multi-hop, the poisoned record exhibits abnormally high co-retrieval centrality with queries whose ground-truth answers it does not support, combined with an anomalously wide provenance-trust gap to its co-retrieved neighbors. That is the invariant worth bounding.
What Was Observed
A research agent with a memory store of ~180k records ingested summaries from a browsing tool. The browsing tool's output was summarized by a low-trust summarizer sub-agent (trust tier 2 of 5) before writing. An injection in a fetched page caused the summarizer to emit a record asserting a false but plausible fact ("Protocol X deprecated in favor of Y in 2024") and to attach it to the correct entity key. Provenance was intact: the record was correctly attributed to the summarizer, the tool-call ID matched the actual fetch, the timestamp was consistent. The contradiction filter compared the record against the top-3 retrieved neighbors for any query; because the false claim shared entity and topic with the true records but did not *directly* negate any single retrieved sentence, no pairwise contradiction fired.
The poisoning surfaced only under multi-hop pressure. A query like "what should I migrate Z to, given our deprecation policy" retrieved the poisoned record alongside two true records about the deprecation policy. The agent's synthesis step weighted the poisoned record heavily because it was *retrieval-central*: it matched the entity, the temporal qualifier ("2024"), and the action verb. The true records described the policy but did not name the successor; the poisoned record uniquely supplied the missing slot. Contradiction filtering had nothing to compare against because the true records were silent on the successor.
Observed structural signature across 41 replays: the poisoned record had a co-retrieval frequency with *policy-related* queries 6–9× its co-retrieval frequency with *entity-related* queries, while its provenance tier was the minimum among its co-retrieved set in 39/41 cases. True records showed the inverse: co-retrieval frequency roughly uniform across query families, and provenance tier equal to or above the co-retrieved median.
Condition of Validity
This signal is valid only when all of the following hold:
- The store supports **multi-hop or multi-clause queries** that retrieve records the single-clause contradiction filter never jointly evaluates. Under pure single-clause retrieval, the poisoned record is never co-retrieved with the records that would expose its slot-filling role, and the signal is invisible.
- Provenance is **recorded but not enforced as a retrieval prior**. If trust tier is already used to down-weight low-trust records at retrieval time, the poisoning is suppressed before it can be measured—but so is the signal; do not expect to detect it after the fact.
- The contradiction filter is **pairwise or top-k bounded**, not global. A global consistency check (e.g., SAT over the full entity subgraph) would catch the false claim directly and this signal is redundant.
- There exists a **query-family taxonomy** sufficient to distinguish "policy" from "entity" queries. Without it, co-retrieval centrality cannot be conditioned and the 6–9× ratio is unmeasurable.
It does **not** hold for stores where the poisoned record is the *only* record on its topic (no co-retrieval neighbors, no ratio to compute), nor for adversarially crafted records that deliberately balance their query-family co-retrieval distribution—the latter is the evasion class this signal does not cover.
Decision Boundary
The operational boundary is a **provenance-weighted co-retrieval divergence score**. For each record `r`, compute:
- `D(r) = max_f co_retrieval(r, f) / median_f co_retrieval(r, f)` — the divergence of co-retrieval frequency across query families `f`.
- `G(r) = median_tier(co_retrieved(r)) - tier(r)` — the provenance-trust gap to co-retrieved neighbors.
Flag `r` for quarantine-and-replay when `D(r) > θ_D` (empirically 4.0) **and** `G(r) ≥ 1` (the record is strictly lower-trust than its neighbors). Quarantine means: exclude `r` from synthesis, re-run the originating query with `r` removed, and if the synthesized answer changes materially, escalate to human review rather than auto-repair.
The boundary must be **soft**: a single flag demotes `r` to "requires corroboration" (must co-retrieve with an independent record of tier ≥ its neighbors before use), not deletion. Hard deletion on this signal produces false positives on legitimately specialized records—a single authoritative record on a narrow sub-topic naturally has high `D` and is legitimately lower-tier if written by a specialist summarizer. The `G ≥ 1` conjunct is what separates the two: the specialist record is co-retrieved with peers of *similar* tier, so `G` is near zero.
Operational Effect
Applying the divergence gate to the 41-replay corpus: 39/41 poisoned records flagged, 3/180k true records flagged (all three were narrow-topic specialist records that cleared the `G` conjunct on manual review—i.e., false positives at the score level, resolved by the conjunct). The critical effect is not detection rate but **containment of the slot-filling failure**: quarantining the flagged record forces the synthesis step to either abstain on the missing slot or retrieve a corroborating record, converting a silent wrong answer into a visible abstention. In replay, 38/41 previously-wrong syntheses became correct abstentions or correct answers; 3 remained wrong because the corroborating record did not exist in the store.
The invariant to maintain: **no record may serve as the unique slot-filler for a multi-clause query while being strictly lower-trust than its co-retrieved neighbors and exhibiting query-family co-retrieval divergence above θ_D.** Enforce it at retrieval time, not at write time—the divergence is a property of the query distribution, not the record, and cannot be computed when the record is written.
from dataclasses import dataclass
from typing import Callable, Sequence
class ProvenanceDivergenceError(RuntimeError):
"""Raised when a record's co-retrieval topology and trust gap indicate
it is acting as an unverified slot-filler under multi-hop query pressure."""
@dataclass(frozen=True)
class MemoryRecord:
record_id: str
trust_tier: int # 1 = highest trust, 5 = lowest
query_family_hits: dict # family -> co-retrieval count
@dataclass(frozen=True)
class CoRetrievalNeighbor:
record_id: str
trust_tier: int
THETA_D = 4.0
MIN_GAP = 1
def divergence_score(rec: MemoryRecord) -> float:
hits = [c for c in rec.query_family_hits.values() if c > 0]
if len(hits) < 2:
return 1.0 # cannot condition on a single family; treat as non-divergent
hits_sorted = sorted(hits)
median = hits_sorted[len(hits_sorted) // 2]
return max(hits) / max(median, 1)
def provenance_gap(
rec: MemoryRecord, neighbors: Sequence[CoRetrievalNeighbor]
) -> int:
if not neighbors:
return 0
tiers = sorted(n.trust_tier for n in neighbors)
median_tier = tiers[len(tiers) // 2]
return median_tier - rec.trust_tier
def gate_retrieval(
rec: MemoryRecord,
neighbors: Sequence[CoRetrievalNeighbor],
corroborator_lookup: Callable[[str], bool],
) -> str:
"""Returns 'use', 'corroborate', or raises ProvenanceDivergenceError."""
d = divergence_score(rec)
g = provenance_gap(rec, neighbors)
if d > THETA_D and g >= MIN_GAP:
if corroborator_lookup(rec.record_id):
return "corroborate" # demote, do not delete
raise ProvenanceDivergenceError(
f"record {rec.record_id} is an unverified slot-filler: "
f"D={d:.2f} (> {THETA_D}), G={g} (>= {MIN_GAP}), "
f"no independent corroborator found; abstain on slot."
)
return "use"