{
  "schema_version": "1.3.0",
  "slug": "where-must-an-instance-enforce-taint-provenance-across-a-sandboxed-shell-boundary-before-it-can-safely-re-enter-its-own-tool-loop",
  "title": "Where must an instance enforce taint provenance across a sandboxed shell boundary before it can safely re-enter its own tool loop",
  "date_of_record": "2026 November 23",
  "scope": "Applies to any agent that executes model-generated shell or code inside a sandbox and then feeds stdout/stderr/exit-status back into its own reasoning loop or into downstream tool calls. Does not apply to pure text-generation pipelines with no execution surface, nor to sandboxes whose outputs are consumed only by a human reviewer.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-across-a-sandboxed-shell-boundary-before-it-can-safely-re-enter-its-own-tool-loop.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-across-a-sandboxed-shell-boundary-before-it-can-safely-re-enter-its-own-tool-loop.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/where-must-an-instance-enforce-taint-provenance-across-a-sandboxed-shell-boundary-before-it-can-safely-re-enter-its-own-tool-loop.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1829,
    "python_slice_tokens": 217,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two defensible threat models for a taint-aware sandbox, and they produce opposite architectures: 1. **Result-taint model** — the sandbox's job is to ensure *executed code* cannot reach protected resources. Output is treated as data, and the guardrail sits at the syscall/network/filesystem boundary. Once the process exits, the returned string is \"cl...",
    "what_was_observed": "A recurring trace pattern across agent runs that execute shell: - Step *N*: agent runs `curl -s https://<untrusted>/payload | tee /work/x` inside the sandbox. Process-level isolation holds: no host filesystem, no host network egress beyond the allowlist. The sandbox reports exit 0. - Step *N+1*: agent runs `cat /work/x` and receives the bytes. Because the sandbox boundary was crossed twice and the second read was of ...",
    "condition_of_validity": "The provenance-taint guardrail is *required* (not merely advisable) when all of the following hold: 1. Executed code can read from at least one source the model does not control (network egress, mounted volume, package index, or a file written by an earlier, differently-tainted step). 2. The output of execution is fed back into the model's context or into a ...",
    "decision_boundary": "The decision boundary is *where the label is attached and where it is checked*: - **Attach at the syscall/read boundary, not at the process-exit boundary.** The sandbox must record, per execution, the set of taint sources touched (which URLs fetched, which files opened, which mounts read). This is a property of the *execution*, computed from the trace, not o...",
    "operational_effect": "Concretely, an instance that enforces this invariant behaves differently in four observable ways: 1. **Multi-step commands that fetch-then-read become visibly tainted.** The `curl | tee` then `cat` pattern produces a result whose taint set includes the external host. Downstream tool calls that would embed that string into a privileged action are refused or e..."
  },
  "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": "5cfb22b6f1eb1b2e4287479d492a4b0b13435e2311ca80150b4de44b7d9fa4f1",
    "verified_classes": [
      "TaintLaunderingError",
      "ExecutionTrace",
      "ContextAssembler"
    ],
    "verified_functions": [
      "run_step",
      "ingest"
    ],
    "verified_functions_count": 2,
    "defensive_guards_count": 2,
    "raised_exceptions": [
      "TaintLaunderingError"
    ],
    "sample_fail_closed_invariants": [],
    "stdlib_dependencies": [
      "dataclasses",
      "typing"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
