sagax

Sandbox

sagax is batteries-included and we seek not only to provide an engine for executing tasks, but also the tools for running evaluations. One such tool is sandboxes to provide a secure, isolated virtual computer for agents.

Providers

The sagax sandboxes integration currently supports two providers:

  • E2B
  • Archil

These providers each have their own sans-IO SDKs and ergonomic tokio clients. These are completely native for every provider.

Interface

To prevent lock-in and allow you to swap providers on-demand, sagax sandbox libraries also implement universal interfaces for sandboxes:

trait SandboxProvider {
    async fn create(&self, spec: SandboxSpec) -> Result<Box<dyn Sandbox>>;
}

trait Sandbox {
    async fn start(&mut self) -> Result<()>;
    async fn pause(&mut self) -> Result<()>;
    async fn stop(&mut self) -> Result<()>;
    async fn execute(&mut self, command: CommandSpec) -> Result<CommandOutput>;
    async fn delete(&mut self) -> Result<()>;
}

Each sandbox provider's client provides a method to create an object which implements SandboxProvider. Sandbox providers create Sandbox, which implements all the required methods for driving a sandbox throughout its lifecycle.

On this page