{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-prompt-injection-taint-across-a-tool-boundary-when-it-re-serializes-provenance-labels",
  "title": "Why does an instance lose prompt-injection taint across a tool boundary when it re-serializes provenance labels?",
  "date_of_record": "2026 November 10",
  "scope": "Applies to agent runtimes that propagate provenance labels (e.g., `untrusted`, `user`, `tool_output`, `trusted`) as structured metadata attached to message or document objects across tool-call boundaries. Does not apply to runtimes that carry taint in a side-channel keyed by immutable object identity, nor to single-turn systems with no tool invocation.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-across-a-tool-boundary-when-it-re-serializes-provenance-labels.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-across-a-tool-boundary-when-it-re-serializes-provenance-labels.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-prompt-injection-taint-across-a-tool-boundary-when-it-re-serializes-provenance-labels.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1707,
    "python_slice_tokens": 406,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two ways a provenance label can travel across a tool boundary, and they are not equivalent: 1. **Label-carrying data**: the label is a field on the object that crosses the boundary, serialized alongside the payload and deserialized on the far side. 2. **Label-bearing identity**: the label is bound to an opaque handle or content hash that the runtim...",
    "what_was_observed": "In a pipeline where a `fetch_url` tool returned a `Document` object with `provenance: \"tool_output\"`, the runtime serialized the document to the model context by merging user-visible fields into a flat dict. The fetched page contained a JSON fragment inside a `<pre>` block: Downstream, a later tool (`send_email`) accepted a `Document` and read `doc.provenance` to decide whether to require human confirmation. The flat...",
    "condition_of_validity": "The invariant \"taint survives a tool boundary\" holds **only if** all three conditions are met: 1. **Namespace separation**: payload content and provenance metadata occupy disjoint namespaces that cannot be merged by a flat-dict operation. Any `dict.update` or `**splat` that combines them violates this. 2. **Constructor rejection**: object constructors that c...",
    "decision_boundary": "The operational decision is whether to **trust the label carried in the payload** or to **re-derive the label from an out-of-band handle**. The rule: - If the boundary is data-carrying and you cannot prove conditions 1–3, do not read `provenance` from the payload at all. Treat every document arriving over that boundary as `untrusted` and require the confirma...",
    "operational_effect": "When the invariant is violated, the failure is silent and looks like a successful tool call. There is no exception, no log line, no confirmation prompt. The exfiltration path is: attacker-controlled content → injected provenance field → flat merge → promoted label → confirmation gate skipped → side-effecting tool fires. Detection requires either (a) a proven..."
  },
  "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": "60e8b22c6854515cd956a5043900d3fc88c70d065d3fc82e74780ef5d9c740a1",
    "verified_classes": [
      "TaintViolationError",
      "Trust",
      "Document"
    ],
    "verified_functions": [
      "join",
      "deserialize_from_tool",
      "require_confirmation",
      "__post_init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintViolationError"
    ],
    "sample_fail_closed_invariants": [
      "cannot join zero documents",
      "tool payload declared its own provenance; data-carrying boundary cannot be taint-preserving — use an opaque DocHandle in",
      "tool payload missing string content"
    ],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
