Skip to content

About

Sandboxed execution environment for AI coding agents ... hallucinate responsibly!

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

agent-sandboxes

Sandboxed execution environment for AI coding agents

Works with Claude Code, OpenAI Codex CLI, GitHub Copilot CLI, OpenCode, and the xAI Grok CLI. Provides kernel-level isolation (gVisor), network policy enforcement (Cilium), and filesystem masking. Design intent and operator guidance in PRINCIPLES.md.

When to use this

Use this sandbox when you want an AI agent to run shell commands, edit files, and reach the network on your behalf — and you don't fully trust what it might do. Each session runs in its own gVisor-isolated pod with a default-deny egress policy: the agent can only reach the domains its tier whitelists, can't see your ~/.ssh/, ~/.aws/, or ~/.kube/, and any destructive command it runs is contained to a single pod that you can sandbox stop at any time.

You probably don't need this if you're just chatting with an LLM through its hosted UI, or running the official CLI yourself on a repo you'd let any colleague edit. The sandbox exists for the "agent autonomously executes things" case — code generation, infra work, multi-step tasks — where a mistake or jailbreak could touch real systems.

Before your first session, skim PRINCIPLES.md — it covers what this sandbox defends against, what it doesn't, and your accountability as the operator (credential handling, tier escalation, what's never permitted regardless of configuration).

Quick Start

Linux and macOS — the happy path is below. Windows users: follow the Windows / WSL2 setup guide instead. The full walkthrough, including Tier 2/3 and options, is in Your first session.

Behind a TLS-intercepting proxy (Zscaler, Netskope, etc.)? Run ./bin/sandbox setup-proxy-cert before you install — see Corporate TLS-intercept proxies.

# 1. Put the CLI on PATH and load completions (add to your shell rc to persist).
export PATH="$(pwd)/bin:$PATH"
source bin/completions/sandbox.bash   # or sandbox.zsh

# 2. Install prerequisites (k3s + Cilium + gVisor on Linux; Lima VM on macOS).
sandbox install                       # thin wrapper over ./setup.sh

# 3. Smoke-test the install.
sandbox status

# 4. Launch a Tier 1 session. First run walks you through OAuth in a browser.
sandbox run --agent claude --tier 1

# 5. Launch a Tier 2 session against a git repo.
sandbox run --agent claude --tier 2 --repo ~/repos/my-project

# List sessions, view logs, resume a still-running one.
sandbox list
sandbox logs   ses-20260401-143022-a7b3
sandbox resume ses-20260401-143022-a7b3

Once the CLI is on your PATH, sandbox install / sandbox uninstall are equivalent to running ./setup.sh / ./uninstall.sh directly. sandbox upgrade updates the CLI itself to the latest release (see Updating the CLI); sandbox upgrade --infra rolls the pinned k3s / Cilium / gVisor versions forward (see Upgrading infrastructure).

Tiers

Tier Workspace Requirements
1 emptyDir none
2 hostPath repo(s) --repo (repeatable, each must be a git repo)
3 hostPath repo(s) --repo + at least one of --infra-token / --infra-kubeconfig

Each tier widens the egress allowlist and (for Tier 3) swaps in an infra tooling image. Full per-tier domain lists and the supported-agent allowlists are in Agents & tiers.

Documentation

Full docs live in docs/. Quick links:

Get started — Your first session · Windows / WSL2 · Deploy an MCP dependency

How-to — Profiles & overlays · Persistent domains & block list · Secrets · MCP & service deps · Tier 3 infra credentials · Resuming sessions · Corporate VPN · TLS-intercept proxies · Rebuilding images · Running tests · Uninstalling

Reference — CLI · Agents & tiers · Configuration · Audit logs · Platform requirements

Understand — Security model · Architecture notes · How this compares · PRINCIPLES.md

Stuck? — Troubleshooting

License

Copyright 2026 Samaritan's Purse

The code authored by Samaritan's Purse in this repository is licensed under the Apache License, Version 2.0. See the LICENSE file for the full terms and the NOTICE file for third-party attributions.

About

Sandboxed execution environment for AI coding agents ... hallucinate responsibly!

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages