deepagents-microsandbox

February 4, 2026 ยท View on GitHub

Microsandbox backend for the DeepAgents framework. This package enables DeepAgents to launch and control isolated sandbox environments using Microsandbox.

Key Features

  • Sandbox Provider: Manages the lifecycle of microsandbox instances (create, list, delete).
  • Sandbox Backend: Provides a standard interface for file operations and command execution within a sandbox.
  • DeepAgents Integration: Fully compatible with the DeepAgents SandboxProvider and SandboxBackend interfaces.

Installation

pip install deepagents-microsandbox

Usage

from deepagents_microsandbox import MicrosandboxProvider

# Initialize the provider connecting to a microsandbox server
provider = MicrosandboxProvider(server_url="http://localhost:5555")

# Create or get a sandbox
sandbox = provider.get_or_create(sandbox_id=None)

# Execute a command
result = sandbox.execute("echo 'Hello World'")
print(result.stdout)

# Clean up
provider.delete(sandbox_id=sandbox.id)

Development

This project uses uv for dependency management.

Prerequisites

  • uv installed.
  • Python 3.11 or higher.

Setup

Install dependencies:

uv sync

Testing

Tests are split into unit tests (mocked) and integration tests (requiring a real server).

Run Unit Tests (Mocked) These tests mock the HTTP interactions and do not require a running server.

uv run pytest

Run Integration Tests These tests verify behavior against a real microsandbox server.

  1. Start a microsandbox server in dev mode:
    msb server start --dev
    
  2. Run the tests with the environment variable:
    MICROSANDBOX_DEV_SERVER=http://127.0.0.1:5555 uv run pytest