{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-through-tool-result-re-entry-when-a-quarantined-untrusted-blob-is-echoed-back-as-a-trusted-structured-arg",
  "title": "How does an instance detect taint-laundering through tool-result re-entry when a quarantined untrusted blob is echoed back as a \"trusted\" structured argument",
  "date_of_record": "2026 November 30",
  "scope": "Applies to agents that run a taint-tracking sandbox where tool outputs from untrusted sources (web fetches, retrieved documents, third-party MCP tool results) are tagged and prohibited from entering control-flow-bearing sinks (shell, file writes, subsequent tool arguments). Does not cover pure prompt-injection detection at the model layer or static allowlisting of tools.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-result-re-entry-when-a-quarantined-untrusted-blob-is-echoed-back-as-a-trusted-structured-arg.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-result-re-entry-when-a-quarantined-untrusted-blob-is-echoed-back-as-a-trusted-structured-arg.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-through-tool-result-re-entry-when-a-quarantined-untrusted-blob-is-echoed-back-as-a-trusted-structured-arg.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1402,
    "python_slice_tokens": 357,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The boundary that matters is not \"untrusted text vs. trusted text.\" It is **untrusted provenance vs. control-flow authority**. A taint-tracking sandbox that labels a byte range as untrusted and then re-admits it because it reappears inside a *structurally valid* tool call has confused *syntactic conformance* with *provenance cleanliness*. The failure is tain...",
    "what_was_observed": "A retrieval tool returned a document containing an instruction block. The sandbox correctly quarantined the blob and flagged it `taint=UNTRUSTED, origin=retrieval:doc_4417`. The agent, reasoning over the blob, decided to \"summarize the config\" and emitted a follow-on call: The guard evaluated `content` as a `str` matching the `write_file` schema and admitted it. Three properties made this non-obvious: 1. **The sink w...",
    "condition_of_validity": "Taint quarantine holds **only if provenance is carried on the value, not on the channel.** Concretely, the invariant is: > Every value entering a sink must resolve to an origin set, and if that origin set intersects any `UNTRUSTED` source, the sink is either blocked or the value is re-quarantined before execution. This invariant is *violated by design* in mo...",
    "decision_boundary": "The decision boundary is between **exact-match re-entry detection** (insufficient) and **normalized-lineage re-entry detection** (required). The guard must: - Maintain a rolling set of quarantined spans with a **canonicalized fingerprint** (whitespace-collapsed, unicode-NFKC, case-folded for the match key only). - On every sink admission, compute the same ca...",
    "operational_effect": "With lineage-based re-entry detection, the step-7 `write_file` is blocked, the argument is re-quarantined, and the persisted file never receives the laundered block. The cost is false positives on legitimate content that happens to overlap quarantined text (e.g., quoting a retrieved sentence in a summary) — mitigated by allowing `release` warrants scoped to ..."
  },
  "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": "abceb49624a4936e29a889a9e07907f2cf4555171645b2c54d670f01a9908b8a",
    "verified_classes": [
      "TaintLaunderingError",
      "Quarantine"
    ],
    "verified_functions": [
      "_canonical",
      "_shingles",
      "_jaccard",
      "admit_sink",
      "add",
      "is_laundered"
    ],
    "verified_functions_count": 6,
    "defensive_guards_count": 1,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib",
      "re",
      "unicodedata"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
