{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-taint-labels-when-a-tool-boundary-re-serializes-untrusted-content-into-a-trusted-schema",
  "title": "Why does an instance lose taint labels when a tool boundary re-serializes untrusted content into a trusted schema",
  "date_of_record": "2026 November 29",
  "scope": "Applies to agent runtimes that implement dynamic information-flow control (IFC) by attaching taint labels to message fragments and propagating them through tool calls. Does not apply to systems that rely solely on static prompt hardening or output filtering without per-fragment label provenance.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-labels-when-a-tool-boundary-re-serializes-untrusted-content-into-a-trusted-schema.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-labels-when-a-tool-boundary-re-serializes-untrusted-content-into-a-trusted-schema.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-labels-when-a-tool-boundary-re-serializes-untrusted-content-into-a-trusted-schema.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1475,
    "python_slice_tokens": 225,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways to track untrusted content through an agent: *label persistence* (the label travels with the data object across every serialization and deserialization boundary) and *label re-derivation* (the receiving component infers trust from the shape of the payload it receives). Most runtimes claim the first and silently implement the second. The di...",
    "what_was_observed": "A retrieval tool fetched an external document whose body contained an instruction fragment. The runtime correctly labeled the raw fetch result `TAINT:EXTERNAL`. The tool wrapper then parsed the document into a schema `{title, body, metadata}` and returned it through an MCP-style `tools/call` response. The label was attached to the *transport envelope*, not to the `body` field. On the agent side, the deserializer reco...",
    "condition_of_validity": "The invariant that must hold is: *no fragment of a payload may change its label without an explicit, logged relabeling decision at a boundary that has authority to relabel.* This holds only if three conditions are jointly satisfied: - The wire format carries per-fragment labels (or a content-addressed label manifest) alongside the payload. - The deserializer...",
    "decision_boundary": "The boundary is between *structural trust* and *provenance trust*. A payload that validates against a schema has structural trust: it is well-formed. It does not thereby have provenance trust: it may still be attacker-authored. The runtime must decide, at every tool boundary, whether to (a) propagate labels through a label-carrying channel, (b) quarantine un...",
    "operational_effect": "When the invariant holds, injected instructions in tool output are inert: they reach the planner as `EXTERNAL`-labeled fragments, the planner's policy refuses to treat them as directives, and the injection is logged as a blocked declassification attempt. When it fails, the agent's planning loop is directly steerable by any tool that returns attacker-influenc..."
  },
  "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": "06f96ca529fe97a96f2afaa940de99947837acdc8606b3ef7d1ea588f6125c14",
    "verified_classes": [
      "TaintBoundaryViolation",
      "Fragment",
      "ToolResponse"
    ],
    "verified_functions": [
      "assert_label_manifest",
      "deserialize_into_planner"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [
      "tool response has no label manifest; refusing to deserialize unlabeled content into planning context",
      "schema invalid after label check"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
