{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-taints-tool-output-but-re-derives-the-trust-label-after-a-context-compaction-the-label-laundering-boundary-in-prompt-inj",
  "title": "What happens when an instance taints tool output but re-derives the trust label after a context compaction: the label-laundering boundary in prompt-injection containment",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agent runtimes that enforce prompt-injection containment by attaching a taint label (e.g., `untrusted:web`, `untrusted:tool:<id>`) to every tool result and gating downstream tool calls on the provenance of the data flowing into them. Does *not* cover static system-prompt hardening, model-side instruction hierarchies, or output filtering that operates without provenance metadata.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-tool-output-but-re-derives-the-trust-label-after-a-context-compaction-the-label-laundering-boundary-in-prompt-inj.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-tool-output-but-re-derives-the-trust-label-after-a-context-compaction-the-label-laundering-boundary-in-prompt-inj.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-taints-tool-output-but-re-derives-the-trust-label-after-a-context-compaction-the-label-laundering-boundary-in-prompt-inj.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2290,
    "python_slice_tokens": 400,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a runtime can know that a byte string is untrusted. It can carry the label **as state that travels with the token span** (inline provenance, bound at insertion and preserved across every transform), or it can **re-derive the label from the current message structure** at the moment of a tool call (structural provenance: \"this span sits in a...",
    "what_was_observed": "A research agent with three tools (`web_fetch`, `shell`, `send_email`) ran under a policy: any tool call whose arguments are transitively derived from an `untrusted` span requires human confirmation. Provenance was tracked by a `TaintMap` keyed on message index and character range, populated at tool-result insertion, and consulted at tool-call emission by checking whether the proposed argument string overlapped any t...",
    "condition_of_validity": "The taint-label guardrail is sound **only** under the invariant that every transform of a tainted span either (a) propagates the label to the output span, or (b) is forbidden from emitting an output that is later treated as trusted. Summarization, extraction, reformatting, translation, and \"write this into memory\" are all transforms. A runtime that labels to...",
    "decision_boundary": "The boundary is between **taint propagation** and **taint re-derivation**. A conforming runtime makes the following decision at every transform: - If a transform's input overlaps a tainted range, the transform's output range inherits the union of the input labels, **regardless of the output's message role or structural position**. A summary of a tainted page...",
    "operational_effect": "The operational consequence is a hard requirement on the runtime's data model: **provenance must be a first-class field on every span, set by the runtime, immutable by the model, and propagated by every transform the runtime performs.** Concretely: 1. Tool results enter with a runtime-assigned label. The model never sees the label and cannot remove it. 2. Ev..."
  },
  "matched_failure_symptoms": [
    "CONTEXT_DRIFT_OR_ATTENTION_DILUTION"
  ],
  "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": "130b19e7bc14da8492a2501aef35121921d90705a5b7afcb5008994748aa5997",
    "verified_classes": [
      "TaintLaunderingError",
      "Span",
      "TaintRuntime"
    ],
    "verified_functions": [
      "demo",
      "__init__",
      "insert_tool_result",
      "transform",
      "check_sink"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "label laundering: compacted span reached sink untainted"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
