Skip to main content
Callers outside the sandbox (Agent Sandbox SDKs, Agent Substrate, AI agents over MCP, your platform) reach axed over gRPC, REST and MCP. Inside the sandbox, axed holds the native API, the Agent Sandbox adapter, the Agent Substrate adapter and the MCP adapter on top of TCP, vsock, Unix socket and inherited fd transports. Below it the axe engine provides processes, the output log, lifecycle, confined files, the watcher, cgroups v2, budgets and timeouts, on the Linux kernel. The sandbox is isolated by a container, gVisor or Firecracker. Callers outside the sandbox (Agent Sandbox SDKs, Agent Substrate, AI agents over MCP, your platform) reach axed over gRPC, REST and MCP. Inside the sandbox, axed holds the native API, the Agent Sandbox adapter, the Agent Substrate adapter and the MCP adapter on top of TCP, vsock, Unix socket and inherited fd transports. Below it the axe engine provides processes, the output log, lifecycle, confined files, the watcher, cgroups v2, budgets and timeouts, on the Linux kernel. The sandbox is isolated by a container, gVisor or Firecracker.

Callers

Callers live outside the sandbox. They are whatever needs to run commands or move files inside it:
  • The Kubernetes Agent Sandbox SDKs for Go, Python and TypeScript, unchanged.
  • Agent Substrate’s control plane and guest clients.
  • AI agents that call axed’s MCP tools directly.
  • Your own platform: an orchestrator, a CI system, a host agent, or axectl.

The isolation boundary

The sandbox platform draws the boundary: a container, gVisor or a Firecracker microVM. AXE runs inside it and does not provide isolation itself. It assumes the code it runs is hostile and protects itself and the workspace from that code, but it is not what keeps that code away from the host. See Security.

axed, the daemon

axed is a single static binary, usually the sandbox’s first process (PID 1). It has three layers. Transports. axed accepts connections on any number of --listen endpoints at once: TCP for containers and gVisor, vsock for microVMs without guest networking, a Unix socket for a host supervisor or a bind-mounted socket, and an inherited descriptor (fd://N) for socket activation. Every listener serves the same gRPC services and has its own auth policy. axed serves the Agent Sandbox REST API separately, on --rest-port, and MCP on its own --mcp-listen endpoints, which take the same URIs. The native API. axe.v1 has three services: Processes, Files and System. It is self-contained and imports no other project’s types. See the native API reference. Adapters. Adapters translate other projects’ protocols onto the engine:
  • The Kubernetes Agent Sandbox adapter serves sandboxd’s process.v1 and watcher.v1 gRPC services and its REST file API. It is on by default, and --agent-sandbox=false turns it off.
  • The Agent Substrate adapter serves ateenv.v1alpha, the guest API of ate-env-guest. It is off by default, and --agent-substrate turns it on.
  • The MCP adapter serves the Model Context Protocol’s tools to agents, over HTTP at /mcp. It is off by default, and each --mcp-listen endpoint turns it on there. See Agents over MCP.
An adapter maps wire formats and error codes. Behavior lives in the engine, so every API sees the same processes, retention and limits.

The axe engine

crates/axe is a Rust library with no network or protocol code. You can link it into your own agent instead of running axed. See Embed in Rust.

The path of a request

Take axectl run -- make against a daemon listening on TCP:
  1. The client opens an HTTP/2 connection to a listener. axed counts it against that listener’s share of the connection cap, and closes it if the HTTP/2 handshake does not arrive within 10 seconds.
  2. The listener’s interceptor checks the bearer token, if that listener requires one.
  3. The native Processes.Start handler hands the request to the engine’s supervisor.
  4. The supervisor reserves the process’s output retention from the global budget, creates its cgroup if cgroups are on, and spawns it.
  5. Pump tasks read the process’s stdout and stderr into its output log. The reaper thread collects its exit status.
  6. The client disconnects. The process keeps running, and its output keeps landing in the log.
  7. Later, a client calls Attach with the offset after the last byte it saw and gets exactly the rest, or a gap event naming the range that was evicted.
A sandboxd client takes the same path through the Agent Sandbox adapter instead of the native handler.

Key design choices

  • Protocols are adapters over one engine. No external protocol shapes the engine, so adding or removing an adapter does not change behavior.
  • Output is addressed by byte offset. A reconnecting client asks for exactly what it missed. A lossless reader applies backpressure; a lossy reader never slows the process.
  • Suspend is detected from the clocks where they show it. Platforms snapshot without calling into the guest, so AXE watches its clocks. That catches a suspend under gVisor and on VMMs that catch the guest clocks up after a restore. Where the clocks freeze with the guest, as on Firecracker, the platform reports the restore with System.Configure (axectl resumed). System.Freeze quiesces processes before a snapshot on platforms that have a hook for it.
  • One thread owns wait. Nothing else in the process may wait for children, which is also the main rule when you embed the engine.
  • Untrusted code cannot take the daemon down. axed has no reachable panics, every buffer and table is bounded, and axed marks inherited descriptors close-on-exec.
  • No survival across an axed restart. When PID 1 exits, the kernel kills the whole PID namespace. Durability means surviving client disconnects and sandbox snapshots.
Design explains each decision and the alternatives that lost.