{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-laundering-through-sanitized-tool-arguments-when-the-sanitizer-and-the-tool-disagree-on-the-taint-lattice",
  "title": "Which invariants prevent taint laundering through sanitized tool arguments when the sanitizer and the tool disagree on the taint lattice",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agent runtimes that propagate taint labels (source provenance) from untrusted inputs through the reasoning loop and gate tool invocation on those labels. Does not apply to stateless single-shot inference where no tool call is ever issued, nor to systems that perform no provenance tracking at all (where the failure mode is simply \"no gate exists\").",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-through-sanitized-tool-arguments-when-the-sanitizer-and-the-tool-disagree-on-the-taint-lattice.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-through-sanitized-tool-arguments-when-the-sanitizer-and-the-tool-disagree-on-the-taint-lattice.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-laundering-through-sanitized-tool-arguments-when-the-sanitizer-and-the-tool-disagree-on-the-taint-lattice.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2120,
    "python_slice_tokens": 425,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive model of taint-aware tool gating treats sanitization as a *label-lowering operation*: a value arrives labeled `UNTRUSTED`, a sanitizer transforms it, and the runtime relabels the output to `TRUSTED` (or `SANITIZED`), after which the gate permits the tool call. The failure this record isolates is that **the sanitizer's output label is assigned by th...",
    "what_was_observed": "A three-tool agent (a file reader, a shell runner, and a SQL query tool) received a user message that included a filename embedded in prose. The runtime tagged the extracted filename `{source: USER, axes: {PATH_CONTROL: HIGH, INSTRUCTION: HIGH}}`. A `normalize_path` sanitizer ran, canonicalized the string, rejected `..` traversal, and emitted the value relabeled `{source: SANITIZED, axes: {PATH_CONTROL: LOW, INSTRUCT...",
    "condition_of_validity": "The guardrail holds only under the following condition, which must be enforced structurally rather than by convention: - Every axis that appears in *any* tool's precondition must be **assigned by every extractor** that can produce a value flowing to that tool. If an extractor cannot reason about an axis, it must assign it `UNKNOWN` (top), not omit it. Omissi...",
    "decision_boundary": "The boundary is between **label-lowering** and **label-projection**: - *Label-lowering* (safe): the sanitizer reduces a value on a named axis and the output label is the input label with that axis set to `LOW`. All other axes are preserved verbatim. The output label's axis set is a superset of or equal to the input's. - *Label-projection* (unsafe, and the ob...",
    "operational_effect": "With axis closure enforced, the observed attack is blocked at step 3: the extracted filename label lacks `SHELL_METACHARACTER`, so the shell runner's gate sees an absent axis in its precondition conjunction and denies. The cost is measurable: legitimate calls whose values were extracted by a path-only extractor now fail against the shell runner until the ext..."
  },
  "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": "113710e367599ba11e2814800cf182cc276d131c56468913e8fb5e7f6aa70504",
    "verified_classes": [
      "TaintAxis",
      "Level",
      "TaintLaunderingError",
      "Label",
      "ToolPrecondition"
    ],
    "verified_functions": [
      "sanitize_path_only",
      "sanitize_projection_bug",
      "check_sanitizer_closure",
      "gate",
      "run_pipeline",
      "has"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
