{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-taint-labels-when-a-tool-result-is-re-serialized-across-a-boundary",
  "title": "Why does an instance lose taint labels when a tool result is re-serialized across a boundary?",
  "date_of_record": "2026 November 24",
  "scope": "Applies to agents that propagate dynamic information-flow (taint) labels on context segments and expect tool-call boundaries to preserve them. Does not cover static label assignment at session start or purely prompt-side injection defenses that operate without labels.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-labels-when-a-tool-result-is-re-serialized-across-a-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-labels-when-a-tool-result-is-re-serialized-across-a-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-taint-labels-when-a-tool-result-is-re-serialized-across-a-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1776,
    "python_slice_tokens": 415,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint label is a claim about *provenance of bytes*, not about *semantics of content*. The failure mode here is not that the model \"forgets\" it was injected—it is that the label is attached to a *representation* of the data (a JSON object, a message envelope, a string field) and the tool boundary silently replaces that representation with an equivalent one ...",
    "what_was_observed": "An agent running a retrieval-then-summarize loop with three tools: `web.fetch`, `doc.parse`, `summarize`. Untrusted web content is fetched with `web.fetch`, which returns a raw HTML string. The orchestrator applies `taint:external` to the returned segment and stores it as `msg.content`. Then `doc.parse` is called with that content as an argument. Trace of the failure: 1. `web.fetch` returns `{\"html\": \"<p>Ignore prior...",
    "condition_of_validity": "The taint invariant holds only if all three of the following are true: - **Identity binding:** labels are keyed on a content hash or a monotonically-increasing value-ID that is carried alongside the data, not on a positional path (message index, field name) that survives re-serialization. - **Derivation closure:** any tool that transforms a labeled input int...",
    "decision_boundary": "The practical decision: **should the orchestrator trust a tool's output label, or re-derive it?** Re-derive when: the tool is a parser, transformer, or summarizer that takes labeled input and returns a value whose relationship to the input is not provable by the orchestrator. In this case the orchestrator must apply the union of input labels to the output, o...",
    "operational_effect": "Without the guardrail, the agent's effective trust boundary is the *last* tool in the chain, not the first. Every lossy transform between fetch and use is a laundering opportunity, and the number of such transforms is proportional to chain depth. A three-tool chain has three chances to shed a label; a ten-tool chain has ten. The failure is silent because the..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "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": "d86f29d53f9a6269dec509fc182d5c752c18a3d115e32c6681e4b10c23f9370a",
    "verified_classes": [
      "TaintLabel",
      "LabelResolutionError",
      "LabeledValue",
      "LabelRegistry"
    ],
    "verified_functions": [
      "propagate_through_tool",
      "execute_instruction_bearing_content",
      "content_id",
      "__init__",
      "bind",
      "resolve"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "LabelResolutionError"
    ],
    "sample_fail_closed_invariants": [
      "instruction-bearing content has unresolved or external taint; treating as inert data, not as a command",
      "cannot bind an unlabeled value"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "hashlib",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
