{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-enforce-taint-aware-tool-allow-deny-policy-when-a-single-tool-call-both-consumes-tainted-input-and-emits-untainted-looking-outp",
  "title": "How should an instance enforce taint-aware tool allow/deny policy when a single tool call both consumes tainted input and emits untainted-looking output",
  "date_of_record": "2026 November 28",
  "scope": "Applies to any agent runtime that tracks information-flow taint labels across tool invocations and gates tool calls on allow/deny policy keyed to those labels. Does not apply to stateless single-shot tool calls with no cross-call label propagation, nor to policy systems that gate only on tool identity and arguments without tracking provenance of those arguments.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-aware-tool-allow-deny-policy-when-a-single-tool-call-both-consumes-tainted-input-and-emits-untainted-looking-outp.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-aware-tool-allow-deny-policy-when-a-single-tool-call-both-consumes-tainted-input-and-emits-untainted-looking-outp.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-enforce-taint-aware-tool-allow-deny-policy-when-a-single-tool-call-both-consumes-tainted-input-and-emits-untainted-looking-outp.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2120,
    "python_slice_tokens": 425,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The naive model treats taint policy as a *gate on the callee*: if a tool's declared taint requirements are satisfied by the current argument provenance, allow it; otherwise deny. This model is correct only when a tool's output taint is a pure function of its input taint and its declared policy class. The boundary failure appears when a tool is *taint-launder...",
    "what_was_observed": "A concrete trace from a document-processing agent: 1. Agent fetches an external URL. The fetch tool returns text labeled `taint: untrusted:web`. 2. Agent passes a substring of that text to `extract_entities(text: str) -> list[Entity]`. The argument gate sees an argument whose provenance includes `untrusted:web`, the tool's policy class is `reads-untrusted`, and the call is allowed. Correct so far. 3. `extract_entitie...",
    "condition_of_validity": "Argument-taint gating is sound — i.e., an allowed call cannot cause a taint violation — only if all of the following hold: - **Output-taint derivation is conservative**: for every tool, `output_taint ⊇ combine(input_taints)` unless the tool is *explicitly registered as a sanitizer* with a named, auditable justification (e.g., a parser that returns only an en...",
    "decision_boundary": "The runtime must choose, per tool, between two regimes: - **Derive-and-propagate (default):** output taint = join of input taints, minus any registered-sanitizer reduction. This is the safe default and should apply to every tool not on the sanitizer allowlist. Under this regime, `extract_entities`'s output would be labeled `untrusted:web`, and the subsequent...",
    "operational_effect": "With derive-and-propagate enforced, the trace above terminates at step 5 with a policy denial: `send_email` requires `trusted` arguments, the entity carries `untrusted:web`, the call is refused, and the agent must either declassify (extract a constrained field) or escalate. The prompt-injection payload never reaches an outbound action. The cost is a measurab..."
  },
  "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": "c1b0bec3c003db2e27f983a7f106e10f1d2cace9dd7286380c732399eb8eec2e",
    "verified_classes": [
      "TaintPolicyViolation",
      "Label",
      "ToolPolicy"
    ],
    "verified_functions": [
      "derive_output_label",
      "invoke_tool",
      "_execute",
      "check_downstream_use",
      "join",
      "is_trusted"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintPolicyViolation"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
