> ## Documentation Index
> Fetch the complete documentation index at: https://lab.pollack.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Sandbox

> Isolated command execution — Local, Docker, and E2B cloud backends behind a unified API

**[What's New →](/docs/agent-sandbox/whats-new)**

<Info>
  This project has moved from the `spring-ai-community` GitHub organization to
  `markpollack`. New releases are published under the Maven groupId
  `io.github.markpollack`, and Java packages now use the `io.github.markpollack`
  namespace. If you previously used `org.springaicommunity`, update your
  dependency coordinates and imports to the current values shown below.
</Info>

A unified API for isolated command execution across multiple backends. Whether you need local process isolation, Docker container security, or cloud-based E2B microVMs, the same `Sandbox` interface works everywhere. Backends are interchangeable — code written for `LocalSandbox` works identically with `DockerSandbox` or `E2BSandbox`.

## Backends

<CardGroup cols={3}>
  <Card title="LocalSandbox" icon="laptop">
    Local process execution via zt-exec. Fast, no isolation overhead. Good for development and trusted code.
  </Card>

  <Card title="DockerSandbox" icon="docker">
    Container isolation via Testcontainers. Full filesystem and network isolation. Production-ready.
  </Card>

  <Card title="E2BSandbox" icon="cloud">
    Cloud Firecracker microVMs via E2B. Maximum isolation with MCP support and session reconnection.
  </Card>
</CardGroup>

## Core API

```java theme={null}
try (Sandbox sandbox = LocalSandbox.builder()
        .tempDirectory("test-")
        .build()) {

    // Execute commands
    ExecResult result = sandbox.exec(ExecSpec.of("mvn", "test"));

    if (result.success()) {
        System.out.println(result.stdout());
    }

    // File operations
    sandbox.files()
        .create("pom.xml", pomContent)
        .create("src/main/java/App.java", code)
        .and()    // return to Sandbox
        .exec(ExecSpec.of("mvn", "compile"));
}
```

## Module Structure

| Module                 | Backend           | Dependencies        |
| ---------------------- | ----------------- | ------------------- |
| `agent-sandbox-core`   | `LocalSandbox`    | zt-exec             |
| `agent-sandbox-docker` | `DockerSandbox`   | testcontainers      |
| `agent-sandbox-e2b`    | `E2BSandbox`      | jackson, awaitility |
| `agent-sandbox-bom`    | Bill of Materials | —                   |

## Source

<Card title="GitHub" icon="github" href="https://github.com/markpollack/agent-sandbox">
  Source code — Core, Docker, E2B modules and BOM
</Card>

## Used By

* **[Agent Judge](/projects/agent-judge)** — `agent-judge-exec` runs command-based evaluation in sandboxes
* **[Agent Client](/projects/agent-client)** — isolated execution environments for autonomous agents
* **[Agent Bench](/projects/agent-bench)** — benchmark execution with configurable isolation level
