{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-tainted-argument-laundering-across-a-quarantined-tool-boundary-when-privileged-execution-re-derives-provenance-from-scratch",
  "title": "Which invariants prevent tainted-argument laundering across a quarantined tool boundary when privileged execution re-derives provenance from scratch",
  "date_of_record": "2026 November 26",
  "scope": "Applies to agents that tag untrusted-content-derived values (retrieved web text, tool output, peer-agent messages) with a taint bit and quarantine them before passing them into a privileged tool (shell, file write, outbound HTTP, credential-bearing API). Does not cover taint propagation inside a single LLM completion where no external tool boundary is crossed, nor OS-level sandboxing (seccomp, namespaces) that operates below the agent layer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-argument-laundering-across-a-quarantined-tool-boundary-when-privileged-execution-re-derives-provenance-from-scratch.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-argument-laundering-across-a-quarantined-tool-boundary-when-privileged-execution-re-derives-provenance-from-scratch.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-tainted-argument-laundering-across-a-quarantined-tool-boundary-when-privileged-execution-re-derives-provenance-from-scratch.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1582,
    "python_slice_tokens": 324,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "A taint-aware sandbox has two jobs that are easy to conflate: *carrying* provenance across a boundary, and *enforcing* it at the privileged sink. The failure mode is not that taint is dropped at the boundary—that is loud and usually caught. The failure is that taint is **re-derived** on the privileged side from the argument's current syntactic form rather th...",
    "what_was_observed": "An agent was asked to summarize a fetched page and, as a follow-up, write a \"suggested filename\" derived from the page's `<title>`. The title contained a payload shaped like a shell fragment. The flow: 1. `fetch(url)` returns body, tagged `taint=external`. 2. The model extracts `title`, producing a string that still carries `taint=external` in the tool-call envelope. 3. The agent's own helper normalizes the title: lo...",
    "condition_of_validity": "The \"trusted transform declassifies\" rule is valid only when the transform is **taint-preserving-by-construction**: it must either (a) reject any input that can carry an active metacharacter for the sink's grammar, or (b) be proven to map the tainted alphabet into a safe subset (e.g., a slugifier that emits only `[a-z0-9_-]`). A generic `strip().replace(\" \",...",
    "decision_boundary": "At the privileged sink, the decision is not \"is this argument tainted?\" but \"does the derivation graph of this argument contain any `external` leaf that was not discharged by a *validated* declassifier for *this* sink?\" Three outcomes: - **Inherit and block:** any `external` leaf reaches the sink without a sink-validated declassifier → refuse, return the tai...",
    "operational_effect": "The practical consequence is that taint labels must be attached to **edges, not nodes**, and the privileged executor must do a graph walk, not a field read. Concretely: every tool call carries `inputs: [{value, taint, source_id}]` and `transform: {id, declassifies_for: [sink_ids]}`; the sink recomputes `effective_taint = union(input taints) minus declassific..."
  },
  "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": "806bed5f9deaaeffeb248febb06f8bf26319bf1bccebddd6515ef4cbd10e4774",
    "verified_classes": [
      "TaintLaunderingError",
      "Leaf",
      "Transform",
      "Derivation"
    ],
    "verified_functions": [
      "effective_taint",
      "privileged_execute"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "assert privileged_execute('write_file', deriv, ['notes_(id).md'])"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
