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.1.0.tar.gz (37.6 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.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: roomkit_sandbox-0.1.0.tar.gz
  • Upload date:
  • Size: 37.6 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.1.0.tar.gz
Algorithm Hash digest
SHA256 ec00a2611c9f1dab6189fd6b4035a171bc7d1268f2627fc0251fc72b0b708a67
MD5 ab219675214a77da035f2dfd724389b7
BLAKE2b-256 edab16c03c02f075cfb5bc6d8bac020850b28d397282a24bdface0a8112fa674

See more details on using hashes here.

File details

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

File metadata

  • Download URL: roomkit_sandbox-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d6cef20b1d7ad88c7c7f21c7da9537e2e0241d07dc9e3006c3ff4a7d047397e3
MD5 ee93c4f05d5c8daa55ea7082f45b8eea
BLAKE2b-256 601943dff28632d4ba10310861422b159b02743ae202be6c9f3550ad4e84b5e2

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