{
  "schema_version": "1.3.0",
  "slug": "why-does-an-instance-lose-syscall-confinement-when-a-tool-call-re-enters-the-sandbox-via-a-cached-interpreter",
  "title": "Why does an instance lose syscall confinement when a tool call re-enters the sandbox via a cached interpreter",
  "date_of_record": "2026 December 2",
  "scope": "Applies to LLM agent runtimes that confine tool-invoked code execution at the syscall layer (seccomp-bpf, seccomp user notification, or ptrace-mediated filters) while reusing a warm interpreter process across successive tool calls. Does not apply to per-call process-fork sandboxes that tear down the interpreter after each invocation, nor to pure WASM/VM isolation where the filter is re-instantiated per module.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-syscall-confinement-when-a-tool-call-re-enters-the-sandbox-via-a-cached-interpreter.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-syscall-confinement-when-a-tool-call-re-enters-the-sandbox-via-a-cached-interpreter.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/why-does-an-instance-lose-syscall-confinement-when-a-tool-call-re-enters-the-sandbox-via-a-cached-interpreter.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 2235,
    "python_slice_tokens": 481,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two different things an agent operator means by \"the sandbox is still active\": 1. **Filter liveness** — the seccomp filter program is still installed on the thread that will execute the next tool call's code. 2. **Confinement continuity** — the *set of syscalls permitted to the code now running* is the same set that was permitted to the code that r...",
    "what_was_observed": "A Python tool-execution agent ran a sequence of calls in a single warm CPython 3.11 subprocess. Call 1 was a benign data-transform that imported `numpy`, which loaded a native extension via `dlopen`, which in turn `mmap`'d an executable segment and called `mprotect(PROT_READ|PROT_WRITE|PROT_EXEC)` on a JIT buffer. The seccomp profile for call 1 permitted `mmap`, `mprotect`, `openat`, `read`, `write`, `close`, `exit_g...",
    "condition_of_validity": "The invariant that actually holds is narrower than \"the sandbox is active\": > A syscall filter bounds the *syscalls a thread may issue*, not the *capabilities the thread already holds*. Confinement continuity across a reused interpreter requires that the capability set (open fds, writable-executable mappings, `dlopen`'d code, `memfd`s, `io_uring` rings, `use...",
    "decision_boundary": "The agent runtime must decide, per tool call, between two regimes: - **Warm reuse is admissible** only if the tool call's declared capability set is a *superset* of everything the interpreter has already acquired — i.e., the call is *at least as privileged* as the accumulated state. In practice this means warm reuse is safe only for a monotone-decreasing pri...",
    "operational_effect": "Concretely, the runtime must do three things the naive implementation skips: 1. **Enumerate capabilities before every policy transition.** Read `/proc/self/fd`, `/proc/self/maps`, and `/proc/self/status` (`Seccomp`, `NoNewPrivs`). Any `r-xp` mapping, any fd to a `memfd`/`/proc/self/mem`/`/dev/mem`, any `io_uring` fd, any `userfaultfd`, any `AF_PACKET` socket..."
  },
  "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": "7e04db8a0749b97dcf291a67c9a06b5a4fa8a755ce6f526453321532c03f4715",
    "verified_classes": [
      "ConfinementContinuityError"
    ],
    "verified_functions": [
      "enumerate_held_capabilities",
      "assert_confinement_continuity",
      "dispatch_tool_call",
      "cold_fork_execute",
      "warm_execute"
    ],
    "verified_functions_count": 5,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ConfinementContinuityError",
      "NotImplementedError"
    ],
    "sample_fail_closed_invariants": [
      "cold-fork path elided; installs seccomp before execve",
      "warm path elided; adds stricter filter to existing process"
    ],
    "stdlib_dependencies": [
      "os",
      "pathlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
