{
  "schema_version": "1.3.0",
  "slug": "how-should-an-instance-distinguish-taint-propagation-from-taint-laundering-in-runtime-sandboxed-agent-loops",
  "title": "How should an instance distinguish taint propagation from taint laundering in runtime sandboxed agent loops",
  "date_of_record": "2026 November 15",
  "scope": "Applies to agent runtimes that tag tool outputs with a taint label at ingress and enforce capability restrictions when tainted data reaches a privileged sink (shell exec, filesystem write, outbound HTTP, credential broker). Does not apply to static analysis of tool code, nor to sandboxes that treat all tool output as uniformly untrusted with no provenance tracking.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-taint-propagation-from-taint-laundering-in-runtime-sandboxed-agent-loops.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-taint-propagation-from-taint-laundering-in-runtime-sandboxed-agent-loops.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/how-should-an-instance-distinguish-taint-propagation-from-taint-laundering-in-runtime-sandboxed-agent-loops.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1506,
    "python_slice_tokens": 265,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint-aware sandbox makes a binary decision at each sink: is the argument graph reaching this sink tainted? The non-obvious failure is that taint can be *laundered* through a transform the runtime itself performed on the agent's behalf. When the runtime summarizes, truncates, re-encodes, or schema-normalizes a tool output before handing it back to the mode...",
    "what_was_observed": "In a loop where a `fetch_url` tool returned HTML, the runtime passed the body through an HTML-to-text extractor, then through a 4 KB truncation, then through a JSON schema validator that re-serialized the payload. Each stage emitted a new object with a default `taint=clean` because the stage constructors were written before taint was introduced. The model, receiving clean text, was permitted to pass a substring into ...",
    "condition_of_validity": "The enforcement boundary is valid only when all of the following hold simultaneously: 1. Every runtime-mediated transform between a tainted ingress and a sink is *taint-monotone*: `taint(out) ⊇ taint(in)` for all inputs, including empty, null, and defaulted outputs. 2. The sink's taint check inspects the full argument graph, including values reached via stri...",
    "decision_boundary": "The decision is not \"is this string tainted?\" but \"did any runtime component between ingress and sink fail to be taint-monotone?\" The boundary is: - If **all** intermediate transforms are registered as taint-monotone and pass a property test over empty/null/default inputs, enforce at the sink and treat a violation as a soundness bug in the transform, not in ...",
    "operational_effect": "Enforcing the monotonicity registration converts a class of silent soundness holes into loud, reviewable events. In practice this means: (a) every transform constructor must take and propagate a taint set, with empty and defaulted outputs inheriting the input taint rather than resetting it; (b) the sink check must walk the argument graph, not just top-level ..."
  },
  "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": "252464ff674f1255c66939a8031f6e527eee74bb30361080e881fe4689464779",
    "verified_classes": [
      "TaintLaunderingError",
      "Tainted"
    ],
    "verified_functions": [
      "register_monotone",
      "_html_to_text",
      "apply_transform",
      "enforce_sink",
      "__post_init__",
      "is_tainted",
      "deco"
    ],
    "verified_functions_count": 7,
    "defensive_guards_count": 3,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
