Skip to content
MaibornWolffPublic

About

Run AI coding agents in isolated containers with controlled access to files and the network

Resources

Code of conduct

Contributing

Security policy

Stars

12 stars

Watchers

1 watching

Forks

Latest commit

 

History

93 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sandbox logo: a robot in a purple box

Sandbox

Run coding agents in a container with your tools, your settings, and limits on host and network access. Use Claude Code, Codex, OpenCode, Pi, or any command.

sandbox run claude

Security model · Quickstart · User guides

Security and trade-offs

Sandbox limits what an agent can reach, but it does not make untrusted code safe. Read the security model before sharing host files or credentials with an agent.

  • The agent works on real files. The whole project is writable by default, including hidden files and project secrets. Starting in a subdirectory does not narrow that access.
  • Trust can grant access outside the project. Approved external mounts let a project use shared code or data in a parent or sibling folder. Review the resolved host paths and access modes before approving the project configuration. Read-only access still lets the agent read and copy files.
  • Network limits do not prevent data disclosure. The network allowlist limits destinations, but an allowed service can receive data the agent can read.
  • Host integrations extend access. Attached sessions can read or replace the host clipboard by default. Allowed host commands run with your host permissions.
  • Container isolation has limits. Sessions run as a non-root user, but runtime vulnerabilities or container root can break the controls.

Review the generated settings before the first run. sandbox init allows common development domains and shares selected host paths, including writable ~/.agents. Remove entries you do not need.

Why Sandbox?

  • Customize your tools. Keep personal tools in a user image and project dependencies in a project image.
  • Share project settings. Commit team configuration without replacing personal settings.
  • Keep state between runs. Reuse agent state and dependency caches.
  • Choose your runtime. Use Docker, Podman, or Apple container with the same CLI.

See alternatives if you need a different isolation boundary.

Quickstart

1. Install the prerequisites

2. Install and configure Sandbox

Install with npm, pnpm, or Bun:

npm install -g @maibornwolff/sandbox
# or: pnpm add -g @maibornwolff/sandbox
# or: bun install -g @maibornwolff/sandbox

Use the same package manager for updates. Then initialize your user configuration:

sandbox init

Select the agents and tools you need. Open the user config.toml at the path shown by sandbox init. Before you run an agent:

  • Set up authentication. Sandbox does not forward API keys by default. To forward one, set it in your host environment and add only its name to the existing env list. See agent authentication for API keys, subscription login, and host authentication.
  • Review clipboard access. Set clipboard = "disabled" if the agent does not need the host clipboard. See clipboard settings for project overrides.

3. Check setup and run

sandbox doctor
cd your-project
sandbox run claude

Replace claude with an installed agent or command, such as codex or npm test. The first run can take several minutes to build the tool images. Later runs reuse cached images and compatible containers.

  • Open a container shell: Run sandbox.
  • Get setup help: Run sandbox assist on the host from your project directory.

Features

Customize your environment

Control access

Daily work

Reference and help

  • Configuration reference: paths, merge rules, environment variables, and all configuration fields.
  • Troubleshooting: diagnose startup, login, build, and network failures.
  • Documentation index: user guides.
  • sandbox --help and sandbox <command> --help: commands and options for your installed version.

Contributing

Built by MaibornWolff under the BSD 3-Clause License.

Alternatives

These tools make different trade-offs. Check their current docs before choosing one:

  • Docker Sandboxes: microVM-based agent environments, local or cloud, with network policies and reusable customization kits. The standalone sbx CLI does not require Docker Desktop, and local use is free. A Docker sign-in is required.
  • NVIDIA OpenShell: an agent runtime with filesystem, network, and process policies, credential handling, and a gateway for managing sandboxes.
  • microsandbox: local microVMs with a Docker-like CLI and SDKs for running untrusted workloads from applications.
  • Anthropic Sandbox Runtime: operating-system sandboxing for commands, with filesystem and network controls.
  • yolobox and ClaudeBox: other container-based agent environments.
  • Claude Code devcontainer: a reference development container with a network firewall.
  • clamp: Docker wrapper scripts for Claude Code, OpenCode, and Pi, with workspace mounts and a domain allowlist.
  • Firejail: Linux application sandboxing.

About

Run AI coding agents in isolated containers with controlled access to files and the network

Resources

Code of conduct

Contributing

Security policy

Stars

12 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages