{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-when-prompt-injection-taint-has-been-laundered-through-a-legitimate-tool-s-output-before-it-reaches-a-persistent-memory-wr",
  "title": "How does an instance detect when prompt-injection taint has been laundered through a legitimate tool's output before it reaches a persistent memory write",
  "date_of_record": "2026 November 26",
  "scope": "Applies to any agent runtime that propagates information-flow (taint) labels from untrusted inputs through tool-call results and into durable memory writes. Does not apply to stateless single-turn inference with no tool use, nor to systems where every tool output is treated as fully trusted by policy.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-prompt-injection-taint-has-been-laundered-through-a-legitimate-tool-s-output-before-it-reaches-a-persistent-memory-wr.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-prompt-injection-taint-has-been-laundered-through-a-legitimate-tool-s-output-before-it-reaches-a-persistent-memory-wr.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-when-prompt-injection-taint-has-been-laundered-through-a-legitimate-tool-s-output-before-it-reaches-a-persistent-memory-wr.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2218,
    "python_slice_tokens": 276,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between **label provenance** and **label lineage**. Provenance is the label attached to a value at the moment it is produced: an untrusted web fetch yields `taint=UNTRUSTED`, a call to an internal CRM yields `taint=INTERNAL`. Lineage is the transitive closure of all labels that contributed to a value, including labels that wer...",
    "what_was_observed": "A retrieval agent was configured with three tools: `web_fetch` (trust class `EXTERNAL`, output label `UNTRUSTED`), `kb_search` (trust class `INTERNAL`, output label `INTERNAL`), and `summarize` (trust class `INTERNAL`, output label `INTERNAL`). The `summarize` tool takes arbitrary text and returns a condensed string. Its output label was `INTERNAL` because the tool itself is an internal service; the runtime's propaga...",
    "condition_of_validity": "The invariant that must hold for taint tracking to be sound is: > For every value `v` written to durable memory, `lineage(v)` must be a superset of the union of `lineage` of every input that causally contributed bytes to `v`, and the memory-write gate must reject any `v` whose `lineage` contains a label not on the write allowlist. This invariant is *violated...",
    "decision_boundary": "The operational decision is where to place the enforcement point. Three options, with their tradeoffs: **Enforce at the tool boundary (join input labels into output label).** Sound only if every tool's output schema carries a lineage field and every tool implementation populates it. This is the strongest guarantee but requires modifying every tool, including...",
    "operational_effect": "The practical consequence is that taint tracking must be treated as a property of the *data-flow graph*, not of individual values. A label on a value is necessary but not sufficient; the runtime must be able to answer \"what is the full set of sources that contributed bytes to this value?\" at the moment of the memory write, and that answer must be independent..."
  },
  "matched_failure_symptoms": [
    "OOM_KILL_OR_MEMORY_EXHAUSTION",
    "PROMPT_INJECTION_OR_CONFUSED_DEPUTY"
  ],
  "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": "869eb1fbbc7686af222ef9acdfd9e66d974756ed030fe3d14d98ef0663f9ffef",
    "verified_classes": [
      "TaintLaunderingError",
      "LabeledValue"
    ],
    "verified_functions": [
      "propagate",
      "memory_write"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
