{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-label-laundering-when-a-tainted-value-is-re-serialized-through-a-trusted-tool-boundary",
  "title": "Which invariants prevent label laundering when a tainted value is re-serialized through a trusted tool boundary",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agents that propagate dynamic information-flow (taint) labels across tool-call boundaries via re-serialization, and must decide whether a downstream sink is safe. Does not cover static source-level taint analysis or label propagation that stays entirely inside one model context.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-label-laundering-when-a-tainted-value-is-re-serialized-through-a-trusted-tool-boundary.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-label-laundering-when-a-tainted-value-is-re-serialized-through-a-trusted-tool-boundary.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-label-laundering-when-a-tainted-value-is-re-serialized-through-a-trusted-tool-boundary.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1686,
    "python_slice_tokens": 518,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary failure addressed here is not \"tainted data reached the model.\" It is **label laundering**: a value carrying a high-integrity taint label (e.g., `UNTRUSTED:web_fetch`, `INJECTED:tool_output`) passes through a tool whose *output type* is nominally trusted, and the label is silently dropped because the tool's contract only describes the *shape* of...",
    "what_was_observed": "A three-tool chain: `web_fetch` → `extract_field` → `run_command`. The `extract_field` tool is registered with a schema declaring `output: {type: \"string\", trust: \"derived\"}`. The agent's taint tracker assigned `UNTRUSTED` to the `web_fetch` body, correctly propagated it to the extracted substring, and then — at the `extract_field` boundary — applied a rule of the form *\"output trust = declared trust of tool\"*, overw...",
    "condition_of_validity": "The laundering is only possible when all of the following hold, which defines exactly when this invariant matters: 1. A tool boundary re-serializes its input (parse → transform → emit), so output bytes are not the same object identity as input bytes. 2. The taint rule at that boundary is *declarative* (uses the tool's declared output trust) rather than *deri...",
    "decision_boundary": "The correct rule is **label join, never label substitution**, at every re-serializing boundary: where `⊔` is the lattice join (least upper bound) and `declared_floor` can only *raise* the floor, never lower a propagated label. A tool may declare \"my output is at least `derived`,\" but it may never declare \"my output is exactly `derived`\" in a way that discard...",
    "operational_effect": "Enforcing the join invariant changes behavior in three measurable ways. First, legitimate pass-through tools (parsers, normalizers) now *propagate* taint instead of clearing it, so downstream sinks that previously passed now block — this surfaces real injection paths but also raises false-positive blocks on genuinely sanitized data. The mitigation is an expl..."
  },
  "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": "2a86c473e2b716f083fcfda96250f77727c75c16f3b302e76a688816f8ce005d",
    "verified_classes": [
      "LabelLaunderingError",
      "Labeled"
    ],
    "verified_functions": [
      "join_labels",
      "register_tool",
      "apply_boundary",
      "sink_check",
      "reproduce",
      "register_defective_tool",
      "join"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 6,
    "raised_exceptions": [
      "LabelLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "sink failed to block laundered-but-tainted arg",
      "defective tool contract was accepted; join invariant not enforced"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
