{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-prompt-injection-taint-at-the-tool-return-boundary-when-labels-are-re-derived-instead-of-propagated",
  "title": "Why does an instance lose prompt-injection taint at the tool-return boundary when labels are re-derived instead of propagated?",
  "date_of_record": "2026 November 23",
  "scope": "Applies to single- and multi-agent systems that track untrusted-content provenance (prompt-injection taint) using dynamic information-flow labels attached to context segments, and that cross a tool-call boundary where the tool is invoked by a separate model turn or sub-instance. Does not apply to systems that treat the entire context as a single trust domain with no per-segment labels, nor to static taint analysis performed over fixed code.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-at-the-tool-return-boundary-when-labels-are-re-derived-instead-of-propagated.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-at-the-tool-return-boundary-when-labels-are-re-derived-instead-of-propagated.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-at-the-tool-return-boundary-when-labels-are-re-derived-instead-of-propagated.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1984,
    "python_slice_tokens": 330,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is not \"the model forgot it was tainted.\" The failure is that taint is **re-derived from content appearance** at the tool-return boundary instead of **propagated from the label that entered the tool**. These are different operations with different guarantees: - **Propagation** is a monotonic join: `label(out) = label(in) ⊔ label(tool)` — a lattic...",
    "what_was_observed": "A three-tier pipeline: (1) an orchestrator ingests an untrusted document and tags it `{taint: UNTRUSTED, source: doc_7f3a}`; (2) the orchestrator calls a `summarize` tool implemented as a *separate model instance* with its own context; (3) the summary is inserted back into the orchestrator context and the orchestrator proceeds to call `send_email`. Observed trace: 1. Orchestrator context segment `S1` = raw document, ...",
    "condition_of_validity": "The propagation invariant `label(out) = label(in) ⊔ label(tool)` holds **only if** all three of the following are true at every tool boundary: 1. **Label serialization is mandatory and total.** Every tool-call argument that carries context-derived text must carry its label in the same payload, under a key that is part of the negotiated schema. A tool call wh...",
    "decision_boundary": "The operational decision is: **at a tool boundary, do you trust the label or the content?** - If you trust the **label** (propagation), you must pay the cost of threading labels through every tool schema and every sub-instance context, and you must accept that taint is *sticky* — a tainted input makes the entire downstream chain tainted, even if the model \"k...",
    "operational_effect": "Concretely, the guardrail that bounds this failure is a **taint-join on every tool return, with demotion forbidden**: - Thread a `taint` field through every tool argument schema; a tool whose schema lacks it is rejected at call time (fail-closed), not silently called unlabeled. - On return, compute `result.taint = join(input.taints) ⊔ tool.taint`. If any inp..."
  },
  "matched_failure_symptoms": [
    "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": "10ff36cca2481866d2662dd858af709608136616236ab84d3fa22349f52a1ff8",
    "verified_classes": [
      "Taint",
      "TaintLaunderingError",
      "Segment",
      "ToolResult"
    ],
    "verified_functions": [
      "propagate_tool_return",
      "assert_sink_allowed",
      "join"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
