Skip to main content

Container-based sandbox executor for RoomKit — gives AI agents sandboxed command execution via RTK

Project description

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 Docker containers using RTK for token-optimized output (60-90% fewer tokens).

Any AI agent (Anthropic, OpenAI, Ollama, vLLM) connected to RoomKit gets access to:

Tool Description
sandbox_read Read file contents with line ranges
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_bash Execute shell commands

Installation

pip install roomkit-sandbox
# With Docker backend:
pip install roomkit-sandbox[docker]

Quick Start

from roomkit import Agent
from roomkit.providers.anthropic import AnthropicAIProvider, AnthropicConfig
from roomkit_sandbox import ContainerSandboxExecutor

# Create a sandbox executor
sandbox = ContainerSandboxExecutor(
    image="ghcr.io/roomkit-live/sandbox:latest",
    session_id="my-agent-sandbox",
)

# Attach to any RoomKit agent
agent = Agent(
    "code-reviewer",
    provider=AnthropicAIProvider(AnthropicConfig(api_key="sk-...")),
    system_prompt="You are a code reviewer with access to a sandbox.",
    sandbox=sandbox,
)

With an Existing Backend

If you already have a container backend, pass it directly:

sandbox = ContainerSandboxExecutor(
    backend=my_container_backend,  # Docker or Kubernetes
    session_id=f"sandbox:{user_id}",
    setup_commands=["git clone https://github.com/org/repo.git /workspace/repo"],
    workdir="/workspace/repo",
)

Container Image

Build the lightweight sandbox image (~30-50MB):

docker build -t roomkit-sandbox:latest .

Contents: Alpine 3.21 + bash + git + curl + jq + RTK binary. No Node.js, no Python, no heavy runtimes.

Architecture

Agent (any provider) ──tool call──> RoomKit AIChannel
                                        │
                                   SandboxExecutor
                                        │
                              ContainerSandboxExecutor
                                        │
                                   Docker / K8s
                                        │
                              Lightweight container
                                   (Alpine + RTK)
                                        │
                              rtk read / grep / git / bash
                                        │
                              Token-optimized output → Agent

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roomkit_sandbox-0.2.0.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

roomkit_sandbox-0.2.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file roomkit_sandbox-0.2.0.tar.gz.

File metadata

  • Download URL: roomkit_sandbox-0.2.0.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","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}

File hashes

Hashes for roomkit_sandbox-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7e3ddd8798e0072ce72d9e0a8ae1404554a587c357cef7b9bcde4d0ed5131458
MD5 d4d3afc6aadac7efc705c20a531030be
BLAKE2b-256 60e4b065760df3132183282c9b09fc9725c62e29ee77cafd925d58e53451cc09

See more details on using hashes here.

File details

Details for the file roomkit_sandbox-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: roomkit_sandbox-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","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}

File hashes

Hashes for roomkit_sandbox-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 93d0280eac181e6b409b50bdcceb2b70d8cdd48dc354df9879070e52ddb14e86
MD5 2152a86d42bf90ae41d2e27bd065d8ae
BLAKE2b-256 459533e279d242ca2efb781cf1bedf24d214d46010c694e7666b4475e0291c8e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page