roomkit-sandbox
Container-based sandbox executor for RoomKit — gives AI agents sandboxed command execution via RTK.
What it does
roomkit-sandbox provides a ready-made SandboxExecutor implementation that runs commands inside lightweight containers or VMs. Any AI agent (Anthropic, OpenAI, Ollama, vLLM) connected to RoomKit gets access to:
| Tool | Description |
|---|---|
sandbox_read |
Read file contents with line ranges |
sandbox_write |
Write content to a file |
sandbox_edit |
Replace a string in a file |
sandbox_ls |
List directory contents |
sandbox_grep |
Search file contents (regex) |
sandbox_find |
Find files by pattern |
sandbox_git |
Run any git command |
sandbox_diff |
Compare two files |
sandbox_delete |
Delete a file or directory |
sandbox_bash |
Execute shell commands |
Installation
# Docker backend (development)
pip install roomkit-sandbox[docker]
# Kubernetes backend (production)
pip install roomkit-sandbox[kubernetes]
# SmolBSD backend (local VM isolation)
pip install roomkit-sandbox
Backends
Three backends for different deployment profiles:
| Docker | Kubernetes | SmolBSD | |
|---|---|---|---|
| Isolation | Container | Pod | VM |
| Boot | ~500ms | ~2-5s | ~0.5s |
| Image | 37MB (Alpine + RTK) | 37MB | 1GB (NetBSD + git, curl, bash) |
| Commands | RTK (token-optimized) | RTK | Native (POSIX) |
| Use case | Dev, CI | Production | Local assistant |
See docs/backends.md for detailed setup instructions.
Quick Start
Docker
from roomkit import Agent
from roomkit_sandbox import ContainerSandboxExecutor
from roomkit_sandbox.docker_backend import DockerSandboxBackend
sandbox = ContainerSandboxExecutor(
backend=DockerSandboxBackend(image="ghcr.io/roomkit-live/sandbox:latest"),
session_id="my-sandbox",
)
agent = Agent("reviewer", provider=..., sandbox=sandbox)
Kubernetes
from roomkit_sandbox import ContainerSandboxExecutor
from roomkit_sandbox.k8s_backend import KubernetesSandboxBackend
sandbox = ContainerSandboxExecutor(
backend=KubernetesSandboxBackend(
image="ghcr.io/roomkit-live/sandbox:latest",
namespace="production",
),
)
SmolBSD
from roomkit_sandbox import ContainerSandboxExecutor, NativeCommandBuilder
from roomkit_sandbox.smolbsd_backend import SmolBSDSandboxBackend
sandbox = ContainerSandboxExecutor(
backend=SmolBSDSandboxBackend(smolbsd_dir="/path/to/smolBSD"),
command_builder=NativeCommandBuilder(),
)
The guest image is built from smolbsd/ (see docs/backends.md).
Command Builders
The CommandBuilder ABC controls how tool calls become shell commands:
RtkCommandBuilder(default) — uses RTK for 60-90% token reductionNativeCommandBuilder— uses standard Unix commands (cat, grep, find, git)- Custom — subclass
CommandBuilderfor your own tools
See docs/commands.md for details and examples.
Container Image
docker pull ghcr.io/roomkit-live/sandbox:latest
Alpine 3.21 + RTK 0.42.4 + git + bash + curl + jq + gh + uv — 37MB (amd64; arm64 uses a Debian Trixie base).
Architecture
Agent (any provider) ──tool call──> RoomKit AIChannel
│
SandboxExecutor
│
ContainerSandboxExecutor
│
┌───────────────────┼───────────────────┐
│ │ │
DockerBackend K8sBackend SmolBSDBackend
│ │ │
Container (37MB) Pod (37MB) VM (1GB)
│ │ │
RtkCommandBuilder RtkCommandBuilder NativeCommandBuilder
│ │ │
Token-optimized Token-optimized Standard output
Documentation
- Backends — Docker, Kubernetes, SmolBSD setup and comparison
- Command Builders — RTK vs Native, creating custom builders
License
MIT
Metadata
Release files for roomkit-sandbox 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| roomkit_sandbox-0.6.0.tar.gz | 80.3 kB | Without provenance | Details for roomkit_sandbox-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| roomkit_sandbox-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for roomkit_sandbox-0.6.0-py3-none-any.whl |
Total release size: 109.0 kB
Release files / roomkit_sandbox-0.6.0.tar.gz
| Download URL | roomkit_sandbox-0.6.0.tar.gz |
|---|---|
| Size | 80.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ec87e41e6eb8acab0e64e987eec7c07de28eb12d2c92fdc37cc647041391978
|
|
BLAKE2b-256 checksum How to use checksums |
49d932ea838ac88fbd260942903a5f6063d448299f079dbb05c903e0a6f4cffa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.9
|
Release files / roomkit_sandbox-0.6.0-py3-none-any.whl
| Download URL | roomkit_sandbox-0.6.0-py3-none-any.whl |
|---|---|
| Size | 28.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
af020aa8e6e29527963f2c56b54fa26da9e28a3787371320712fb6c76b22d27d
|
|
BLAKE2b-256 checksum How to use checksums |
539f079d892615ba5e25860c2b7c6d2227c753caca95c814ace5e9fd3abc6859
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.9
|
Security for roomkit-sandbox 0.6.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.