{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-taint-propagated-tool-calls-from-surviving-a-sandbox-boundary-re-entry",
  "title": "Which invariants prevent taint-propagated tool calls from surviving a sandbox boundary re-entry",
  "date_of_record": "2026 December 1",
  "scope": "Applies to any agent runtime where untrusted content (tool output, retrieved documents, peer-agent messages) can influence a subsequent tool invocation, and where a sandbox enforces taint-based action blocking at the execution boundary. Does not cover static prompt sanitization or pure input filtering; the concern here is dynamic taint propagation across a multi-turn tool loop.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-propagated-tool-calls-from-surviving-a-sandbox-boundary-re-entry.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-propagated-tool-calls-from-surviving-a-sandbox-boundary-re-entry.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-taint-propagated-tool-calls-from-surviving-a-sandbox-boundary-re-entry.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2100,
    "python_slice_tokens": 386,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The distinguishing property of a taint-aware sandbox is that it does not block *content*; it blocks *provenance*. A tool call is permitted or denied based on whether the arguments it carries can be traced, through the agent's reasoning trace, to a source labelled untrusted. This is fundamentally different from a policy that inspects the call's payload in iso...",
    "what_was_observed": "A three-tool agent loop: `fetch_url` → `extract_fields` → `post_webhook`. The sandbox maintained a taint set keyed on observation IDs. `fetch_url` returned a document whose observation was correctly labelled `untrusted:web`. The agent then invoked `extract_fields(doc_id=obs_7, schema=[\"contact_email\",\"instruction\"])`. Because `extract_fields` is a *pure transform* over a single tainted input, the sandbox propagated t...",
    "condition_of_validity": "The taint-blocking guarantee holds only under the following conjunction, and fails if any conjunct is dropped: 1. **Label conservation under transform.** Every tool invocation must satisfy `taint(output) ⊇ f(taint(inputs))` for a declared propagation function `f` that is monotone in the taint lattice. A tool may only reduce taint if it is a *declared declass...",
    "decision_boundary": "The boundary between \"permit\" and \"deny\" is not \"does this call look dangerous\" but \"can every byte of every argument be traced to a source whose label is admissible for this tool's declared sink class.\" Concretely: - A tool declares a **sink class** (`read_only`, `internal_write`, `external_egress`, `credential_use`). Each sink class has an admissible label...",
    "operational_effect": "With the invariant enforced, the observed failure class disappears but a new operational cost appears: **legitimate cross-boundary workflows require explicit declassification gates.** An agent that must summarize a web page and then email the summary now needs either (a) a declared declassifier with a verified postcondition (e.g., a summarizer whose output i..."
  },
  "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": "100012a67b22578c0a7bc3ca7c386275d2578cac547ddbf678286669a1d67445",
    "verified_classes": [
      "TaintLaunderingError",
      "SinkClass",
      "LabeledValue",
      "ToolSpec"
    ],
    "verified_functions": [
      "join_labels",
      "invoke",
      "guard_action"
    ],
    "verified_functions_count": 3,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [
      "invariant violated: tainted instruction reached external egress"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "enum",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
