

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.v1andwatcher.v1gRPC services and its REST file API. It is on by default, and--agent-sandbox=falseturns it off. - The Agent Substrate adapter serves
ateenv.v1alpha, the guest API ofate-env-guest. It is off by default, and--agent-substrateturns 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-listenendpoint turns it on there. See Agents over MCP.
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
Takeaxectl run -- make against a daemon listening on TCP:
- 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.
- The listener’s interceptor checks the bearer token, if that listener requires one.
- The native
Processes.Starthandler hands the request to the engine’s supervisor. - The supervisor reserves the process’s output retention from the global budget, creates its cgroup if cgroups are on, and spawns it.
- Pump tasks read the process’s stdout and stderr into its output log. The reaper thread collects its exit status.
- The client disconnects. The process keeps running, and its output keeps landing in the log.
- Later, a client calls
Attachwith the offset after the last byte it saw and gets exactly the rest, or a gap event naming the range that was evicted.
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.Freezequiesces 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.

