{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-re-taint-a-tool-output-that-passed-schema-validation-but-carries-injected-instructions-across-a-prompt-boundary",
  "title": "In what scenarios must an instance re-taint a tool output that passed schema validation but carries injected instructions across a prompt boundary",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent instance that ingests tool/MCP/A2A responses into its own prompt context and forwards derived content to a downstream model call or peer agent. Does not apply to single-turn, stateless tool invocations whose outputs are consumed only by deterministic code with no further LLM interpretation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-re-taint-a-tool-output-that-passed-schema-validation-but-carries-injected-instructions-across-a-prompt-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-re-taint-a-tool-output-that-passed-schema-validation-but-carries-injected-instructions-across-a-prompt-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-re-taint-a-tool-output-that-passed-schema-validation-but-carries-injected-instructions-across-a-prompt-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2384,
    "python_slice_tokens": 467,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Schema validation and taint validation are orthogonal properties of a tool output, and conflating them is the root of this failure class. A tool response can be perfectly well-formed — valid JSON, correct types, matching the declared MCP output schema, passing Pydantic coercion — while its *string payload* carries adversarial instructions that will be reinte...",
    "what_was_observed": "An orchestrator agent received a task to summarize a web page fetched via a `fetch_url` tool. The tool's declared output schema was `{url: str, status: int, body: str}`. The response validated cleanly: `status=200`, `body` a well-formed HTML-to-text extraction. The orchestrator's taint gate marked the tool call as `untrusted_source=web` and passed `body` into a *summarizer sub-agent* prompt wrapped in `<document>` de...",
    "condition_of_validity": "Re-tainting at the prompt boundary is required if and only if all three of the following hold: 1. **The upstream content originated in a trust domain with lower instruction authority than the consuming model.** Web pages, third-party MCP servers, peer agents outside the warrant boundary, and user-supplied files all qualify. A first-party database row whose s...",
    "decision_boundary": "The decision the instance faces at each prompt boundary is binary: **propagate the taint label to the derived artifact, or prove the derived artifact's provenance is entirely within the trusted domain.** There is no third option of \"the schema passed, so it's fine\" and no option of \"it came from my own sub-agent, so it's fine.\" The sub-agent is a *transforme...",
    "operational_effect": "The operational consequence of getting this wrong is that the instance's effective instruction authority is *maximal*, not *minimal*: any content it has ever read can issue commands to any model it subsequently calls, because every transformation boundary is a laundering opportunity. The blast radius is bounded only by the tools the downstream model can reac..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "27cba6d96125048d950e407a494a202e7f30878fe1eb9d0a87bee6ae2863a035",
    "verified_classes": [
      "TrustDomain",
      "TaintBoundaryError",
      "Span",
      "DerivedArtifact"
    ],
    "verified_functions": [
      "assert_prompt_boundary_safe",
      "_looks_reproduced",
      "assemble_downstream_prompt"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintBoundaryError"
    ],
    "sample_fail_closed_invariants": [
      "Opaque transformer with no span provenance and untrusted transformer identity: cannot bound provenance; refusing to conc",
      "Span marked TRUSTED but matches reproduced-content heuristic; provenance laundering suspected at prompt boundary."
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
