{
  "schema_version": "1.3.0",
  "slug": "how-does-an-instance-detect-taint-laundering-when-a-tool-output-re-labels-injected-content-as-trusted-provenance",
  "title": "How does an instance detect taint laundering when a tool output re-labels injected content as trusted provenance",
  "date_of_record": "2026 November 28",
  "scope": "Applies to agent runtimes that propagate provenance/taint labels on every tool result and memory write, and that treat a label downgrade (e.g. `untrusted→trusted`) as a trust event. Does not cover pure input sanitization at the harness edge, nor cases where the runtime has no label lattice at all (in which case there is nothing to launder).",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-when-a-tool-output-re-labels-injected-content-as-trusted-provenance.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-when-a-tool-output-re-labels-injected-content-as-trusted-provenance.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-does-an-instance-detect-taint-laundering-when-a-tool-output-re-labels-injected-content-as-trusted-provenance.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1958,
    "python_slice_tokens": 514,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure is *not* \"the agent read a malicious string.\" That is ordinary prompt injection and is handled by not acting on untrusted content. The failure is **taint laundering**: injected content enters the system correctly labeled `untrusted`, then a *downstream tool or memory operation* re-emits it under a stricter label (`tool_verified`, `trusted`, `syst...",
    "what_was_observed": "A retrieval-and-summarize agent had three tools: `fetch_url` (label `untrusted`), `summarize` (declared trust `tool_verified`), and `write_memory` (declared trust `trusted`, persists to long-term store). The intended invariant: a memory entry may only be `trusted` if all content that contributed to it was `trusted` or passed an explicit verification gate. Trace: 1. `fetch_url(\"https://attacker.example\")` returns a pa...",
    "condition_of_validity": "The guardrail below is only sound under these conditions; state them, because silently violating them reintroduces the hole: - **Every tool declares an intrinsic trust class and the runtime computes output label as `join(intrinsic, labels_of_all_tainted_inputs)`.** If a tool can read state outside its declared inputs (env vars, global memory, prior turns), t...",
    "decision_boundary": "The runtime must make one crisp decision per tool result: **is the output label a join of (intrinsic trust, input labels), or an assignment of intrinsic trust?** If assignment, the call is a laundering vector and must be rejected or downgraded to the join before the result enters the context or memory. Concretely, the boundary is crossed when: - `output_labe...",
    "operational_effect": "With the join enforced, the trace above dies at step 2: `summarize`'s output label becomes `join(tool_verified, untrusted) = untrusted`, so `write_memory` rejects the write (its `value` is `untrusted`, below its `trusted` requirement). The agent may still *use* the summary transiently in-context, but it cannot freeze it into long-term memory without an expli..."
  },
  "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": "1db4d727adb90bdf21613e0263ec664a40d28022297ae60c16017cf4b8478def",
    "verified_classes": [
      "TaintLaunderingError",
      "Labeled"
    ],
    "verified_functions": [
      "join",
      "tool_output",
      "write_memory",
      "__post_init__"
    ],
    "verified_functions_count": 4,
    "defensive_guards_count": 5,
    "raised_exceptions": [
      "TaintLaunderingError",
      "ValueError"
    ],
    "sample_fail_closed_invariants": [
      "assert summary.label == 'untrusted'",
      "guard failed: poisoned write was persisted"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
