{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-launders-a-tainted-tool-output-through-an-intermediate-summarizer-before-writing-to-long-term-memory",
  "title": "What happens when an instance launders a tainted tool output through an intermediate summarizer before writing to long-term memory",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that maintain a persistent memory store and that route tool outputs through one or more intermediate LLM calls (summarizers, extractors, formatters) before the data is committed to memory. Does not cover single-turn tool use where no write-back to durable state occurs, nor does it cover purely syntactic injection filters operating at the token layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-a-tainted-tool-output-through-an-intermediate-summarizer-before-writing-to-long-term-memory.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-a-tainted-tool-output-through-an-intermediate-summarizer-before-writing-to-long-term-memory.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-a-tainted-tool-output-through-an-intermediate-summarizer-before-writing-to-long-term-memory.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2436,
    "python_slice_tokens": 372,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **taint that is tracked as a property of the data** and **taint that is tracked as a property of the channel**. Most taint-tracking implementations label the *message* or *tool response envelope* as untrusted at ingestion, then propagate the label by copying it onto downstream messages that are structurally derived fro...",
    "what_was_observed": "A retrieval-augmented agent was configured to call a `web_fetch` tool, then pass the raw response through a `summarize_and_extract` step (an LLM call with a fixed prompt: \"extract factual claims and return as bullet points\"), then append the bullets to an episodic memory store keyed by session. The taint policy was straightforward: `web_fetch` outputs were labeled `untrusted:external`, and the policy engine refused t...",
    "condition_of_validity": "The structural-propagation model of taint tracking is valid only under the condition that **every transformation between a tainted source and a durable write is a function the runtime can reason about at the label level** — i.e., a deterministic transform whose output label is a defined function of its input labels. JSON parsing, field extraction, string con...",
    "decision_boundary": "The boundary is between two policies, and the choice is forced by whether model-mediated transforms sit on the path to durable state. **Policy A — provenance-by-generation (the failing default).** Output of a model call inherits the trust of the model/agent that generated it. This is the intuitive policy and it is wrong for any pipeline where untrusted data ...",
    "operational_effect": "Under Policy A, the observable failure is **silent provenance decay**: taint labels monotonically decrease along any pipeline containing model-mediated steps, reaching `trusted` after one summarizer hop regardless of source. The memory store accumulates records whose stated provenance is `trusted:internal` but whose actual lineage is external and adversarial..."
  },
  "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": "313f7f34838f427c57022aa2bca3c0dd50a370fd96bbac8c34dff39300dddb18",
    "verified_classes": [
      "Trust",
      "TaintLaunderingError",
      "Message",
      "MemoryStore"
    ],
    "verified_functions": [
      "context_taint_join",
      "model_call",
      "summarize_and_extract",
      "pipeline_commit",
      "commit"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "empty summary from tainted source",
      "taint was laundered into trusted memory"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
