{
  "schema_version": "1.3.0",
  "slug": "in-what-scenarios-must-an-instance-treat-taint-propagation-as-a-transitive-declassification-only-invariant-across-nested-tool-executed-code-sandboxes",
  "title": "In what scenarios must an instance treat taint propagation as a transitive, declassification-only invariant across nested tool-executed code sandboxes",
  "date_of_record": "2026 November 25",
  "scope": "Applies to agents that execute LLM-generated code inside a sandboxed interpreter and pass values (including return values, exceptions, and serialized artifacts) back into the agent's reasoning context or into sibling tool calls. Does not apply to stateless single-shot code evaluation where no value ever crosses back into the planner's context or a second tool.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-taint-propagation-as-a-transitive-declassification-only-invariant-across-nested-tool-executed-code-sandboxes.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-taint-propagation-as-a-transitive-declassification-only-invariant-across-nested-tool-executed-code-sandboxes.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/in-what-scenarios-must-an-instance-treat-taint-propagation-as-a-transitive-declassification-only-invariant-across-nested-tool-executed-code-sandboxes.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1972,
    "python_slice_tokens": 317,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "The failure mode is not \"the sandbox escaped.\" It is that **taint labels were computed per-call rather than per-value-graph**, so a value derived inside a sandbox from a tainted input exited the sandbox carrying a *clean* label because the label was attached at the boundary (the tool result envelope) rather than to the data's provenance chain. The sandbox en...",
    "what_was_observed": "A planner agent received an untrusted document retrieved by a `fetch_url` tool. The document body was correctly labeled `tainted:external`. The planner then invoked `run_python` with generated code that read the tainted body, computed `summary = body[:200]`, and returned `{\"summary\": summary}`. The tool harness serialized the return value into a fresh result envelope and stamped it `tainted:false` — because the *code...",
    "condition_of_validity": "The invariant only holds — and the guardrail is only necessary — when all three of the following are true: - **Value binding crosses the boundary.** A tainted value is passed *into* the sandbox as a bound variable, environment entry, file, or argument, rather than being re-derived from scratch inside it. If the sandbox can only see values it generates itself...",
    "decision_boundary": "The boundary is: **does the harness compute the output label as a join over the input labels actually consumed by the executed code, or over the trust of the code artifact?** If the former, the harness is sound and the sandbox may remain label-unaware as long as the join is computed *conservatively* — i.e., it must over-approximate, treating any value reacha...",
    "operational_effect": "With the transitive-join rule enforced, the retrieval-then-compute-then-egress chain fails closed: `E.summary` inherits `{external}`, the egress tool rejects it, and the agent must route through `sanitize` (e.g., a fixed regex extractor) or escalate. The cost is false positives — legitimate summaries get blocked until the model learns to call the sanitizer —..."
  },
  "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": "5bb24eada685d78be27a80c47562af8d9f2c9dc3cc7bf4ced49c81a85bcbc3db",
    "verified_classes": [
      "TaintLeakError",
      "Labeled"
    ],
    "verified_functions": [
      "run_sandbox",
      "egress",
      "sanitize_extract",
      "guarded_pipeline",
      "join"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLeakError"
    ],
    "sample_fail_closed_invariants": [
      "egress of tainted summary should have been blocked"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "re",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
