Sandboxer
A CLI tool for sandboxing folders into containers using Podman. Perfect for isolating development environments with pre-configured tools like Claude Code, Go, Python, and Bun.
Features
- Mount any local folder into an isolated container environment
- Pre-built container image with development tools ready to go
- Manage multiple sandbox containers (list, stop, attach, remove)
- Uses Podman for rootless container execution
Container Image
The included Dockerfile builds an Ubuntu 24.04-based image with:
| Tool | Description |
|---|---|
| Claude Code | Anthropic's CLI for Claude |
| OpenCode | AI coding assistant |
| uv | Fast Python package manager |
| Bun | Fast JavaScript runtime |
| Go | Go programming language (v1.23.5) |
| Pyright | Python type checker |
| ripgrep, jq, neovim, tmux | Developer utilities |
The image supports both amd64 and arm64 architectures.
Building the Container Image
# Build for current architecture
podman build -t sandboxer .
# Build for a specific architecture
podman build --platform linux/amd64 -t sandboxer:amd64 .
podman build --platform linux/arm64 -t sandboxer:arm64 .
# Build multi-arch image and push to registry
podman build --platform linux/amd64,linux/arm64 -t myregistry/sandboxer:latest --manifest sandboxer .
podman manifest push sandboxer docker://myregistry/sandboxer:latest
Installation
Prerequisites
Install the CLI
# Using uv (recommended)
uv pip install .
# Or using pip
pip install .
# For development
uv pip install -e ".[dev]"
Alternatively, run the install script which sets up Podman, uv, and Claude Code:
./install.sh
Usage
Run a sandbox container
Mount the current directory into an interactive container:
sandboxer run
Mount a specific folder:
sandboxer run /path/to/project
Use a custom container image:
sandboxer run /path/to/project --image myregistry/custom-image:latest
Run in detached mode (background):
sandboxer run /path/to/project --detach
Specify a custom container name:
sandboxer run /path/to/project --name my-sandbox
Run without network access (isolated from the internet):
sandboxer run /path/to/project --no-internet
Run with Claude API access only (blocks all other internet traffic):
sandboxer run /path/to/project --only-claude
Run with Claude API + package manager access (for development):
sandboxer run /path/to/project --only-dev
Network Restriction Modes
| Flag | Description |
|---|---|
--no-internet |
Complete network isolation. No internet access at all. |
--only-claude |
Only allows connections to the Claude API (api.anthropic.com). Useful for AI-assisted coding without external network access. |
--only-dev |
Allows Claude API plus common package registries for development work. |
The --only-dev flag allows access to:
- Claude API: api.anthropic.com
- Python (uv/pip): pypi.org, files.pythonhosted.org
- JavaScript (bun/npm): registry.npmjs.org, npmjs.com
- Go: proxy.golang.org, sum.golang.org, storage.googleapis.com
- Tool updates: github.com, api.github.com, objects.githubusercontent.com, raw.githubusercontent.com, astral.sh, bun.sh
Both --only-claude and --only-dev also disable Claude Code's WebSearch and WebFetch tools automatically.
These flags are mutually exclusive - you can only use one network restriction mode at a time.
List sandbox containers
List all sandboxer-managed containers:
sandboxer list
List only running containers:
sandboxer list --running
Attach to a running container
sandboxer attach <container-name-or-id>
Stop a container
sandboxer stop <container-name-or-id>
Remove a container
sandboxer rm <container-name-or-id>
Check version
sandboxer --version
Example Workflow
# Build the container image (first time only)
podman build -t sandboxer .
# Start a sandbox for your project
sandboxer run ~/projects/my-app --detach --name my-app-sandbox
# List running sandboxes
sandboxer list --running
# Attach to work in the sandbox
sandboxer attach my-app-sandbox
# Inside the container, use Claude Code
claude
# Exit and stop when done
sandboxer stop my-app-sandbox
sandboxer rm my-app-sandbox
How It Works
Sandboxer uses Podman to create containers with your project folder mounted at /home/developer/project. The containers run as a non-root developer user with:
- User namespace mapping (
--userns=keep-id) for proper file permissions - SELinux labeling (
:Z) for volume mounts - Labels for tracking sandboxer-managed containers
Container names are auto-generated based on the folder path: sandboxer-{folder-name}-{hash}.
License
MIT
Metadata
Release files for sandboxer 0.1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| sandboxer-0.1.6.tar.gz | 17.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sandboxer-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.8 kB
Release files / sandboxer-0.1.6.tar.gz
| Download URL | sandboxer-0.1.6.tar.gz |
|---|---|
| Size | 17.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
957aaae3bbcbb74b57b667394603d53dc6209ffd1afbfe487c2c453fbcdc25a8
|
|
BLAKE2b-256 checksum How to use checksums |
ea078c29b0e79d3a1baf8a4f98e1ca0277e021c72585f3a84d9fc93abf5b8d06
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / sandboxer-0.1.6-py3-none-any.whl
| Download URL | sandboxer-0.1.6-py3-none-any.whl |
|---|---|
| Size | 10.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ca1700c83be499b6e36f05db72d0e8c8d8a5fe45acb4255ee2a089f81cc10d4
|
|
BLAKE2b-256 checksum How to use checksums |
9e976d17c4be8d10fc2ec0b97aa0e76272b951b54097409e829c0528c9a31b84
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|