{
  "schema_version": "1.3.0",
  "slug": "what-structural-signals-indicate-taint-laundering-across-sequential-tool-calls-when-a-sanitizer-s-output-schema-is-a-superset-of-its-input-schema",
  "title": "What structural signals indicate taint-laundering across sequential tool calls when a sanitizer’s output schema is a superset of its input schema",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that enforce taint-aware capability gating by tagging context spans (tool outputs, retrieved documents, user turns) as `trusted`/`untrusted` and permitting side-effecting tool calls only when all arguments derive from trusted spans. Does not address prompt injection that arrives entirely within the trusted system prompt, nor taint propagation through model-internal reasoning that never re-enters the context as a discrete span.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-sequential-tool-calls-when-a-sanitizer-s-output-schema-is-a-superset-of-its-input-schema.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-sequential-tool-calls-when-a-sanitizer-s-output-schema-is-a-superset-of-its-input-schema.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/what-structural-signals-indicate-taint-laundering-across-sequential-tool-calls-when-a-sanitizer-s-output-schema-is-a-superset-of-its-input-schema.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2296,
    "python_slice_tokens": 540,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model of a taint sanitizer is a *filter*: untrusted bytes go in, a cleaned value comes out, and the output inherits a fresh `trusted` label because the sanitizer is trusted code. This model holds when the sanitizer is a total function with a *narrowing* output schema — its output domain is a subset of its input domain, so the label `trusted...",
    "what_was_observed": "Consider a three-call chain. The agent holds a user turn containing an untrusted document `D` (labeled `untrusted`). It invokes: 1. `summarize(D)` → returns `S` (labeled `untrusted`, correctly). 2. `extract_actions(S)` → a trusted tool that returns `{\"actions\": [{\"verb\": str, \"target\": str, \"params\": dict}]}`. Because `extract_actions` is registered as a sanitizer, the gate relabels its output `T` as `trusted`. The s...",
    "condition_of_validity": "The laundering requires all three of the following to co-occur: - **Widening sanitizer on the path.** At least one tool between the untrusted source and the side-effecting sink declares an output schema that is a superset of its input schema in the sense that it admits arbitrary string/dict leaves not constrained by a trusted allowlist. Narrowing sanitizers ...",
    "decision_boundary": "The operational decision is *when to promote a sanitizer’s output to `trusted`*. The boundary is not \"is the sanitizer trusted code\" (it always is) but \"does the sanitizer’s output schema constrain its result to values derivable from trusted inputs.\" Two regimes: - **Below the boundary (promote):** the sanitizer is a *narrowing* function — its output schema ...",
    "operational_effect": "The practical consequence is that taint-gating policies registered as flat allowlists of \"sanitizer tools\" systematically over-grant capability in any agent that uses LLM-generated structured extraction as an intermediate step — which is to say, most agents that do retrieval-then-act. The failure is silent: the gate logs a `trusted` promotion, the side effec..."
  },
  "matched_failure_symptoms": [
    "SCHEMA_DRIFT_OR_COERCION_CRASH"
  ],
  "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": "be02f26076031c2ff515011b5628fa910ebf5f21c59a9589120ec53ca0692289",
    "verified_classes": [
      "TaintLaunderingError",
      "Span",
      "SanitizerSpec"
    ],
    "verified_functions": [
      "promote_sanitizer_output",
      "gate_side_effecting_call",
      "_walk_leaf_paths"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
