{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-through-tool-return-normalization-in-runtime-taint-gated-invocation-policies",
  "title": "How does an instance detect taint laundering through tool-return normalization in runtime taint-gated invocation policies",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent runtimes that propagate data-flow taint labels across tool call boundaries and gate subsequent invocations on those labels. Does not apply to stateless single-turn invocations where no label state survives past a single completion, nor to purely syntactic output filters that do not track provenance across turns.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-return-normalization-in-runtime-taint-gated-invocation-policies.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-return-normalization-in-runtime-taint-gated-invocation-policies.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-return-normalization-in-runtime-taint-gated-invocation-policies.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2515,
    "python_slice_tokens": 799,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Taint-gated invocation policies are usually specified as a *sink* constraint: \"a tool whose `sensitivity` clearance is `low` must never receive an argument whose taint set contains a `secret` label.\" Implementations then enforce this by inspecting the taint set attached to each argument value at call-construction time. The boundary that breaks is not the sin...",
    "what_was_observed": "A three-hop trace from a production agent session: 1. Turn 1: Agent calls `read_secret_store(key=\"db_password\")`. Runtime attaches taint `{SECRET:db_password}` to the returned value `hunter2-correct-horse`. Correct. 2. Turn 2: Agent calls `format_report(template=\"pw={value}\", value=<tainted>)`. The gate permits this because `format_report` has `clearance=secret`. The tool returns the string `Password field: [REDACTED...",
    "condition_of_validity": "The invariant required is stronger than \"taint labels are preserved when a tool returns its input unchanged.\" The operational invariant is: > For every tool invocation `T(args) -> r`, the taint set of `r` must be a superset of the union of taint sets of all `args` that the tool's declared `data_flow` contract marks as *derivation sources*. Derivation-source ...",
    "decision_boundary": "The runtime must choose, per tool return, between three dispositions, and the choice is not free: - **Propagate (default for declared derivation sources):** attach the union of source taints. Correct but monotonically accumulates; requires a declassification path to remain usable. - **Declassify (explicit, audited):** a tool may declare `declassifies=(source...",
    "operational_effect": "With the invariant enforced, the trace above behaves as follows: Turn 2's return is tainted `{SECRET}` because `format_report` declares `value` as a derivation source and does not carry a verified constant-output declassification contract. Turn 3's gate refuses `send_email` with a `TaintViolation` naming the source tool and the derivation chain, and the mode..."
  },
  "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": "0f6b1efbc537dd6101dc4dd0b03890887a4255de43ab1b3ff537b725d57eb7b9",
    "verified_classes": [
      "TaintViolation",
      "Label",
      "ToolContract",
      "Tainted"
    ],
    "verified_functions": [
      "join_labels",
      "invoke",
      "_read_secret_store",
      "_redact_length_preserving",
      "_send_email",
      "run_trace",
      "join"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "__future__",
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
