Sandbox Config • Rust AI Agent SDK

SandboxConfig: Configuration for a sandbox.

SandboxConfig

Defined in the sandbox module.

Rust AI Agent SDK

Configuration for a sandbox.

Fields

NameTypeDescription
sandbox_typeStringSandbox type (docker, subprocess, etc.)
imageOption<String>Docker image to use (if docker type)
working_dirOption<String>Working directory
envHashMap<StringEnvironment variables
limitsResourceLimitsResource limits
auto_cleanupboolWhether to auto-cleanup after execution

Methods

new

rust
fn new() -> Self

Create a new config with defaults.

docker

rust
fn docker(image: impl Into<String>) -> Self

Create a Docker sandbox config.

Parameters:

NameType
imageimpl Into&lt;String&gt;

subprocess

rust
fn subprocess() -> Self

Create a subprocess sandbox config.

working_dir

rust
fn working_dir(mut self, dir: impl Into<String>) -> Self

Set working directory.

Parameters:

NameType
dirimpl Into&lt;String&gt;

env

rust
fn env(mut self, key: impl Into<String>, value: impl Into<String>) -> Self

Add environment variable.

Parameters:

NameType
keyimpl Into&lt;String&gt;
valueimpl Into&lt;String&gt;

limits

rust
fn limits(mut self, limits: ResourceLimits) -> Self

Set resource limits.

Parameters:

NameType
limitsResourceLimits

auto_cleanup

rust
fn auto_cleanup(mut self, cleanup: bool) -> Self

Set auto-cleanup.

Parameters:

NameType
cleanupbool

Source

View on GitHub

praisonai/src/sandbox/mod.rs at line 311


Related Documentation