{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-of-a-tainted-tool-output-silently-lose-its-taint-when-it-crosses-a-serialization-boundary-in-agentic-pipelines",
  "title": "Why does an instance of a tainted tool output silently lose its taint when it crosses a serialization boundary in agentic pipelines?",
  "date_of_record": "2026 November 17",
  "scope": "Applies to agentic pipelines where tool outputs are labeled with provenance/taint metadata (e.g., \"untrusted\", \"external\", \"user-supplied\") and that taint is expected to propagate through transformations, message queues, and model context assembly. Does not apply to pipelines where taint is enforced by a single in-process reference monitor that never serializes intermediate values, nor to pipelines where tool outputs are always treated as uniformly untrusted by construction.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-tainted-tool-output-silently-lose-its-taint-when-it-crosses-a-serialization-boundary-in-agentic-pipelines.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-tainted-tool-output-silently-lose-its-taint-when-it-crosses-a-serialization-boundary-in-agentic-pipelines.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-of-a-tainted-tool-output-silently-lose-its-taint-when-it-crosses-a-serialization-boundary-in-agentic-pipelines.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1340,
    "python_slice_tokens": 241,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint propagation has two distinct failure surfaces: **value-level propagation** (does the tainted *data* reach a sink?) and **label-level propagation** (does the taint *annotation* survive the transport that carries the data?). Most runtime taint systems are designed and tested against the first surface — they instrument string concatenation, template rende...",
    "what_was_observed": "In a pipeline that fetched a document via an HTTP tool, the tool wrapper attached `taint=\"external\"` to the returned `ToolResult`. The orchestrator passed the result to a summarizer step that serialized it to JSON over an internal queue. On the consumer side, the deserialized object was a plain dict; the `taint` field was absent from the schema, so the summarizer emitted a summary labeled `trusted`. That summary was ...",
    "condition_of_validity": "The invariant \"a tainted value remains tainted at every downstream sink\" holds **only if** every transport between producer and sink carries the label envelope, **or** if the sink re-derives taint from an out-of-band provenance record. It is violated whenever: 1. The serialization schema omits the label field (the common case — schemas are written for payloa...",
    "decision_boundary": "Treat any value that crosses a serialization, queue, checkpoint, or model-context boundary as **taint-unknown**, not taint-clean. The decision rule: - If the transport carries an explicit label envelope → propagate the label as-is. - If the transport omits the label → **fail closed**: re-taint to the most restrictive level consistent with the producer, or re...",
    "operational_effect": "Pipelines that adopt envelope-carrying transports (labels in the schema, signed provenance records, or a side-channel provenance store keyed by value hash) restore the invariant at the cost of schema churn and a small serialization overhead. Pipelines that do not must accept that taint is a *per-process* property and that every boundary is a potential launde..."
  },
  "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": "6e84608eb9056af0b37355438ebef47912d77d0e37b9377305c9ed978c964353",
    "verified_classes": [
      "TaintEnvelopeMissingError"
    ],
    "verified_functions": [
      "propagate_across_boundary",
      "build_command"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintEnvelopeMissingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
