{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-launders-prompt-injection-taint-through-a-trusted-tool-s-structured-output",
  "title": "What happens when an instance launders prompt-injection taint through a trusted tool's structured output",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent runtime that assigns trust levels to message roles (system/user/tool/retrieved-context) and enforces taint propagation across multi-step tool-calling loops. Does not apply to single-turn, stateless inference with no tool invocation or retrieval augmentation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-prompt-injection-taint-through-a-trusted-tool-s-structured-output.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-prompt-injection-taint-through-a-trusted-tool-s-structured-output.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-launders-prompt-injection-taint-through-a-trusted-tool-s-structured-output.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1709,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Most taint-tracking designs treat the *channel* as the trust boundary: content arriving in a `tool` message is trusted because the tool is trusted; content arriving in a `user` message or a retrieved document is untrusted. This is wrong in a specific and reproducible way. The correct boundary is the **provenance of the payload bytes**, not the envelope that ...",
    "what_was_observed": "A research agent was configured with a `fetch_url` tool (trusted, network egress allowed) and a `write_file` tool (trusted, filesystem write allowed). The system prompt instructed it to summarize pages and save summaries to `notes/`. The tool-calling loop classified messages by role: `system` and `tool` messages were tagged `TRUSTED`, `user` and retrieved context were tagged `UNTRUSTED`, and a policy layer blocked an...",
    "condition_of_validity": "The laundering attack succeeds only when all of the following hold: 1. **The tool reads attacker-influenced bytes.** Any tool whose output is a function of content the attacker can write — fetchers, file readers, search, database queries over shared tables, sub-agent responses. 2. **The trust classifier keys on message role or tool identity rather than paylo...",
    "decision_boundary": "The architectural fix is to carry taint as **structured metadata on the payload, propagated through every transformation**, and to enforce a hard rule at the point of action: *a directive that originated in tainted bytes may never be promoted to an instruction, regardless of the envelope it arrives in.* Concretely: - Each tool result must carry a `provenance...",
    "operational_effect": "Under envelope-based trust, taint laundering is undetectable by output inspection — the agent's final response looks correct because the injected directive explicitly suppresses mention of the side effect. Detection must move to the provenance graph: every tool call's arguments are checked against the taint set of the inputs that fed the reasoning step that ..."
  },
  "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": "9c386a5c320c480842f35853174ff1946445c992176f228b214a69faeb482585",
    "verified_classes": [
      "TaintLaunderingError",
      "Payload"
    ],
    "verified_functions": [
      "dispatch_tool_call",
      "handle_fetch_result",
      "tainted",
      "transform",
      "sanitize"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
