Skip to content

Sandbox

SkimpyClaw can run agent tool calls inside a container instead of directly on the host. This isolates agent-executed commands from your system — the agent can install packages, compile code, and run scripts without risk to your machine.

How It Works

When sandbox is enabled, tool calls are routed to a container:

  1. Agent calls a tool (Bash, Read, Write, Glob, or ListDir)
  2. SkimpyClaw translates host paths to container mount paths
  3. Command executes inside the container
  4. Output is translated back to host paths and returned to the agent

The container has network access, mounted project directories, and common CLI tools.

Supported Runtimes

RuntimePlatformNotes
Apple ContainersmacOS 26+Preferred — lightweight, fast startup
DockerAnyFallback — requires Docker Desktop or daemon

Quick Start

bash
# Initialize sandbox (detects runtime, builds image, updates config)
skimpyclaw sandbox init

# Verify
skimpyclaw sandbox doctor

Setup Options

bash
# Use Docker instead of Apple Containers
skimpyclaw sandbox init --runtime docker

# Build with more tools
skimpyclaw sandbox init --profile dev
skimpyclaw sandbox init --profile full

Profiles

ProfileIncludes
minimal (default)bash, curl, git, gh, jq, python3, ripgrep, pnpm, Node.js
devminimal + gcc, g++, make
fulldev + pip3, sqlite3, unzip, less

What sandbox init Does

  1. Detects container runtime (Apple Containers or Docker)
  2. Builds the sandbox image from the bundled Dockerfile
  3. Runs smoke tests (CLI tools, network, hostname)
  4. Updates ~/.skimpyclaw/config.json with sandbox configuration

Configuration

After sandbox init, your config will include:

json
"sandbox": {
  "enabled": true,
  "runtime": "container",
  "image": "skimpyclaw-sandbox"
}

Key Fields

FieldDescription
enabledMaster switch — false runs everything on host
runtimecontainer (Apple Containers) or docker
imageImage name used for containers (default: skimpyclaw-sandbox)
cpusCPU limit per container (default: 2)
memoryMemory limit (default: 2G)
networkNetwork mode (default: none)
idleTimeoutMsIdle container timeout in ms (default: 3600000 / 1h)
envExtra env vars injected into containers

Path Translation

The agent sees host paths (e.g. /Users/you/Projects/app). SkimpyClaw transparently translates these to container paths before execution, and reverses the translation in output.

Mounts are computed automatically from the configured allowedPaths in your tool config — there is no manual mounts field to configure. Only allowed paths are accessible inside the container.

Exec Approval + Sandbox

Sandbox and exec approval work together:

  • Unattended contexts (cron, heartbeat): Commands run in sandbox without approval
  • Attended contexts (Discord, Telegram): High-risk commands (tier 2-3) still require human approval before sandbox execution
  • Approval happens before the command reaches the container

Management Commands

bash
skimpyclaw sandbox status       # List active sandbox containers
skimpyclaw sandbox prune        # Remove orphaned containers
skimpyclaw sandbox doctor       # Run targeted sandbox diagnostics

What Runs in Sandbox (and What Doesn't)

ComponentSandboxed?Notes
Bash tool✅ YesAll Bash commands route through the container
Read / Write tool✅ YesFile reads and writes execute inside the container
ListDir / Glob tool✅ YesDirectory listings and glob operations execute inside the container
Browser tool❌ NoPlaywright runs on host via MCP
code_with_agent / code_with_team❌ NoCoding agents spawn CLI processes on host (plumbing exists but is not wired up)
Cron script payloads✅ YesScripts route through sandbox when enabled

macOS-specific commands (osascript, open, say, pbcopy, pbpaste, defaults, etc.) bypass the sandbox and execute on the host, since they require macOS APIs unavailable in Linux containers.

Coding Agents

Coding agents (claude, codex, kimi) are not sandboxed. They spawn CLI processes directly on the host. The executor has sandbox plumbing (container wrapping in executor.ts), but sandboxConfig is not passed through from the tool dispatch layer. This is a known gap.

Disabling Sandbox

bash
skimpyclaw config set sandbox.enabled false
skimpyclaw restart

Or edit ~/.skimpyclaw/config.json directly and set "sandbox": { "enabled": false }.

Troubleshooting

IssueFix
container: command not foundmacOS 26+ required for Apple Containers
Image build failsCheck skimpyclaw sandbox doctor for specific errors
Mount permission deniedEnsure host paths exist and are readable
Slow startupApple Containers is faster than Docker; consider switching
Network issues in containerCheck skimpyclaw sandbox doctor — verifies DNS + connectivity