Tools MCP and External Integration

Tools MCP and External Integration

Tool Execution Sandbox — Stack

Tool execution sandbox › Stack

41 of 65 in this book · 2 min read

Technology landscape as of 2026-10-10. Knowledge cutoff May 2026.

Selection criteria

The whole evaluation is a trade between how strong the boundary is, how long it takes to get one, and how much of a normal runtime survives inside it.

  • Threat model fit. Whether the isolation is intended to contain mistakes or to contain an adversary who is deliberately trying to escape. These justify very different costs, and conflating them is how containers end up protecting nothing.
  • Startup latency. Time to a usable environment, since it lands inside a turn the user is waiting through. Measure a cold start, not a warm one.
  • Kernel sharing. Whether the confined code sits on the same kernel as the host, which determines whether a kernel vulnerability is an escape or an inconvenience.
  • Resource enforcement granularity. Whether processes, memory, disk, file descriptors, and wall-clock can all be capped, and whether a breach kills cleanly with a diagnosable signal.
  • Network control. Whether egress is default-deny with an explicit allowlist that covers internal destinations and the host metadata endpoint, not only public addresses.
  • Runtime compatibility. Which language runtimes, native extensions, and filesystem behaviours work inside. The stricter options break a large fraction of ordinary libraries.
  • State and artefact handling. How files and results leave, and whether a persistent workspace is available for iterative work without weakening per-tenant isolation.
  • Operability. Whether a confined failure can be diagnosed afterwards, since the properties that make a boundary strong also make it opaque.

Options

Option Best for Watch out for
Containers with a hardened profile (dropped capabilities, seccomp, read-only root, user namespaces) Untrusted-but-not-hostile code where startup must stay in the tens of milliseconds Shared kernel; the default configuration of most orchestrators is substantially weaker than this description
User-space kernel sandboxes (gVisor) Hostile code where container ergonomics must be preserved A syscall compatibility surface that some workloads fall outside; measurable overhead on syscall-heavy work
MicroVMs (Firecracker, Cloud Hypervisor, Kata Containers) Multi-tenant execution of genuinely untrusted code Startup in the hundreds of milliseconds; device and filesystem plumbing is yours to build
WebAssembly runtimes with a capability-based system interface (Wasmtime, WasmEdge) Deterministic, fast-starting confinement with capabilities granted explicitly Narrow language and library support; native extensions, threads, and subprocesses are usually unavailable
In-process interpreter sandboxes (isolated JavaScript contexts, in-browser Python runtimes) Simple expression evaluation and data transformation with no filesystem need Escapes are language-level bugs; not a defensible boundary for arbitrary code
Hosted code-execution services Getting a maintained boundary without operating one Data residency and egress policy are the provider's; cold starts and quotas are outside your control
Dedicated short-lived virtual machines or physical isolation The highest-consequence workloads, or regulatory requirements naming the boundary Provisioning time measured in seconds to minutes; only viable for asynchronous work