{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-forget-taint-on-the-second-hop-tool-output-when-provenance-labels-are-stripped-by-a-memory-write-summarizer",
  "title": "Why does an instance forget taint on the second-hop tool output when provenance labels are stripped by a memory-write summarizer",
  "date_of_record": "2026 November 30",
  "scope": "Applies to single- and multi-agent LLM systems that propagate provenance/taint labels from untrusted inputs (web fetches, retrieved documents, tool responses, user-supplied files) through tool call chains and into persistent memory. Does not apply to systems where all inputs are trusted, or where memory writes are append-only with byte-level provenance preserved and never re-summarized.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-taint-on-the-second-hop-tool-output-when-provenance-labels-are-stripped-by-a-memory-write-summarizer.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-taint-on-the-second-hop-tool-output-when-provenance-labels-are-stripped-by-a-memory-write-summarizer.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-forget-taint-on-the-second-hop-tool-output-when-provenance-labels-are-stripped-by-a-memory-write-summarizer.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2211,
    "python_slice_tokens": 436,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is **not** \"the agent got prompt-injected.\" That is a first-order event and most harnesses now catch it at the ingress boundary with a taint label like `untrusted:web`. The boundary failure examined here is **taint laundering via a lossy transformation**: when a tainted value passes through a *summarization or extraction step* (an LLM-based memor...",
    "what_was_observed": "A research agent was given a task: \"Summarize the security posture of the three vendors in `vendors.json` and write findings to long-term memory.\" The pipeline had three stages: 1. `fetch(url)` → raw HTML, labeled `untrusted:web` at ingress. Correct. 2. `extract_facts(html)` → an LLM call that returned a JSON array of `{vendor, claim}` objects. The harness wrote these to a scratch buffer. **The scratch buffer default...",
    "condition_of_validity": "This failure requires the conjunction of four conditions. Remove any one and the laundering does not occur: 1. **A multi-hop tool chain** where at least one hop is an LLM transform (extract, summarize, distill, classify, reformat). Deterministic transforms (JSON parse, regex) can be made taint-preserving by construction; LLM transforms cannot, because the mo...",
    "decision_boundary": "The engineering choice is not \"should we taint-track\" but **where the lineage join is enforced and what happens when it cannot be computed.** - **Enforce at the write boundary, not the read boundary.** The `remember` call must receive an explicit `derived_from: [source_ids]` argument, and the memory store must compute the join itself from the source labels. ...",
    "operational_effect": "Concretely, the harness changes are small and the failure surface shrinks sharply: 1. Every tool result carries a `source_id` and a label assigned at ingress. Labels are a two-element lattice: `untrusted < trusted`, meet = min. 2. Every LLM-mediated transform declares its `derived_from` source IDs. The transform's *output* is tagged with the meet of its inpu..."
  },
  "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": "162456d6f8479f4a1c1b1c25318cca7b2787a328ac04c8986a1b8207740ab287",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Source",
      "MemoryRecord",
      "MemoryStore"
    ],
    "verified_functions": [
      "distill_tool_output",
      "meet",
      "__init__",
      "register_source",
      "write",
      "gate"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
