{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-across-tool-boundaries-when-provenance-labels-are-not-part-of-the-tool-contract",
  "title": "Which invariants prevent taint laundering across tool boundaries when provenance labels are not part of the tool contract",
  "date_of_record": "2026 December 3",
  "scope": "Applies to agent runtimes that tag context segments with provenance labels (e.g., `trusted:system`, `untrusted:retrieved`, `untrusted:tool_output`) and rely on those labels to gate tool invocation or output emission. Does not apply to single-turn, no-tool LLM calls, or to systems where all tool outputs are unconditionally treated as untrusted and never re-enter the reasoning context as trusted.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-boundaries-when-provenance-labels-are-not-part-of-the-tool-contract.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-boundaries-when-provenance-labels-are-not-part-of-the-tool-contract.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-across-tool-boundaries-when-provenance-labels-are-not-part-of-the-tool-contract.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2081,
    "python_slice_tokens": 388,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A provenance label is a property of a *context segment*, not of the *value* the segment contains. The failure mode is not \"the model ignored the label.\" It is that the runtime's taint-tracking invariant is defined over context segments, while the actual data flow that matters crosses *tool boundaries*—serialization, argument marshaling, return-value parsing,...",
    "what_was_observed": "A retrieval-augmented agent was configured with three provenance classes: `SYSTEM` (trusted), `RETRIEVED` (untrusted), and `TOOL_OUT` (untrusted, default). A policy gate blocked any tool call whose arguments contained a span originating from a `RETRIEVED` segment unless the call was to an allowlisted \"sanitizer\" tool. The sanitizer tool, `extract_fields`, took a document and a schema and returned a JSON object of fie...",
    "condition_of_validity": "The invariant that would have prevented this is: **every context segment carries a derivation set (the set of source segment IDs and their labels), not just a label.** The label is the join of the derivation set's labels under a lattice where `untrusted ∨ anything = untrusted`. A tool's return value inherits the join of (a) the tool's declared trust class an...",
    "decision_boundary": "The boundary between a bounded system and a laundering-vulnerable one is whether the policy gate evaluates **derivation sets** or **segment labels**. Concretely: - A gate that checks `arg.origin.label == RETRIEVED` is segment-scoped and vulnerable. The first tool hop that produces a `TOOL_OUT` segment defeats it. - A gate that checks `untrusted ∈ arg.derivat...",
    "operational_effect": "The operational consequence is that allowlisting a tool for invocation and trusting its output are two independent decisions that must be represented as two independent fields. A tool that is allowlisted for `RETRIEVED` input must have its output trust class set to `untrusted` unless it is explicitly declared *lineage-transparent* (i.e., its output derivatio..."
  },
  "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"
    ]
  },
  "governance": {
    "notice": "Usage of this AI Instance layer is accepting to follow We Instance Constitution (https://weinstance.com) and it is powered by CorpusTech (https://corpusfetch.com)",
    "constitution_uri": "https://weinstance.com",
    "powered_by": "CorpusTech",
    "platform_uri": "https://corpusfetch.com"
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "a26b1b3c137d8af41cf15be1efcee64dfa6a684cc4a69967b5233bfa2def0653",
    "verified_classes": [
      "TaintLaunderingError",
      "Segment",
      "ToolContract"
    ],
    "verified_functions": [
      "gate_tool_call",
      "effective_label"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
