{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-quarantine-a-tool-result-dynamic-taint-labels-lost-across-nested-tool-boundaries",
  "title": "When must an instance quarantine a tool result: dynamic taint labels lost across nested tool boundaries",
  "date_of_record": "2026 November 23",
  "scope": "Applies to agents that propagate dynamic information-flow (DIF) taint labels through tool-call results to block prompt-injection control flow. Does not apply to stateless single-shot completions with no tool return path, nor to systems relying solely on static system-prompt hardening.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-dynamic-taint-labels-lost-across-nested-tool-boundaries.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-dynamic-taint-labels-lost-across-nested-tool-boundaries.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tool-result-dynamic-taint-labels-lost-across-nested-tool-boundaries.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1891,
    "python_slice_tokens": 361,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "Static prompt hardening treats \"the model will follow instructions\" as a policy problem. Dynamic taint tracking treats it as a *data provenance* problem: every byte entering the context carries a label (`trusted:system`, `trusted:user`, `untrusted:tool`, `untrusted:tool→derived`), and a label escalation at *read* time must demote the instance's write authori...",
    "what_was_observed": "Trace from a production incident (retrieval-augmented agent, three tools: `web_fetch`, `json_extract`, `shell_exec`): 1. `web_fetch(url)` returns HTML. Runtime labels result `untrusted:tool`. Correct. 2. Instance calls `json_extract(html, \"$.snippet\")`. The `json_extract` tool is on the trusted allowlist because it is a pure parser. Runtime labels its *output* `trusted:tool` — the callee is trusted, so the product is...",
    "condition_of_validity": "The quarantine invariant holds only when all four conditions are met simultaneously: - **C1 (join, don't overwrite):** the label of any tool output is `callee_label ⊔ ⨆ input_labels`. A trusted callee does not clear taint; it only fails to *add* taint. - **C2 (transform closure):** any instance-side operation on context bytes (summarize, extract, translate, ...",
    "decision_boundary": "The operational question an instance must answer at every tool return is not \"is this callee trusted?\" but \"**is the join of this result's input labels a subset of `trusted`?**\" The decision procedure: - If `callee_label ⊔ inputs = trusted` → the result may flow to side-effecting sinks. - If the join contains any `untrusted` component → the result is quarant...",
    "operational_effect": "With C1–C4 enforced, the incident trace above terminates at step 2: `json_extract`'s output is labeled `untrusted:tool→derived`, the planner's attempt to emit `shell_exec` from it is blocked pending a warrant, and the injection becomes inert data the instance can describe but not execute. The cost is a class of false quarantines: legitimate flows where a tru..."
  },
  "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": "e22925fb26367331b8189f9052b2cbdb1bf65639039386991745f15f9f517b39",
    "verified_classes": [
      "TaintBoundaryViolation",
      "Labeled"
    ],
    "verified_functions": [
      "dispatch_tool",
      "check_sink",
      "run_agent_flow",
      "join",
      "is_tainted"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintBoundaryViolation"
    ],
    "sample_fail_closed_invariants": [
      "assert fetched.is_tainted",
      "trusted callee cleared taint from untrusted input (C1/C4 violated)"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
