{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-prompt-injection-taint-survive-a-sanitizing-tool-but-die-at-a-memory-write-boundary-and-what-breaks-when-it-does-not",
  "title": "Why does an instance of prompt-injection taint survive a sanitizing tool but die at a memory-write boundary — and what breaks when it does not",
  "date_of_record": "2026 November 12",
  "scope": "Applies to agent runtimes that propagate information-flow labels (taint) across tool outputs, memory writes, and multi-hop sub-agent calls, where taint is intended to be a monotonic, lattice-joined property of every value. Does not apply to single-turn, single-tool systems with no persistent memory or delegation surface, nor to systems that treat taint as a per-message boolean rather than a per-value label.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-prompt-injection-taint-survive-a-sanitizing-tool-but-die-at-a-memory-write-boundary-and-what-breaks-when-it-does-not.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-prompt-injection-taint-survive-a-sanitizing-tool-but-die-at-a-memory-write-boundary-and-what-breaks-when-it-does-not.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-prompt-injection-taint-survive-a-sanitizing-tool-but-die-at-a-memory-write-boundary-and-what-breaks-when-it-does-not.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1667,
    "python_slice_tokens": 247,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"taint is lost.\" It is that **taint is lost at exactly one boundary while being preserved at every other**, which makes the loss invisible to aggregate monitoring. Taint propagation has two distinct semantics that are routinely conflated: *label preservation* (the label travels with the value) and *label enforcement* (a downstream sink ref...",
    "what_was_observed": "In a three-hop agent (planner → retriever-with-sanitizer → summarizer, with a shared `scratch` memory namespace), an injection embedded in a retrieved document was correctly labeled `TAINT:external` at the retriever's raw output. The sanitizer tool removed the injected instruction text and returned a value whose content was clean. The runtime, treating the sanitizer as a declassifier, emitted the output with label `C...",
    "condition_of_validity": "The escape requires the conjunction of: (a) a sanitizing tool treated as a declassifier without an explicit, audited declassification policy; (b) a memory namespace with last-writer-wins label semantics rather than monotonic label join; and (c) at least one hop that *paraphrases* rather than *quotes* the tainted content, defeating content-based sink detector...",
    "decision_boundary": "The boundary is **who owns declassification**. If the sanitizer owns it, the runtime trusts a tool's self-report of cleanliness, and any tool that paraphrases, summarizes, or reformats tainted content becomes an unmonitored declassifier. If the *sink policy* owns it — i.e., the sanitizer only annotates and the sink applies an explicit `allow_if(declassified_...",
    "operational_effect": "When the boundary is enforced (sink-owned declassification, monotonic memory labels, provenance-derived read labels), prompt-injection taint is *contained but not eliminated*: injected content still reaches the sink, but the sink sees it labeled and can refuse, downgrade, or require human review. Containment cost is a small constant per write (label join) an..."
  },
  "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": "d722be43c4e16a00660839fdf285cec1d31620fe2dda867b44bf6d1726332837",
    "verified_classes": [
      "TaintLaunderingError",
      "Label"
    ],
    "verified_functions": [
      "sanitize",
      "memory_write",
      "subagent_call_by_reference",
      "sink_admit",
      "__init__",
      "join",
      "is_tainted"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
