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
| Name | Type | Description |
|---|---|---|
sandbox_type | String | Sandbox type (docker, subprocess, etc.) |
image | Option<String> | Docker image to use (if docker type) |
working_dir | Option<String> | Working directory |
env | HashMap<String | Environment variables |
limits | ResourceLimits | Resource limits |
auto_cleanup | bool | Whether to auto-cleanup after execution |
Methods
new
fn new() -> SelfCreate a new config with defaults.
docker
fn docker(image: impl Into<String>) -> SelfCreate a Docker sandbox config.
Parameters:
| Name | Type |
|---|---|
image | impl Into<String> |
subprocess
fn subprocess() -> SelfCreate a subprocess sandbox config.
working_dir
fn working_dir(mut self, dir: impl Into<String>) -> SelfSet working directory.
Parameters:
| Name | Type |
|---|---|
dir | impl Into<String> |
env
fn env(mut self, key: impl Into<String>, value: impl Into<String>) -> SelfAdd environment variable.
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
value | impl Into<String> |
limits
fn limits(mut self, limits: ResourceLimits) -> SelfSet resource limits.
Parameters:
| Name | Type |
|---|---|
limits | ResourceLimits |
auto_cleanup
fn auto_cleanup(mut self, cleanup: bool) -> SelfSet auto-cleanup.
Parameters:
| Name | Type |
|---|---|
cleanup | bool |
Source
View on GitHubpraisonai/src/sandbox/mod.rs at line 311