#[non_exhaustive]pub struct SandboxConfig {
pub enabled: bool,
pub isolation: IsolationLevel,
pub filesystem: Option<FilesystemConfig>,
pub network: Option<NetworkConfig>,
pub env: EnvConfig,
pub security: SecurityProfile,
pub resources: Option<ResourceLimits>,
pub process_tracking: ProcessTracking,
pub allowed_commands: Option<Vec<String>>,
pub denied_commands: Vec<String>,
}Expand description
Agent-level sandbox configuration.
Use SandboxConfig::coding_agent for a sensible default suitable for
coding agents: full environment inherited, writes restricted to the working
directory, network off, cgroup tracking enabled.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: boolEnable sandboxing. When false, all other fields are ignored and
processes run with no restrictions.
isolation: IsolationLevelIsolation mechanism to use. When isolation != None and
enabled = true, terminal commands are auto-approved.
filesystem: Option<FilesystemConfig>Filesystem access rules.
network: Option<NetworkConfig>Network access rules.
env: EnvConfigEnvironment variable inheritance.
security: SecurityProfileProcess-level security context (seccomp, capabilities, NNP).
resources: Option<ResourceLimits>cgroup / container resource limits.
process_tracking: ProcessTrackingProcess tracking and associated LLM tools.
allowed_commands: Option<Vec<String>>Command allowlist. None = all commands permitted.
denied_commands: Vec<String>Command blocklist (evaluated after allowed_commands).
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
Sourcepub fn coding_agent() -> Self
pub fn coding_agent() -> Self
Preset for coding agents.
- Full host filesystem readable; writes restricted to working directory
- Network disabled by default
- Full parent environment inherited (
PATH,HOME, dotfiles, etc.) - cgroup v2 tracking on Linux (auto-approved terminal commands)
- Baseline security (NNP +
RuntimeDefaultseccomp) - Process tracking enabled (
list_processes,kill_process,process_statsavailable as LLM tools)
Trait Implementations§
Source§impl Clone for SandboxConfig
impl Clone for SandboxConfig
Source§fn clone(&self) -> SandboxConfig
fn clone(&self) -> SandboxConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more