Skip to content

Sandbox

The sandbox is the environment Rover uses to complete your tasks in isolation. Each coding agent gets its own sandbox to ensure that changes made during task execution do not interfere with your local machine or other tasks.

A sandbox includes:

  • A dedicated workspace, which contains a copy of your project files
  • An isolated execution environment, where the coding agent can run commands without affecting your local machine
  • A set or preinstalled tools to help the coding agent complete the task

Currently, sandboxes are implemented using containers. This ensures that each task runs in a consistent environment, regardless of the host machine’s configuration. Over time, we plan to support additional sandboxing methods.

When you create a new task with rover task, Rover sets up a sandbox for it. This involves:

  1. Creating a workspace, which has copy of your project files
  2. Load the user configuration to set up the sandbox environment. This includes MCP servers, environment variables, and any other settings defined in the configuration
  3. Defines an entrypoint file to initialize the sandbox environment. This file includes setup steps like installing dependencies and starting MCP servers
  4. Spinning up a containerized environment using Docker or Podman container runtimes
  5. Running the coding agent inside the sandbox, allowing it to execute commands and make changes in isolation
  6. Monitoring the task’s progress and capturing outputs, logs, and any changes made within the sandbox

The following diagran illustrates the sandbox process:

stateDiagram-v2
      [*] --> LoadConfiguration: Task Created

      LoadConfiguration --> PrepareTaskFiles
      LoadConfiguration --> GenerateEntrypoint

      PrepareTaskFiles --> CreateIsolatedContainer
      GenerateEntrypoint --> CreateIsolatedContainer

      CreateIsolatedContainer --> MountWorkspace

      MountWorkspace --> StartContainer
      StartContainer --> InstallAgentAndDependencies

      InstallAgentAndDependencies --> RunAgent

      RunAgent --> [*]: Task Running

      state "Load Configuration" as LoadConfiguration
      state "Prepare Task Files" as PrepareTaskFiles
      state "Generate Entrypoint" as GenerateEntrypoint
      state "Create Isolated Container" as CreateIsolatedContainer
      state "Mount Workspace" as MountWorkspace
      state "Start Container" as StartContainer
      state "Install Agent and Dependencies" as InstallAgentAndDependencies
      state "Run Agent" as RunAgent
BackendDescriptionInstallation
DockerUses Docker containers to create isolated sandboxes for each task.Get Docker
PodmanUses Podman containers as an alternative to Docker for sandboxing tasks.Get Podman

Ensure you have one of these installed and running on your machine to use Rover.

The sandbox environment is built on a lightweight, security-focused foundation:

  • Base OS: Alpine Linux (on Node.js 24)
  • Node.js: Version 24.x (LTS)
  • npm: Bundled with Node.js
  • Architectures: amd64 (x86_64) and arm64 (aarch64)

Why Alpine Linux? Alpine is a minimal Linux distribution designed for security and efficiency, providing fast container startup times ideal for isolated execution environments.

  • Node.js 24: JavaScript and TypeScript runtime
  • Python 3: Python interpreter with uv package manager

The sandbox includes several Model Context Protocol (MCP) servers and utilities, allowing AI agents to integrate with tools and services:

  • package-manager-mcp: Pre-installed for package management operations (see the section below)
  • mcp-remote: npm package to connect to remote MCP servers when the coding agent does not support it natively

Multiple package managers are available:

Package ManagerPurpose
npmNode.js packages
apkAlpine Linux system packages
uvPython package management
NixCross-platform package manager

The sandbox includes the package-manager-mcp server, which allows coding agents to install additional system tools as needed. For example, to install curl, they can install it via an MCP tool.

The MCP limits the ability to install packages to the distribution package manager, ensuring security and stability within the sandbox. In the current image, this means only apk can be used to install system packages.