Skip to main content

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

fn new() -> Self
Create a new config with defaults.

docker

fn docker(image: impl Into<String>) -> Self
Create a Docker sandbox config. Parameters:
NameType
imageimpl Into&lt;String&gt;

subprocess

fn subprocess() -> Self
Create a subprocess sandbox config.

working_dir

fn working_dir(mut self, dir: impl Into<String>) -> Self
Set working directory. Parameters:
NameType
dirimpl Into&lt;String&gt;

env

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

fn limits(mut self, limits: ResourceLimits) -> Self
Set resource limits. Parameters:
NameType
limitsResourceLimits

auto_cleanup

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