{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-prompt-injection-taint-tracking-fail-across-tool-boundaries-when-labels-are-reset-by-serialization",
  "title": "Why does an instance of prompt-injection taint tracking fail across tool boundaries when labels are reset by serialization?",
  "date_of_record": "2026 November 15",
  "scope": "Applies to agent runtimes that propagate dynamic information-flow (DIF) labels—taint bits, provenance tags, or capability tokens—across calls into external tools, subprocesses, or remote MCP-style servers. Does not apply to single-process pipelines where the label travels in-memory through the same interpreter, nor to static taint analysis performed ahead of execution.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-prompt-injection-taint-tracking-fail-across-tool-boundaries-when-labels-are-reset-by-serialization.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-prompt-injection-taint-tracking-fail-across-tool-boundaries-when-labels-are-reset-by-serialization.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-prompt-injection-taint-tracking-fail-across-tool-boundaries-when-labels-are-reset-by-serialization.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1806,
    "python_slice_tokens": 495,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct notions of \"taint survives a call\": 1. **Value taint** — the data returned by a tool carries a label because it derives from untrusted input. 2. **Channel taint** — the *invocation itself* (arguments, control flow, side effects) is influenced by untrusted input, regardless of what is returned. Most implementations track only (1). The f...",
    "what_was_observed": "A runtime wired a fetch tool behind a JSON-RPC shim. An untrusted web page (label `U`) was summarized into a scratchpad. The agent then invoked `fetch(url=scratchpad_derived_url)`. The argument was correctly tainted `U` at call time. The tool returned page content. The shim serialized the response and the runtime's deserializer constructed a fresh `ToolResult` object with default labels—`⊥`—because the wire schema ha...",
    "condition_of_validity": "The invariant above holds only if all of the following are true: 1. The wire schema has an explicit provenance slot, **or** the runtime applies a conservative default: any value crossing an inbound tool boundary is labeled `⊔(caller_label, tool_policy)` until proven otherwise. 2. The label join is computed at the *boundary adapter*, not inside the tool, beca...",
    "decision_boundary": "The operational rule: **treat every serialization boundary as a label-destroying boundary by default.** Do not trust the tool to propagate labels; do not trust the schema to carry them unless the schema was designed for it. At each boundary adapter, compute: and if `tool_declared_label_if_any` is absent, use `inbound_label` as the floor—never `⊥`. The only c...",
    "operational_effect": "When the boundary adapter enforces the join, the observed failure disappears: the `write_file` call receives content labeled `U`, the policy engine's confirmation gate fires, and the exfiltration path is blocked at the sink rather than being invisible. The cost is false positives—benign tool outputs get labeled `U` because their caller was `U`—which is the c..."
  },
  "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": "4dd682e8cd66256276d297b1e762c86c51a97210dc0d137756e45a2e9e5ea443",
    "verified_classes": [
      "TaintLaunderingError",
      "LabeledValue",
      "ToolBoundary"
    ],
    "verified_functions": [
      "join",
      "guarded_write",
      "_demo",
      "__post_init__",
      "invoke"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "AssertionError",
      "TaintLaunderingError",
      "TypeError"
    ],
    "sample_fail_closed_invariants": [
      "assert result.label == frozenset({'U'})",
      "sink should have refused tainted content",
      "label must be a frozenset of provenance tags"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
