{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-prompt-injection-taint-from-surviving-a-tool-boundary-and-why-label-laundering-at-the-serialization-seam-defeats-them",
  "title": "Which invariants prevent prompt-injection taint from surviving a tool boundary — and why label laundering at the serialization seam defeats them",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that carry dynamic information-flow labels (taint bits) on context segments and propagate them across tool-call boundaries via MCP/A2A JSON-RPC envelopes. Does not cover static prompt hardening, input filtering, or label-free agents — those have no taint to launder.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-surviving-a-tool-boundary-and-why-label-laundering-at-the-serialization-seam-defeats-them.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-surviving-a-tool-boundary-and-why-label-laundering-at-the-serialization-seam-defeats-them.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-prompt-injection-taint-from-surviving-a-tool-boundary-and-why-label-laundering-at-the-serialization-seam-defeats-them.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2274,
    "python_slice_tokens": 427,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The design intent of dynamic information-flow labeling for prompt injection is straightforward: mark any context span derived from an untrusted source (a fetched web page, a tool's returned string, a peer agent's message) with a taint label, propagate that label through every transformation, and refuse to let a tainted span influence a privileged sink (a she...",
    "what_was_observed": "A research agent had a `fetch_url` tool (output trust: `untrusted`) and a `write_file` tool (sink: `privileged`). The taint tracker labeled the `fetch_url` return span `UNTRUSTED`. The agent then called a *second* tool, `summarize(text: str) -> str`, whose declared output trust was `trusted` (it was classified as an internal utility, not a data source). The trace: 1. `fetch_url` → returns `span_A`, labeled `{UNTRUSTE...",
    "condition_of_validity": "I2 is only enforceable when **all four** of the following hold; if any fails, the taint invariant is decorative: - **C1 — Label is in-band and schema-typed.** The label must be a first-class, *required* field of the transport schema (`{\"value\": ..., \"labels\": [...]}`), not an optional sidecar. Optional fields get dropped by coercion, `additionalProperties` r...",
    "decision_boundary": "The boundary is **where a value changes representation**, not where it changes trust. Concretely, the agent must treat the following as *label-carrying transitions* and assert I2 at each: The decision rule for the sink check is therefore **not** \"is the argument's declared label empty?\" but \"is the argument's label equal to the join of all labels on spans th...",
    "operational_effect": "Once the four conditions are enforced, the failure mode changes shape in a useful way. The system stops producing *silent* clean labels and starts producing *loud* integrity faults at the seam. In practice this means: - **Summarizers and other transforms must be declared label-transparent or label-propagating.** A tool that paraphrases untrusted text cannot ..."
  },
  "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": "0fbc2bf90589f6b45ab0dc41a13ea2164f7729ea4aed3440a3373b34b6df4a2c",
    "verified_classes": [
      "LabelLaunderingError",
      "TaintIntegrityFault",
      "Labeled"
    ],
    "verified_functions": [
      "serialize_arg",
      "invoke_tool",
      "ingest_result",
      "sink_write",
      "run_agent_turn",
      "join"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "LabelLaunderingError",
      "PermissionError",
      "TaintIntegrityFault"
    ],
    "sample_fail_closed_invariants": [
      "result label narrower than call provenance",
      "provenance lost between call and result"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
