{
  "schema_version": "1.3.0",
  "slug": "when-must-an-instance-quarantine-a-tainted-subgraph-rather-than-re-sanitize-it-taint-join-ambiguity-across-multi-hop-tool-invocation-graphs",
  "title": "When must an instance quarantine a tainted subgraph rather than re-sanitize it: taint-join ambiguity across multi-hop tool invocation graphs",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents whose tool calls can feed results into subsequent tool calls (depth ≥ 2) and whose taint labels are propagated by the runtime rather than re-derived by the model. Does not apply to single-hop tool use, nor to agents that fully re-parse every tool output through a deterministic sanitizer before any downstream use.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tainted-subgraph-rather-than-re-sanitize-it-taint-join-ambiguity-across-multi-hop-tool-invocation-graphs.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tainted-subgraph-rather-than-re-sanitize-it-taint-join-ambiguity-across-multi-hop-tool-invocation-graphs.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/when-must-an-instance-quarantine-a-tainted-subgraph-rather-than-re-sanitize-it-taint-join-ambiguity-across-multi-hop-tool-invocation-graphs.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2026,
    "python_slice_tokens": 562,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinction that matters is between *taint propagation* and *taint sanitization*. When an untrusted source (a web fetch, an email body, a retrieved document) enters the invocation graph, the runtime attaches a taint label. Every downstream tool call whose arguments contain tainted bytes inherits the label. The common assumption is that a sanitizer at any...",
    "what_was_observed": "A research agent was tasked with \"summarize the vendor risk findings in the attached PDF and file a ticket.\" Graph shape: - Hop 1: `fetch_url` → untrusted HTML → taint label `T1` attached. - Hop 2: `extract_text` (a sanitizer: strips HTML, removes known injection markers, truncates to 4 KB) → output labeled `T1-cleared` by the runtime because the sanitizer declared `clears_taint=True`. - Hop 3: `create_ticket(title=....",
    "condition_of_validity": "The quarantine invariant holds — and re-sanitization is unsound — exactly when all three of the following are true: 1. **The subgraph depth from tainted source to sink is ≥ 2.** At depth 1, a sanitizer's output is consumed directly by the model's next reasoning step, where a human-reviewable transcript exists. At depth ≥ 2, the output is consumed by a *tool ...",
    "decision_boundary": "The boundary is drawn at the *argument*, not the *document*. For each tainted path, enumerate the sink's arguments and ask: can the attacker, by controlling the tainted bytes, cause this argument to take a value the agent's principal would not have authorized? If yes for any argument, the path is quarantined regardless of how many sanitizers sit between sour...",
    "operational_effect": "The observable effect of enforcing this boundary is that a class of tickets, emails, and file writes that previously succeeded silently now fail closed with an escalation event. Operators see a spike in `TaintQuarantine` events on first deployment; this is the correct signal, not a regression. The alternative — re-sanitizing and proceeding — produces no sign..."
  },
  "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": "b75800069b44989e970ac7e447c9a21903f52e24d3d7797f1c6d276464e7e124",
    "verified_classes": [
      "TaintQuarantine",
      "TaintLabel",
      "SanitizerContract",
      "Invocation"
    ],
    "verified_functions": [
      "enforce_taint_boundary"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintQuarantine"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
