BlueRock Sandbox

The BlueRock Sandbox uses containerd to operate as a policy-driven container runtime. It shares foundational features with standard Docker environments, including process isolation, namespaces, and volume mounting. The architecture prioritizes execution control and integrated telemetry rather than general application deployment. The runtime enforces security policies that explicitly permit or deny specific binaries to ensure that compromised AI agents execute only authorized tools. Running containerized workloads requires using the brace command to import OCI-compliant images from the local Docker daemon into the isolated runtime registry.

Package

The BlueRock Sandbox utility comes pre-installed on the BlueRock Linux distribution, cloud images for AWS and GCP. The BlueRock Sandbox binary is present at /opt/bluerock/bin/brace with a symlink at /usr/bin/brace.

CLI Command Reference

The brace command is the primary interface for launching application in isolated environments.

Usage: brace [OPTIONS] [-- <TARGET>...]

Primary Options

Option

Description

--name <NAME>

Assigns a unique name to the BlueRock Sandbox instance.

--image <IMAGE>

Launches an OCI image.

--list-network-configs

Displays all available firewall configurations.

-v, --volume <H:C>

Bind-mounts host directories. Use :ro for read-only access.

-e, --env <VAR=VAL>

Passes environment variables into the BlueRock Sandbox.

-K, --clear-env

Clears host environment variables for a "clean slate."

-l, --logfile <PATH>

Path to the log file (default: ./sandbox.log).

  • With -l stdout : will print the output to standard output on the terminal

  • Without -l option all brace the operations will be logged at BRace_rCurrent.log in the current working directory

  • With -l <path_to_logfile> the logs to go at a specified location or file.

Container and Image Management

Executing OCI-compliant images within the BlueRock Sandbox requires transferring the images from the local Docker daemon into the isolated runtime registry. The brace command facilitates this transfer process and manages the subsequent container lifecycle. The following procedures outline the specific steps to import images, verify available workloads, and launch containers.

Importing Images from Docker

A Docker image must be imported into the BlueRock Sandbox before it can run. Use the import command with sudo to copy the image from the local Docker daemon to the Sandbox environment:

For example:

Importing Langchain MCP Server V1 from the Docker daemon

Example output:

Listing Available Images

To verify which images have been successfully imported and are ready for execution within the BlueRock Sandbox, use the list command:

Expected Output:

BlueRock Sandbox Use Cases

The BlueRock Sandbox provides a highly secure, isolated execution environment for workloads. The primary use cases and execution methods are detailed below.

Running Shell Commands

To securely explore, test, or execute commands within an isolated environment, run a direct shell command.

notes-sticky

Note:

BlueRock Sandbox provides an isolated execution environment; the system is distinct from standard container run-times.

To test the environment using the host's binaries, mount the standard system directories and run a simple command:

Expected output:

Running a Python Application

To execute applications directly using the host file system, map system directories (/usr, /lib) and the user directory (e.g., /home/ubuntu) to provide the necessary tools and permissions. This execution runs under the current user identity and does not require sudo.

Running Python MCP Server and MCP Client Programs

To execute Python applications directly using the host file system, you must map the required system directories (/usr, /lib, /lib64), BlueRock sensor directories (/opt/bluerock, /run/bluerock), and the user workspace (e.g., /home/ubuntu) to provide the necessary tools and telemetry permissions to the sandbox. This execution runs under the current user identity and does not require sudo.

Setup

1. Install uv :

2. Create Project Directory Create a new project directory for the MCP applications and navigate into it:

3. Install Required Dependencies Create an isolated Python environment using uv, then install the MCP framework, BlueRock sensor, and BlueRock runtime required for generating and exporting telemetry:

4. Add MCP Application Files Create the MCP client and server scripts in the project directory using the sample code provided in the Appendix section. Ensure the following files are present in the mcp-observability directory:

Using Mount Points in Command Line Arguments

Pass the required volume mounts (-v) directly in the execution command. The /home/ubuntu:/home/ubuntu mapping provides access to your newly created project folder, while the system and bluerock mounts ensure the Python binary and security sensors function correctly.

notes-sticky

Note:

Adjust this path based on the active host user. For example, on AL2023, the default path is /home/ec2-user. For a test user, the path could be /home/test.

Terminal 1: Starting the MCP Server

Launch the sandbox with the required bind mounts:

Expected Output:

FastMCP Server starts on http://0.0.0.0:8001

Terminal 2:

Starting the MCP Client Open a separate terminal and launch a second sandbox using identical Operating System (OS) mounts to execute the client script.

Expected output:

Running a Container Application

Running an Imported Image

Once an Open Container Initiative (OCI) image is imported and verified, launch the image using the --image flag alongside standard BlueRock Sandbox execution controls. This execution method provides a fully isolated application layer.

Expected output:

Using Mount Points in Command Line Arguments

Mount local host directories into the container application to share data, configurations, or output logs.

Expected output:

Passing Environment Variables at Runtime

Container applications often require runtime configuration such as API keys, environment toggles, or port definitions. Pass these variables securely at execution using the environment (-e) flag.

Last updated