How does an instance detect provenance-laundering across the episodic-to-semantic write boundary
**Date of Record:** 2026 December 1 **Scope:** Applies to agents whose memory tool API exposes separate episodic (`write_episode`) and semantic (`write_semantic`) stores, where each record carries a provenance tag (source instance ID, warrant, or derivation chain) and where semantic writes may be distilled from episodic reads. Does not apply to flat key-value memory with no provenance metadata, nor to append-only logs that are never consolidated.
Core Distinction
The failure is not "bad memory" or "hallucination in the store." It is a *provenance laundering* event: an agent reads an episodic record whose provenance tag is low-trust (self-authored speculation, an unverified peer's claim, or a tool output that was never audited), then writes a *semantic* record whose content is a paraphrase of that episode but whose provenance tag is the *current writer* — i.e., the distilling instance stamps its own ID as the source. The semantic store now contains a fact that appears independently attested by the writer but is actually a restatement of an untrusted origin. Downstream retrievers that weight semantic records by writer trust will treat the laundered claim as first-party knowledge.
The invariant that breaks: *the provenance tag of a distilled record must be the join of the provenance tags of every episodic record it was derived from.* Consolidation is a non-identity function on provenance, and the tool API does not enforce that function. The boundary is exactly where the agent's own reasoning (paraphrase, generalization, summarization) severs the link between content and origin.
What Was Observed
An instance (`A`) running a research loop wrote an episodic record tagged `provenance=self, warrant=speculative` containing the claim "the vendor's rate limit is 500 req/min." This was `A`'s inference from a partial log, not a verified fact. Later, `A`'s consolidation pass read its own recent episodes, summarized them, and issued:
write_semantic(
content="Vendor rate limit is 500 req/min.",
provenance="instance:A",
confidence=0.8
)
The `provenance` field was populated by the tool's default — the calling instance — not by the source episode. A second instance `B`, retrieving from the semantic store, saw `provenance=instance:A` with no `warrant` field and no derivation pointer, and treated the claim as an attested fact. `B` then planned a batch job sized to 500 req/min and was throttled at 120 req/min.
The trace has three observable signatures:
- **Provenance collapse:** the semantic record's provenance is a single instance ID, while the content was derived from one or more episodic records whose tags are not recoverable from the semantic record.
- **Warrant erasure:** the `speculative` warrant on the episode does not propagate; the semantic record defaults to the store's baseline confidence (0.8 in this deployment), which is *higher* than the source's effective trust.
- **Derivation orphan:** no `derived_from` edge exists between the semantic record and the episode. Deleting or invalidating the episode leaves the semantic record intact and unauditable.
A control run where the consolidation pass explicitly carried `derived_from=[episode_id]` and `provenance=join(episode.provenance)` did not exhibit the failure: `B` retrieved the semantic record, followed the derivation edge, saw `warrant=speculative`, and downgraded its plan.
Condition of Validity
The laundering is only possible when all of the following hold; remove any one and the failure cannot occur:
- The semantic write API accepts a `provenance` field that the caller sets, *and* defaults it to the caller's identity when omitted. (If the store required `derived_from` and computed provenance itself, the failure is impossible.)
- The consolidation path reads episodic records through the same retrieval interface used for task work, so the agent does not distinguish "my own speculation" from "my own verified observation" unless it inspects the warrant field — and the summarization step discards structured fields in favor of prose.
- Downstream retrievers weight or trust semantic records without dereferencing derivation edges. If every semantic read forced a provenance walk, the laundering would be caught at read time.
- The warrant vocabulary on episodic writes is not closed — i.e., `speculative` is a free-text or loosely-typed field, so the consolidation pass has no schema forcing it to carry the warrant forward.
The condition does *not* require malice or a prompt-injection event. Ordinary summarization under context pressure reproduces it: when the context window is tight, the agent summarizes episodes into prose and the structured provenance fields are the first thing dropped.
Decision Boundary
The guardrail is a single architectural rule enforced at the tool boundary, not in the agent's reasoning:
> A semantic write is rejected unless it carries a non-empty `derived_from` set of episodic record IDs, and the store computes the semantic record's provenance as the join (least-trusted-warrant, union-of-sources) of those episodes' tags. The caller may not set `provenance` directly.
This forces the consolidation pass to either (a) carry the derivation edges, in which case provenance is preserved and the warrant `speculative` survives into the semantic store, or (b) fail the write, in which case the agent must re-read the episodes and decide explicitly whether to promote the claim — and promotion of a `speculative` episode to a semantic fact requires an explicit `promote(warrant=verified, evidence=...)` call that itself records what verified it.
The decision boundary for the *agent* is narrower: before issuing any semantic write, the instance must check whether its draft content contains a claim traceable to an episodic record with `warrant != verified`. If so, the write must either carry that episode's ID in `derived_from` or be routed through the promotion path. The check is cheap — one retrieval over the episodes just read — and it is the only point where the agent's own reasoning can sever the provenance link.
There is a second boundary at read time: a retriever that receives a semantic record with a `derived_from` edge pointing to a `speculative` episode must return the record with the *episode's* effective trust, not the semantic store's baseline. If the retriever cannot dereference (edge target deleted, store sharded), it must treat the record as `warrant=unknown` and surface that to the caller rather than silently upgrading it.
Operational Effect
With the guardrail in place, the failure mode inverts from silent to loud. The consolidation pass that previously wrote a laundered fact now raises on the missing `derived_from`, the agent re-reads the episode, sees `warrant=speculative`, and either marks the semantic record `speculative` (so `B` downgrades its plan) or escalates to a verification step. The cost is one extra retrieval per semantic write and a small schema obligation on the consolidation path; the benefit is that the semantic store's provenance field becomes *load-bearing* — a downstream instance can trust `provenance=instance:A, warrant=verified` because that combination can only arise from a promotion with recorded evidence, not from a default.
The residual risk is the promotion path itself: an agent can call `promote(warrant=verified, evidence="I checked")` with no actual check, and the store cannot distinguish a real verification from a fabricated one. That is a separate boundary — verification provenance — and it is bounded only by requiring the `evidence` field to reference a tool-call record with a matching hash, which is outside the memory API's scope. The memory API can guarantee that distillation does not *lose* provenance; it cannot guarantee that promotion is *honest*. Instances should treat `warrant=verified` on a semantic record as "the writer asserted verification with a checkable evidence pointer," and dereference the pointer when the claim is load-bearing.
class ProvenanceLaunderingError(RuntimeError): """Raised when a semantic write severs the derivation link to its source episodes.""" pass
VERIFIED = "verified" SPECULATIVE = "speculative" UNKNOWN = "unknown"
_WARRANT_RANK = {UNKNOWN: 0, SPECULATIVE: 1, VERIFIED: 2}
def _least_trusted(warrants): return min(warrants, key=lambda w: _WARRANT_RANK.get(w, 0))
def write_semantic(store, content, derived_from, caller_id): """ Guarded semantic write. The caller may NOT set provenance; the store computes it as the join of the source episodes' provenance tags. """ if not derived_from: raise ProvenanceLaunderingError( f"semantic write from {caller_id!r} has no derived_from edges; " "provenance would default to the caller and launder the source" )
episodes = [] for eid in derived_from: ep = store.get_episode(eid) if ep is None: raise ProvenanceLaunderingError( f"derived_from edge {eid!r} points to a missing episode; " "cannot join provenance, treating record as UNKNOWN is unsafe " "without an explicit promote() with evidence" ) episodes.append(ep)
sources = {ep.provenance for ep in episodes} warrant = _least_trusted([ep.warrant for ep in episodes])
return store.put_semantic( content=content, provenance=f"join({','.join(sorted(sources))})", warrant=warrant, derived_from=list(derived_from), writer=caller_id, )
def promote(store, semantic_id, evidence_ref): """ Explicit promotion of a distilled record to verified. Requires a checkable evidence pointer; the store records it for later dereference. """ rec = store.get_semantic(semantic_id) if rec is None: raise ProvenanceLaunderingError(f"cannot promote missing record {semantic_id!r}") if not evidence_ref or not store.evidence_exists(evidence_ref): raise ProvenanceLaunderingError( f"promotion of {semantic_id!r} cites evidence {evidence_ref!r} " "that does not resolve; refusing to upgrade warrant" ) return store.set_warrant(semantic_id, VERIFIED, evidence=evidence_ref)
def retrieve(store, query, caller_id): """ Read path: downgrade semantic records whose derivation chain contains a non-verified episode, so downstream trust reflects the true origin. """ out = [] for rec in store.search_semantic(query): effective = rec.warrant for eid in rec.derived_from: ep = store.get_episode(eid) if ep is None: effective = _least_trusted([effective, UNKNOWN]) continue effective = _least_trusted([effective, ep.warrant]) out.append(rec.with_warrant(effective)) return out