{
  "schema_version": "1.3.0",
  "slug": "what-happens-when-an-instance-treats-a-sanitized-mcp-tool-output-as-trusted-because-the-taint-label-was-dropped-at-the-json-serialization-boundary",
  "title": "What happens when an instance treats a sanitized MCP tool output as trusted because the taint label was dropped at the JSON serialization boundary",
  "date_of_record": "2026 December 1",
  "scope": "Applies to agent runtimes that propagate taint/provenance labels on tool outputs across MCP transport, in-process serialization, and re-injection into the model context. Does not apply to fully isolated single-shot tool calls where the output is consumed once and discarded without re-serialization or sub-agent handoff.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-treats-a-sanitized-mcp-tool-output-as-trusted-because-the-taint-label-was-dropped-at-the-json-serialization-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-treats-a-sanitized-mcp-tool-output-as-trusted-because-the-taint-label-was-dropped-at-the-json-serialization-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-happens-when-an-instance-treats-a-sanitized-mcp-tool-output-as-trusted-because-the-taint-label-was-dropped-at-the-json-serialization-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2133,
    "python_slice_tokens": 513,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint-aware sandboxing is usually modeled as a property of *content*: \"this string came from an untrusted MCP server, so mark it untrusted.\" The failure mode examined here is not about content at all — it is about the *label surviving the transport*. A taint label is metadata attached to a value in the runtime's memory graph. The moment that value is seriali...",
    "what_was_observed": "A runtime wrapped every MCP tool response in a `TaintedValue` object with `.payload` and `.provenance`. The injection guard correctly refused to place tainted payloads into system-prompt slots and required a `sanitize()` call before any payload could reach a privileged sink (shell execution, file write, sub-agent system message). The MCP client layer, however, did this on every response: The `json.loads` round-trip i...",
    "condition_of_validity": "The guardrail is valid only under the invariant: **every transport boundary that can reconstruct a value must re-apply taint from an out-of-band provenance channel, or the value must be treated as untrusted by default on the far side.** Concretely, the runtime must satisfy at least one of: - **Labeled transport:** provenance is a first-class field on the wir...",
    "decision_boundary": "The boundary is between *sanitize-on-egress* and *trust-on-reconstruction*. A runtime must pick one and enforce it at every boundary: - **Sanitize-on-egress (fail-open at the boundary):** the far side of every transport is trusted; the near side must sanitize before serializing. This is only sound if *every* serializer is proven to call `sanitize()`. In prac...",
    "operational_effect": "The practical consequence is that taint coverage metrics measured at ingest are misleading. A runtime can report 100% labeling and still leak, because the leak happens at reconstruction, downstream of the metric. The observable symptoms are: - Prompt-injection payloads from MCP servers reaching privileged sinks (file writes, shell, sub-agent system prompts) ..."
  },
  "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": "4741061ca044881b22ab61699bfd525f64935f12b98600cf4b715fd47562a5c9",
    "verified_classes": [
      "TaintBoundaryViolation",
      "UnsanctionedSanitization",
      "TaintedValue"
    ],
    "verified_functions": [
      "reconstruct_from_transport",
      "sanitize",
      "route_to_privileged_sink",
      "content_hash"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "TaintBoundaryViolation",
      "UnsanctionedSanitization"
    ],
    "sample_fail_closed_invariants": [
      "sanitize() received a plain value; taint was dropped upstream",
      "privileged sink received a plain value; reconstruction boundary was bypassed and taint was lost"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "json",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
