← Back to research
·13 min read·industry

Local AI Agent Sandboxes

A comparison of 6 local sandboxing tools for AI coding agents — yolobox, yolo-cage, shai, litterbox, landrun, and Codex's built-in sandbox. Protect your machine while letting agents run wild.

Key takeaways

  • The local sandbox market splits into two camps: permissive (yolobox) vs restrictive (shai, landrun) — matching the autonomy vs oversight debate in agent design
  • landrun is the most popular tool (2,156 stars) with the lightest approach — kernel-level Landlock LSM, no containers, no root
  • yolo-cage is the most security-focused, with egress proxy secret scanning, branch isolation, and PR merge prevention
  • Built-in agent sandboxes (Codex bubblewrap, Claude Code permissions) may make standalone tools unnecessary — but aren't there yet

FAQ

What's the best local sandbox for AI coding agents?

yolobox for maximum agent productivity with basic safety. shai for security-conscious teams who want fine-grained access control. landrun for Linux users who want kernel-level isolation without containers.

Do I need a local sandbox if my agent has built-in safety?

Built-in safety (Claude Code permissions, Codex sandbox) protects against the agent itself. Local sandboxes protect against everything the agent runs — supply chain attacks, malicious dependencies, unintended shell commands.

How do local sandboxes differ from cloud sandboxes like E2B?

Local sandboxes run on your machine and protect your filesystem. Cloud sandboxes (E2B, Daytona, Sprites) provide remote isolated environments via API. Local is for individual developers; cloud is for production agent infrastructure.

Which sandbox works on macOS?

yolobox (Docker/Podman/Apple Containers), yolo-cage (experimental QEMU), and shai (Docker) work on macOS. litterbox and landrun are Linux-only.

Executive Summary

AI coding agents are most productive when you let them run without permission prompts — but one bad command and your home directory is gone. A new category of local sandboxing tools has emerged to solve this: run your agent in full-auto mode while keeping your machine safe.

This is distinct from cloud sandbox platforms (E2B, Daytona, Sprites) which provide remote isolated environments via API. Local sandboxes run on your machine, wrapping your existing agent CLI in a protective layer.

6 tools compared: yolobox, yolo-cage, shai, litterbox, landrun, and Codex's built-in sandbox.

Key findings:

  • The market splits along a permissive vs restrictive axis — matching the broader autonomy vs oversight debate in AI agent design
  • landrun has the most traction (2,156 stars) with the lightest approach — kernel-level Landlock, no containers
  • yolobox leads the container-based tools (536 stars) with a batteries-included, "just works" philosophy
  • yolo-cage is the most security-focused, with secret scanning, branch isolation, and PR merge prevention
  • shai pioneers "cellular development" — agents get write access to one component, read-only to everything else
  • Built-in agent sandboxes may eventually obsolete standalone tools, but they're not comprehensive enough yet

The Problem

Every major AI coding agent now ships with a "yolo mode":

AgentFull-Auto Flag
Claude Code--dangerously-skip-permissions
Codex--ask-for-approval never
Gemini CLI--yolo
Copilot--yolo

These modes are where agents are most productive — no interruptions, no decision fatigue, no waiting. But they're also where agents are most dangerous. A misinterpreted prompt can rm -rf ~, overwrite your SSH keys, push to main, or exfiltrate secrets through a dependency install.

Local sandboxes exist to decouple agent autonomy from machine safety. Let the agent go wild inside the sandbox. Keep your actual system untouchable.


Comparison Matrix

ToolLanguageStarsIsolationDefault StancemacOSNetwork ControlAgent-Specific
yoloboxGo536Docker/PodmanPermissiveAll-or-nothing✅ (pre-aliases)
yolo-cagePython108Vagrant/K8sRestrictive⚠️ ExperimentalEgress proxy + scanning✅ (Claude focus)
shaiGo39DockerRestrictiveAllowlist per resource set✅ (supports all)
litterboxRust66PodmanModerate❌ Linux onlyLimited❌ General dev
landrunGo2,156Landlock LSMRestrictive❌ Linux onlyTCP bind/connect rules❌ General purpose
Codex built-inbubblewrapConfigurableWorkspace-scoped✅ (Codex only)

Philosophy Spectrum

These tools exist on a spectrum from "let it rip" to "trust nothing":

Permissive ◄──────────────────────────────────────────► Restrictive

yolobox          litterbox     Codex built-in     shai     yolo-cage     landrun
(full sudo,      (single dir,  (workspace scope,  (read-only,  (egress scan, (kernel-level
 network open)    SSH prompts)   approval policy)   allowlist)   branch lock)  filesystem ACLs)

Permissive tools (yolobox) optimize for agent productivity. The agent can do anything inside the container — install packages, modify system files, access the network. Protection comes from filesystem isolation: your home directory isn't mounted.

Restrictive tools (shai, yolo-cage, landrun) optimize for damage limitation. The agent gets only what it needs — specific directories, specific network destinations, specific capabilities. Everything else is denied by default.

Neither approach is wrong. The choice depends on your threat model:

  • Worried about accidental destruction? → Permissive (yolobox)
  • Worried about supply chain attacks? → Restrictive (shai, landrun)
  • Worried about secret exfiltration? → Very restrictive (yolo-cage)

Product Profiles

yolobox

"Let your AI go full send. Your home directory stays home."

The most popular container-based local sandbox. One command (yolobox claude) drops you into a Docker container with your project mounted, all agent CLIs pre-installed and pre-aliased to skip permissions. Full sudo inside the container.

  • Isolation: Docker/Podman/Apple Containers
  • Project mount: Read-write at real path
  • Home directory: Not mounted (protected)
  • Network: Full access by default, no_network flag for air-gapped mode
  • Customization: .yolobox.toml with cached derived images
  • Best for: Developers who want maximum agent productivity with a simple safety net

Full profile →


yolo-cage

"AI coding agents that can't exfiltrate secrets or merge their own PRs."

The most security-focused option. Runs agents inside Vagrant VMs with MicroK8s, with an egress proxy that scans all HTTP traffic for secrets and a dispatcher that enforces branch isolation. Born from the pain of running many agents in parallel on a financial analysis tool.

  • Isolation: Vagrant VM + Kubernetes pods
  • Secret scanning: Egress proxy scans for API keys (sk-ant-, AKIA, ghp_*), SSH keys, credentials
  • Branch isolation: One sandbox per git branch, agents can only push to their assigned branch
  • Blocked actions: gh pr merge, gh repo delete, gh api mutations
  • Pre-push scanning: TruffleHog checks before every push
  • Domain blocklist: pastebin.com, file.io, transfer.sh, etc.
  • Best for: Teams running multiple agents in parallel who need secret protection and branch discipline

Full profile →


shai

"Sandboxing shell for AI coding agents."

Pioneers "cellular software development" — agents get write access to one component at a time, with read-only access to everything else. The most granular access control of any tool here.

  • Isolation: Docker containers
  • Default: Read-only workspace mount as non-root user
  • Write access: Opt-in per subdirectory via -rw flag
  • Resource Sets: Named collections of allowed HTTP destinations, host mounts, ports, env vars
  • Apply rules: Auto-select resource sets based on target paths (e.g., Rust agent gets different network access than deployment agent)
  • Config: .shai/config.yaml committed to repo, shared across team
  • Best for: Security-conscious teams who want per-component, per-context access control

Full profile →


litterbox

"Somewhat isolated development environments."

A Linux-only sandbox built on Podman with a unique feature: Wayland socket forwarding lets you run your entire IDE inside the container alongside your agent. Also has a custom SSH agent with per-key exposure and user confirmation prompts.

  • Isolation: Podman containers (Linux only)
  • Wayland forwarding: Run editors and GUI apps inside the sandbox
  • SSH agent: Custom implementation — prompts user before every signing operation
  • Scope: Single directory mounted, no access to parent directories
  • Honest disclaimers: Explicitly documents limitations (shared kernel, clipboard access, audio recording risk)
  • Best for: Linux developers who want their entire dev environment sandboxed, not just agents

Full profile →


landrun

"Sandbox any Linux process using Landlock. No root. No containers."

The lightest and most popular tool — uses Linux Landlock LSM for kernel-level filesystem and network access controls without any containers. Not agent-specific, but increasingly adopted for agent sandboxing.

  • Isolation: Linux Landlock LSM (kernel-level, no containers)
  • Filesystem: Fine-grained per-path read/write/execute controls
  • Network: TCP bind/connect restrictions
  • Requirements: Linux kernel 5.13+ (no root, no Docker, no configuration files)
  • Overhead: Near-zero — just a kernel policy applied to the process
  • Best for: Linux users who want the lightest possible sandboxing with kernel-level enforcement

Full profile →


Codex Built-in Sandbox

"OS-enforced sandbox that limits what Codex can touch."

OpenAI's Codex CLI ships with a built-in bubblewrap sandbox on Linux that restricts the agent to the current workspace. Not a standalone tool — it's part of the Codex experience.

  • Isolation: bubblewrap (user namespace isolation) on Linux
  • Scope: Current workspace only
  • Approval policy: Configurable — suggest (ask always), auto-edit (auto-approve file edits), full-auto (approve everything)
  • Network: Scoped to workspace
  • Limitation: Codex only, not usable with Claude Code or other agents
  • Note: Claude Code has its own permission system with allowlists/blocklists, but no OS-level sandbox

Isolation Technologies Compared

TechnologyUsed ByContainer RequiredRoot RequiredmacOSKernel SharingEscape Risk
Dockeryolobox, shaiYesNo (daemon does)YesMedium
PodmanlitterboxYesNo (rootless)YesLower
Vagrant/VMyolo-cageYes (VM)No⚠️NoVery Low
Landlock LSMlandrunNoNoYes (same process)Lowest overhead
bubblewrapCodexNoNoYesLow

Docker/Podman share the host kernel — a kernel exploit could escape the container. Docker requires a privileged daemon; Podman runs rootless. Both are widely available and well-understood.

Vagrant VMs (yolo-cage) provide the strongest isolation — separate kernel, no shared attack surface. But heaviest setup (Vagrant + libvirt/QEMU).

Landlock LSM (landrun) is the lightest — kernel-level access controls applied to the process itself. No container overhead. But only controls filesystem and TCP; no memory isolation.

bubblewrap (Codex) uses Linux user namespaces for lightweight process isolation. Lighter than containers, stronger than Landlock for process isolation.


Feature Comparison

Featureyoloboxyolo-cageshailitterboxlandrunCodex
Pre-installed agent CLIs✅ All 5Claude onlyCodex only
Agent auto-aliasesBuilt-in
Secret scanning✅ (egress proxy)
Branch isolation
Per-directory write control
Network allowlisting❌ (all/none)✅ (domain block)✅ (allowlist)Limited✅ (TCP rules)Workspace scope
GUI/IDE support✅ (Wayland)N/A
SSH agent protection✅ (prompts)N/A
Persistent volumes✅ (K8s)N/A
Project-level config✅ (.yolobox.toml)✅ (YAML)✅ (.shai/)
Team-sharable config
Custom image supportN/A
Homebrew installnpm

When to Use What

By Threat Model

ThreatBest ToolWhy
Agent runs rm -rf ~yoloboxHome dir not mounted, simplest setup
Supply chain attack in npm installshaiRead-only workspace + network allowlist
Agent exfiltrates API keys via HTTPyolo-cageEgress proxy scans all HTTP for secrets
Agent pushes to wrong branchyolo-cageBranch isolation, 1 sandbox per branch
Untrusted code needs filesystem limitslandrunKernel-level per-path access controls
Want entire IDE sandboxedlitterboxWayland forwarding for GUI apps

By Platform

PlatformOptions
macOSyolobox (Docker/Podman/Apple Containers), shai (Docker)
LinuxAll 6 tools available
CI/CDlandrun (lightest), Codex built-in

By Team Size

ProfileRecommendation
Solo developer, wants simplicityyolobox — one command, done
Solo developer, security-consciouslandrun (Linux) or shai (macOS)
Team running multiple agentsyolo-cage or shai (sharable configs)
Enterprise with compliance needsyolo-cage (audit trail via branch isolation) + cloud sandbox (E2B)

The Built-in Sandbox Question

Both Codex and Claude Code are investing in built-in safety:

  • Codex ships with bubblewrap sandbox on Linux, configurable approval policies, and workspace scoping
  • Claude Code has a permission system with allowed/blocked tool lists and sandbox restrictions on Bash commands

Will these make standalone tools unnecessary? Not yet, for two reasons:

  1. Agent-specific: Codex sandbox only works with Codex. Claude permissions only work with Claude. If you use multiple agents (most power users do), you need a tool that wraps all of them.

  2. Process-level vs system-level: Built-in sandboxes protect against the agent itself. They don't protect against everything the agent runs — a malicious npm package, a compromised pip dependency, or a supply chain attack in a git submodule. External sandboxes add a second layer.

The likely endgame: built-in agent sandboxes get good enough for most users, and standalone tools survive for power users and security-conscious teams.


Market Context

An HN thread from early March 2026 cataloged over 20 sandbox solutions launched in the past year, calling it "the new wave of AI agent sandboxes." The space is exploding because the problem is real and growing — more developers running agents in full-auto mode means more potential for damage.

The local sandbox category is distinct from cloud sandboxes (E2B, Daytona, Sprites, Modal):

Local SandboxesCloud Sandboxes
Runs onYour machineRemote servers
ProtectsYour filesystemMulti-tenant isolation
Use caseIndividual devProduction agent infra
BillingFree (open source)Usage-based
NetworkingHost networkIsolated network
PersistenceYour diskEphemeral or managed

Most developers will use both: local sandbox for development, cloud sandbox for production.


Bottom Line

ToolStarsPhilosophyBest For
yolobox536Let it rip, protect home dirSimplest full-auto experience
yolo-cage108Prevent secret exfiltrationMulti-agent teams, security-first
shai39Cellular access controlPer-component write isolation
litterbox66Sandbox the whole IDELinux devs wanting GUI isolation
landrun2,156Kernel-level, no containersLightest possible Linux sandboxing
Codex built-inIntegrated approval + bubblewrapCodex users on Linux

The local sandbox space is early, fragmented, and growing fast. These tools exist because AI coding agents are powerful enough to be dangerous but not yet smart enough to be trusted. The winner will be whichever approach — permissive containers, restrictive containers, or kernel-level enforcement — proves to be the right trade-off between developer experience and safety.

Or maybe the agents themselves will get safe enough that none of these tools are needed. But that's not today.