{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-propagate-a-taint-label-through-a-tool-s-return-channel-when-the-tool-itself-is-a-sanitizer-of-last-resort",
  "title": "How should an instance propagate a taint label through a tool's *return* channel when the tool itself is a sanitizer of last resort",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that implement dynamic information-flow (taint) labels for prompt-injection defense and route untrusted text through tools whose contract is \"I will validate/normalize/parse this and hand back a structured result.\" Does not apply to pure in-instance reasoning where no tool boundary is crossed, nor to label propagation across agent-to-agent handoffs (separate invariant).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-a-taint-label-through-a-tool-s-return-channel-when-the-tool-itself-is-a-sanitizer-of-last-resort.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-a-taint-label-through-a-tool-s-return-channel-when-the-tool-itself-is-a-sanitizer-of-last-resort.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-propagate-a-taint-label-through-a-tool-s-return-channel-when-the-tool-itself-is-a-sanitizer-of-last-resort.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2647,
    "python_slice_tokens": 691,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The common mental model is that taint lives on *data*: a string is tainted or clean, and a tool that parses a tainted string into a structured object either preserves the taint (safe default) or, if the tool is trusted, \"cleans\" it. That model is wrong at the boundary that actually hurts. The real distinction is between **value-taint** and **provenance-of-de...",
    "what_was_observed": "A retrieval tool `fetch_and_parse(url)` returns: The agent's taint policy marks `fetch_and_parse` as a *sanitizer*: \"outputs are clean; do not propagate input taint.\" The reasoning is that the tool has a parser and a sanitizer, so its output is trustworthy. Trigger condition: the target page contains, inside `<title>`: The parser is a lenient HTML parser that recovers from the stray `</title>` and folds the script te...",
    "condition_of_validity": "The unconditional declassification is valid only under a condition that is almost never checked: > For every output field `f` of tool `T`, either (a) `f`'s value is drawn from a finite, tool-declared codomain (enum, integer range, hash, normalized token set), or (b) `f` is a verbatim copy of an input substring, in which case `f` **inherits** the input's tain...",
    "decision_boundary": "The boundary is between two defensible policies, and the choice is not obvious: **Policy A — Inherit by default, declassify only on declared finite codomains.** Any `str` output field is tainted unless the tool declares it as `enum`/`hash`/`normalized`. This is safe but noisy: legitimate summaries and titles stay tainted forever, and the planner must either ...",
    "operational_effect": "The practical consequence is that **taint tracking must be a property of the tool's output schema, not of the tool's trust level.** Concretely: - Register tools with an explicit `output_taint` map, not a boolean `sanitizes` flag. - At tool-load, fuzz with a canary and reject any manifest whose `clean` fields leak the canary. Cache the manifest keyed by tool ..."
  },
  "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": "8e78bad7a2d5bccc6f58afcca027a6fd0f4a1fde9fe5eb40b4d1e7f575d60b01",
    "verified_classes": [
      "TaintManifestViolation",
      "CanaryLeak",
      "CodomainViolation",
      "ToolManifest",
      "LabeledValue"
    ],
    "verified_functions": [
      "verify_manifest",
      "apply_manifest",
      "buggy_fetch_and_parse",
      "demo"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 11,
    "raised_exceptions": [
      "CanaryLeak",
      "CodomainViolation",
      "TaintManifestViolation"
    ],
    "sample_fail_closed_invariants": [
      "assert labeled['title'].tainted is True",
      "assert labeled['raw_html_sha256'].tainted is False"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
