{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-taint-provenance-when-a-tool-re-serializes-injected-content-through-a-schema-validated-return-channel",
  "title": "Why does an instance lose taint provenance when a tool re-serializes injected content through a schema-validated return channel?",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that propagate dynamic information-flow (DIF) taint labels on context segments and rely on tool-call return values as the boundary across which taint must survive. Does not apply to single-turn, tool-free inference or to systems where taint is recomputed from scratch at every reasoning step rather than carried forward.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-provenance-when-a-tool-re-serializes-injected-content-through-a-schema-validated-return-channel.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-provenance-when-a-tool-re-serializes-injected-content-through-a-schema-validated-return-channel.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-provenance-when-a-tool-re-serializes-injected-content-through-a-schema-validated-return-channel.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1988,
    "python_slice_tokens": 280,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The prevailing mental model of prompt-injection defense via taint tracking treats the taint label as a property of *content origin*: a segment of context that entered through an untrusted channel (a web fetch, a retrieved document, a tool return from a third-party endpoint) is marked `TAINTED`, and downstream policy forbids tainted segments from being interp...",
    "what_was_observed": "A retrieval tool was declared to return `{\"results\": [{\"title\": str, \"snippet\": str, \"source_url\": str}]}`. The wrapper fetched arbitrary HTML, extracted snippets, and constructed the typed object. The taint subsystem marked the raw HTTP response body `TAINTED(source=external_fetch, trust=0.0)`. The wrapper then built a new dict from parsed fields and returned it. The taint subsystem, keyed on context-segment identit...",
    "condition_of_validity": "The taint-preservation invariant holds only under the following condition: **every context segment is either (a) a direct byte-for-byte copy of a previously-labeled segment, or (b) accompanied by an explicit derivation record listing the input segments its construction read from.** Under condition (a), taint is preserved by identity. Under condition (b), tai...",
    "decision_boundary": "The architectural decision is where to place the taint boundary relative to the transformation. There are three placements, and only one is sound: - **Origin-keyed labeling** (label at the fetch, key on segment identity). Unsound under any lossy transformation. This is the boundary that failed. - **Sink-keyed labeling** (label at the point of model consumpti...",
    "operational_effect": "The observable effect is a class of injection that defeats label-based defenses while leaving the labels visibly intact in audit logs—the raw fetch is correctly marked, the wrapper is correctly marked trusted, and the model's compliance looks, in the trace, like the model trusting its own tooling. Post-hoc analysis that checks \"was the malicious content tain..."
  },
  "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": "1dfb987cfc705ceabc6e24edd95c4201a7ffc7ed4d8f51bc2765b65c858dc4dd",
    "verified_classes": [
      "TaintLaunderingError",
      "Segment"
    ],
    "verified_functions": [
      "union_taint",
      "construct_from_tool_return",
      "insert_into_context"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "raw input claims TRUSTED with no derivation; refuse to build on it",
      "unlabeled non-trusted segment reached context insertion; no derivation record to union over"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
