SuperAPI AI Directory

sandbox-runtime

Anthropic Sandbox Runtime (srt) is a lightweight sandboxing tool that enforces filesystem and network restrictions at the operating system level for arbitrary processes, without requiring containers. It uses native OS sandboxing primitives (sandbox-exec on macOS, bubblewrap on Linux) and proxy-based network filtering, and can be used to sandbox the behavior of AI agents, local MCP servers, bash commands, and arbitrary processes. The tool is currently a research preview and is available both as a CLI and as a library, following a secure-by-default philosophy: processes start with minimal privileges and required permissions must be explicitly granted. Key capabilities include network restrictions (controlling accessible hosts/domains), filesystem restrictions (controlling readable and writable files/directories), Unix socket restrictions, and violation monitoring (real-time access to sandbox violation logs on macOS).

Open website

About this tool

Anthropic Sandbox Runtime (abbreviated as srt) is a lightweight sandboxing tool designed to enforce filesystem and network restrictions at the operating system level for arbitrary processes without relying on containers. It was developed by Anthropic and released as a research preview for Claude Code, intended for building safer AI agent systems. The tool is provided as an early open-source preview, and its API and configuration format may evolve.

Main uses and capabilities:

  • Network restrictions: Control accessible hosts/domains through an HTTP/HTTPS proxy and a SOCKS5 proxy; all network access is denied by default, and domains must be explicitly allowed.
  • Filesystem restrictions: Control read and write permissions for files and directories. Reads use a "deny first, then allow" model, while writes use an "allow only" model, with all writes denied by default.
  • Unix socket restrictions: Control access to local IPC sockets.
  • Violation monitoring: On macOS, it can connect to the system sandbox violation log store to enable real-time alerts.
  • Cross-platform support: macOS uses sandbox-exec and a dynamically generated Seatbelt profile; Linux uses bubblewrap for containerization and network namespace isolation; Windows uses a dedicated local user account, Windows Filtering Platform outbound filtering, a write-restricted token, and explicit ACEs on the working tree.

Usage: srt can be used as a CLI tool and as a library. The srt CLI command can wrap arbitrary commands and impose security boundaries. The configuration file is located at ~/.srt-settings.json; if it does not exist, built-in defaults are used (no network access, no writes outside the default write paths, unrestricted reads). If the configuration file exists but is empty, cannot be read, or fails validation, srt exits with an error rather than falling back to the defaults. It also supports reading configuration updates from a file descriptor via --control-fd, with one JSON object per line, where each full line replaces the entire configuration.

Typical scenarios:

  • Sandboxing MCP servers to limit their capabilities. For example, configure a sandboxed filesystem MCP server in .mcp.json and set restrictions in ~/.srt-settings.json to prevent the server from writing to denied paths.
  • Sandboxing AI agents, bash commands, and arbitrary processes.
  • Running as a standalone proxy (srt proxy), running only HTTP proxy, no sandbox child process, suitable for hosts where workloads run elsewhere.

Limitations and caveats:

  • Currently a research preview; APIs and configuration formats may change.
  • There are known limitations on Windows, for example, the filter does not follow sandbox processes that place a different token on the thread before creating a socket, nor does it follow traffic carried on behalf of system services.
  • The control descriptor must be an integer of 3 or greater and readable; otherwise srt reports an error and exits.
  • On macOS and Linux, commands inside the sandbox cannot obtain the control descriptor; on Windows, commands receive only the three standard streams.
  • Violation attribution keys are compared by their first 100 characters; long commands that share a prefix may cause cross-attribution, so using a per-invocation commandId is recommended.
  • Callback behavior changed in the first version after 0.0.79: previously any truthy answer allowed the connection, but now only true allows it.