Skip to main content

Crate agent_sandbox

Crate agent_sandbox 

Source
Expand description

agent-sandbox — pluggable execution sandbox for tool calls.

Provides a provider abstraction so the same agent runtime can run under Docker, Kata, or Cube sandboxes. The Docker provider talks to the Docker Engine API through bollard — no docker CLI is required inside the container; they connect to the daemon over the mounted host socket (or whatever DOCKER_HOST points at). Kata is the same Engine API path but runs containers under the kata runtime (HostConfig.runtime). The Cube provider remains a thin CLI runner that shells out to the cube binary. The Sandbox trait is the stable seam the rest of the platform depends on (see docs/adr/0003-sandbox-providers.md).

The deep codex integration (ADR-0005 §Decision) — running tool commands through codex’s real SandboxManager — lives in the aria-agent-cloud runtime crate (publish = false) as codex_sandbox::CodexSandbox. Keeping it out of this published crate avoids dragging codex’s unpublished git dependencies into the crates.io manifest (crates.io requires every dependency to resolve from the registry). SandboxProvider::Codex remains a valid selector so config stays forward-compatible; from_provider returns SandboxError::NotConfigured for it and the cloud runtime injects the real backend via agent_core::Agent::with_sandbox.

Structs§

CubeSandbox
Cube sandbox — shells out to the cube CLI. The exact flags depend on the deployed Cube runtime; adjust run_args per environment.
DockerSandbox
Docker sandbox — the default provider.
ExecOutput
Result of an execution.
ExecSpec
Specification of a command to execute inside a sandbox.
KataSandbox
Kata sandbox — Docker Engine API with the kata runtime.
SandboxHandle
Opaque handle to a spawned sandbox session.
SandboxResourceLimits
Resource limits applied to every sandbox container/VM.

Enums§

SandboxError
SandboxProvider
Which sandbox backend to use.

Traits§

Sandbox
Stable sandbox contract used by agent-core and agent-cloud.

Functions§

build_host_config
Build a bollard HostConfig carrying the resource limits. runtime is only set for Kata ("kata"); None means the default Docker runtime.
default_sandbox
The platform default sandbox: Docker.
from_provider
Build a sandbox from a provider selector (config-driven).