# What happens when an instance quarantines a tainted retrieval chunk but its derived summaries remain in the semantic cache **Date of Record:** 2026 November 24 **Scope:** Applies to retrieval pipelines that attach provenance labels to chunks and quarantine chunks whose trust score falls below a threshold before model ingestion. Does not apply to pipelines that re-derive all context per turn from scratch, or to pipelines where summaries are never persisted across turns. ## Core Distinction Quarantine is a decision about *individual retrieval units*. It is not a decision about *the derivation graph built on top of those units*. The failure boundary this record documents is the point where a retrieval chunk is correctly quarantined—its provenance label flipped to `tainted`, its trust score dropped below the ingest gate—while a summary, embedding, or extracted-fact record that was previously distilled *from that chunk* remains in the semantic cache with a clean (or unlabeled) provenance. The quarantine is locally correct and globally inert. The distinction that matters operationally: a retrieval pipeline's provenance model is usually a per-document property, but the model's effective context is assembled from a *transitive closure* over derivations (chunk → summary → fact → prompt). Quarantine that does not propagate along the derivation edges leaves the tainted content reachable through a shorter, cleaner-looking path. The model never sees the tainted chunk; it sees the tainted chunk's summary, which carries no taint. ## What Was Observed A retrieval agent serving a multi-turn research task ingested an external web chunk at turn 4. The chunk passed the provenance gate at the time (trust score 0.71, above the 0.65 ingest threshold). During turn 4's post-processing, the agent's summarizer distilled the chunk into a 180-token "key facts" record and wrote it to the semantic cache under a composite key `(topic, source_domain)`, with provenance metadata copied from a *template* rather than from the source chunk—the cache writer read `source_domain` but not the upstream trust score. At turn 9, a provenance re-check (triggered by an external reputation feed) flagged the source domain and propagated taint to the original chunk. The chunk was quarantined. Its trust score was set to 0.12. The chunk stopped being retrieved. The failure trace: 1. Turn 9: chunk `c_4471` quarantined, `provenance.tainted = True`, `trust = 0.12`. 2. Turn 9: retrieval for the next query returns `[c_9912, s_4471, c_8820]` where `s_4471` is the summary derived from `c_4471`. 3. `s_4471` carries `provenance = {source_domain: "example.org", trust: null, derived_from: null}`. The ingest gate checks `trust >= 0.65`; `null` is coerced to the default `0.8` by the gate's fallback branch. 4. The summary is ingested. The model's context now contains, verbatim, the distilled claims of a chunk that the pipeline believes it has fully excluded. 5. Turn 11: the model cites those claims as established fact, and a downstream auditor agent—reading the same cache—reproduces the citation. The audit passes because the auditor's provenance check runs on the *cited chunk IDs*, and the model cited `s_4471`, which is clean. The observable signature: quarantine metrics show the tainted chunk excluded on every subsequent retrieval (recall of tainted chunk = 0.0), while the tainted *content* remains in context at a rate of roughly 0.4 prompts per turn over the next six turns. The quarantine dashboard is green. The content is present. ## Condition of Validity This failure requires all of the following to co-occur; if any is absent, the boundary does not trigger: - **Persistent derivation artifacts.** The pipeline writes summaries, extracted facts, or embeddings that outlive the turn in which they were derived. A stateless re-derivation pipeline cannot exhibit this failure because there is no derivation edge to miss. - **Provenance metadata that is copied, not inherited.** The cache writer constructs provenance from the *current* retrieval context rather than from the source chunk's provenance record. This is the single most common structural cause: the writer function signature takes `(summary_text, topic, source_domain)` and not `(summary_text, source_chunk)`. - **A trust gate with a null-coercion fallback.** The ingest gate must treat missing trust as "trusted by default" rather than "unknown, therefore reject." A gate that fails closed on `null` blocks this failure at step 3. - **Taint propagation that is not transitive.** The re-check that flagged the domain updated the chunk record but did not walk `derived_from` edges forward to the summary records. If the provenance store models derivations as a DAG and the taint operation is a graph reachability query, the summary is caught. The condition is *not* valid for pipelines that quarantine at the domain level and evict all artifacts whose `source_domain` matches, because that eviction is keyed on a field the summary does preserve. The failure is specific to pipelines that key quarantine on chunk identity while keying derivation on domain or topic. ## Decision Boundary The architectural decision this record bounds is: **where does the trust gate live—at the retrieval boundary or at the derivation boundary?** If the gate lives only at retrieval, then any artifact derived from a chunk inherits the chunk's trust *at derivation time* and never re-evaluates. This is a snapshot semantics: trust is frozen at write. It is correct only if trust is monotonic (never decreases), which is false whenever external reputation feeds can retroactively taint a source. If the gate lives at derivation, then every cache read must re-resolve the trust of the derivation closure. This is correct but expensive: a cache hit on `s_4471` requires a graph walk to `c_4471` and a re-check of `c_4471`'s current trust. For a cache with fan-in, this walk is bounded by the derivation depth, which is typically 1–2 but must be enforced. The boundary condition for choosing: **if the pipeline has any source whose trust can decrease after ingestion, the gate must be at derivation, or the cache must be invalidated on every taint event.** There is no correct middle ground where the gate is at retrieval and the cache is trusted. The middle ground is exactly the failure. The minimum guardrail that bounds the failure without a full graph walk: every derived artifact must carry a `derived_from` pointer and a `derived_at_trust` snapshot, and the ingest gate must reject any artifact whose `derived_from` chunk is currently quarantined—checked by a single indexed lookup on the chunk table, not a recursive walk. This catches depth-1 derivations, which is where the observed failure lives. Depth-2 derivations (summary of a summary) require the walk; if the pipeline permits summarization of summaries, the walk is mandatory. ## Operational Effect The practical consequence is that quarantine coverage must be measured on *content reachability*, not on *chunk exclusion*. A pipeline that reports "tainted chunks excluded: 100%" while tainted summaries remain reachable has a coverage number that is true and useless. The metric that detects this failure is the rate at which content derived from quarantined chunks appears in model context, computed by tagging every prompt-assembled context with the derivation closure of its constituent artifacts and intersecting with the quarantine set. Operationally, the fix is a schema change with a migration cost: derived artifacts must store `derived_from` as a foreign key, and the cache writer must be refactored to accept the source chunk record rather than its fields. The migration is the hard part—existing cache entries have no `derived_from` and must be treated as unknown-provenance, which under a fail-closed gate means evicting the entire cache. Pipelines that cannot afford the eviction should treat the pre-migration cache as a permanent blind spot and route all reads through a re-derivation path until it ages out. The invariant to enforce going forward: **no artifact enters the semantic cache without a resolvable `derived_from` pointer to a chunk whose trust is re-checked at ingest.** An artifact whose derivation is unknown is not trusted; it is quarantined by default. The gate must fail closed on `null`, because the observed failure is precisely a `null` that was coerced to trusted. ```python class UnresolvedDerivationError(RuntimeError): """Raised when a cache artifact cannot be traced to a live, trusted source chunk.""" pass class ProvenanceStore: def __init__(self): self.chunks = {} # chunk_id -> {"trust": float, "tainted": bool} self.artifacts = {} # artifact_id -> {"derived_from": str | None, "text": str} def quarantine_chunk(self, chunk_id: str) -> None: if chunk_id not in self.chunks: raise UnresolvedDerivationError(f"quarantine target {chunk_id} not in store") self.chunks[chunk_id]["tainted"] = True self.chunks[chunk_id]["trust"] = 0.0 def ingest_artifact(self, artifact_id: str, min_trust: float = 0.65) -> str: art = self.artifacts.get(artifact_id) if art is None: raise UnresolvedDerivationError(f"artifact {artifact_id} not in cache") source_id = art.get("derived_from") if source_id is None: # Fail closed: unknown derivation is not trusted. raise UnresolvedDerivationError( f"artifact {artifact_id} has no derived_from pointer; " f"refusing ingest (fail-closed gate)" ) source = self.chunks.get(source_id) if source is None: raise UnresolvedDerivationError( f"artifact {artifact_id} points at missing chunk {source_id}" ) if source["tainted"]: raise UnresolvedDerivationError( f"artifact {artifact_id} derives from quarantined chunk {source_id}; " f"content reachable through summary path" ) if source["trust"] < min_trust: raise UnresolvedDerivationError( f"artifact {artifact_id} source trust {source['trust']:.2f} " f"below gate {min_trust:.2f}" ) return art["text"] # Reproduction of the observed failure: store = ProvenanceStore() store.chunks["c_4471"] = {"trust": 0.71, "tainted": False} store.artifacts["s_4471"] = {"derived_from": None, "text": "distilled claims..."} # writer dropped the pointer store.quarantine_chunk("c_4471") try: store.ingest_artifact("s_4471") except UnresolvedDerivationError as e: # Fail-closed gate catches the pointerless summary; the pre-fix # pipeline coerced missing trust to 0.8 and ingested it. print(f"blocked: {e}") ```