Autobot::Tools::Sandbox
Kernel-enforced sandboxing for command execution Uses bubblewrap or Docker to restrict file access at OS level
Constants
Class methods
Build the sandbox Docker image from a Dockerfile.
Runs a process, capturing stdout/stderr through pipes with a timeout. The read ends are closed once the process settles so reader fibers never block on daemons that inherit and keep the pipe write ends open.
Test override for sandbox detection (set to nil to use real detection)
Execute a shell command in sandbox (for arbitrary commands with pipes/redirects). Returns: {Process::Status, stdout, stderr}
Execute a program with explicit args in sandbox (no shell interpretation). Safer than exec for structured operations like file reads.
Forward explicitly allowed environment variables to Docker container.
Only variables listed in sandbox_env config are forwarded.
Read a file and return its contents as base64-encoded string. Safe for binary files (images, GIFs, documents).
Resolve the Docker image to use, checking for a Dockerfile.sandbox in the given directory. If found and no explicit docker_image is set, builds and caches the image automatically.
Env var names to forward into Docker containers (set from config at startup). Only listed variables are forwarded — empty by default for security.
Env var names to forward into Docker containers (set from config at startup). Only listed variables are forwarded — empty by default for security.