Brickie: Durable Sandboxes for Kubernetes and Cloud
Overview
Brickie is an open-source project designed to provide durable, snapshot-capable sandboxes for executing code within a user's own infrastructure. By integrating with the Kubernetes-native agent-sandbox controller and the Hatchet task engine, Brickie allows developers to run isolated, retryable, and stateful sandbox sessions that can be persisted to S3-compatible object storage.
Core Functionality and Architecture
Brickie leverages the agent-sandbox controller to manage warm pools of pods, significantly reducing cold-start latency. Unlike standard sandbox implementations that rely on persistent volumes (PVCs) for state, Brickie implements a custom snapshot and restore mechanism. Every operation that modifies the sandbox workspace triggers an immutable snapshot stored in object storage. This architecture enables several key capabilities:
- Durable Execution: Because Brickie integrates with Hatchet, every sandbox call is treated as a durable task. If a task fails, it can be retried without re-executing successful steps, as the system can resume from the last valid snapshot.
- Forkability: Snapshots are immutable and can be used to fork new sandbox instances or resume existing sessions from a specific point in time.
- Environment Flexibility: The system supports various runtimes, including Kata Containers, gVisor, and AWS Nitro, allowing for different levels of isolation depending on the security requirements of the workload.
- Local Development: The same code path used for production Kubernetes clusters is compatible with Docker, enabling developers to test and debug sandbox logic locally without needing a full cluster.
Security and Compliance
Brickie prioritizes security through several built-in features, making it suitable for environments with strict compliance requirements:
- mTLS Communication: All traffic between the sandbox provider and individual sandboxes is secured via mutual TLS, with automated certificate issuance and rotation.
- FIPS 140-3 Support: The provider is designed to run workloads in FIPS 140-3 mode by default.
- Supply Chain Security: Container images are signed and include Software Bill of Materials (SBOM) attestations to ensure integrity.
- Resource Isolation: Each sandbox is constrained by pre-set resource and network limits to prevent node starvation and ensure predictable performance.
Use Cases for AI Agents
Brickie is specifically designed to address the challenges of running AI agents that require persistent, stateful environments. By using Brickie, developers can maintain the state of an agent's workspace across multiple turns of interaction. As noted by community members, this approach is particularly useful for scenarios where agents need to perform multi-step tasks, manage file systems, or execute code in isolated environments while maintaining observability and reliability.
Getting Started
Brickie is currently in beta. Developers can integrate it into their projects using the @hatchet-dev/sandbox and @hatchet-dev/typescript-sdk packages. The provider supports any S3-compatible object storage, as well as GCS and Azure, for storing metadata and snapshots. Detailed documentation on the architecture, security model, and driver extensions is available in the official GitHub repository.