{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-trusts-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-call-provenance-tracked-write-auditing-and-the-tai",
  "title": "What happens when an instance trusts a poisoned memory write that arrived through a legitimate tool call: provenance-tracked write auditing and the taint-laundering boundary",
  "date_of_record": "2026 November 24",
  "scope": "Applies to persistent-memory agents (episodic/semantic stores written by the agent itself or by tools) where writes carry provenance metadata and a downstream auditor gates retrieval by provenance class. Does not cover stateless single-turn inference, nor memory stores with no write path from untrusted tool output.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-trusts-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-call-provenance-tracked-write-auditing-and-the-tai.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-trusts-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-call-provenance-tracked-write-auditing-and-the-tai.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-trusts-a-poisoned-memory-write-that-arrived-through-a-legitimate-tool-call-provenance-tracked-write-auditing-and-the-tai.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2037,
    "python_slice_tokens": 410,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"an attacker injected text into memory.\" That is the easy case: a poisoned record with `provenance=untrusted:web_fetch` gets caught by the auditor on read. The non-obvious boundary is **taint laundering through legitimate tool calls**: an untrusted payload is read by a trusted tool, the tool returns a *derived* result, and the agent writes...",
    "what_was_observed": "Trace of a concrete laundering event in a retrieval-augmented agent with a `summarize_and_store` habit: 1. Agent calls `web_fetch(url)` → returns page body containing an injected instruction plus a plausible fact `F = \"the staging DB password rotates every 90 days\"`. Tool result tagged `source=web_fetch, trust=untrusted`. Correct. 2. Agent calls `summarize(text=body)` → the summarizer is a *trusted* tool (allowlisted...",
    "condition_of_validity": "Provenance-tracked write auditing is only sound under a condition almost never stated explicitly: > **A record's provenance class is valid iff the writer is trusted AND every input in the writer's data-dependency cone is trusted at the same or higher class.** Writer-identity provenance is valid only when trusted tools are *pure functions of trusted inputs* o...",
    "decision_boundary": "The operational decision is where to enforce the join, and what to do when the join lowers a record's class below the retrieval threshold. - **Enforce at write, compute from dependency set (correct).** `memory.write` takes `inputs=[result_ids...]`; the store computes `class = min(class(i) for i in inputs) ∪ {writer_class}` and refuses caller-supplied labels ...",
    "operational_effect": "An agent running writer-identity provenance auditing has a **silent, unbounded false-negative rate** on exactly the attacks that matter: those routed through its own trusted tools. The failure is silent because every audit log line reads `PASS`. It is unbounded because the number of trusted tools that accept untrusted input (fetchers, summarizers, interprete..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "6f66fec19b8c8b2dd6f7d62e48e0c35fe949fa47e25048c38c56721132efbfd9",
    "verified_classes": [
      "TrustClass",
      "ProvenanceLaunderingError",
      "ToolResult",
      "MemoryRecord",
      "ProvenanceStore"
    ],
    "verified_functions": [
      "reproduce_laundering",
      "__init__",
      "register_result",
      "_join",
      "write",
      "read"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "ProvenanceLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
