pub struct BoxConfig {Show 24 fields
pub image: String,
pub workspace: PathBuf,
pub resources: ResourceConfig,
pub log_level: LogLevel,
pub debug_grpc: bool,
pub tee: TeeConfig,
pub cmd: Vec<String>,
pub entrypoint_override: Option<Vec<String>>,
pub volumes: Vec<String>,
pub extra_env: Vec<(String, String)>,
pub cache: CacheConfig,
pub pool: PoolConfig,
pub port_map: Vec<String>,
pub dns: Vec<String>,
pub network: NetworkMode,
pub tmpfs: Vec<String>,
pub resource_limits: ResourceLimits,
pub cap_add: Vec<String>,
pub cap_drop: Vec<String>,
pub security_opt: Vec<String>,
pub privileged: bool,
pub read_only: bool,
pub sidecar: Option<SidecarConfig>,
pub persistent: bool,
}Expand description
Box configuration
Fields§
§image: StringOCI image reference (e.g., “nginx:alpine”, “ghcr.io/org/app:latest”)
workspace: PathBufWorkspace directory (mounted to /workspace inside the VM)
resources: ResourceConfigResource limits
log_level: LogLevelLog level
debug_grpc: boolEnable gRPC debug logging
tee: TeeConfigTEE (Trusted Execution Environment) configuration
cmd: Vec<String>Command override (replaces OCI CMD when set)
entrypoint_override: Option<Vec<String>>Entrypoint override (replaces OCI ENTRYPOINT when set)
volumes: Vec<String>Extra volume mounts (host_path:guest_path or host_path:guest_path:ro)
extra_env: Vec<(String, String)>Extra environment variables for the entrypoint
cache: CacheConfigCache configuration for cold start optimization
pool: PoolConfigWarm pool configuration for pre-booted VMs
port_map: Vec<String>Port mappings: “host_port:guest_port” (e.g., “8080:80”) Maps host ports to guest ports via TSI (Transparent Socket Impersonation).
dns: Vec<String>Custom DNS servers (e.g., “1.1.1.1”). If empty, reads from host /etc/resolv.conf, falling back to 8.8.8.8.
network: NetworkModeNetwork mode: TSI (default), bridge (passt-based), or none.
tmpfs: Vec<String>tmpfs mounts (ephemeral in-guest filesystems). Format: “/path” or “/path:size=100m”
resource_limits: ResourceLimitsResource limits (PID limits, CPU pinning, ulimits, cgroup controls).
cap_add: Vec<String>Linux capabilities to add (e.g., “NET_ADMIN”, “SYS_PTRACE”)
cap_drop: Vec<String>Linux capabilities to drop (e.g., “ALL”, “NET_RAW”)
security_opt: Vec<String>Security options (e.g., “seccomp=unconfined”, “no-new-privileges”)
privileged: boolRun in privileged mode (disables all security restrictions)
read_only: boolMount the container rootfs as read-only.
Volume mounts (-v host:guest) remain writable by default. Requires guest init to be present in the rootfs image.
sidecar: Option<SidecarConfig>Optional sidecar process to run alongside the main container inside the VM.
The sidecar is launched before the main container entrypoint and runs as a co-process inside the same MicroVM. Intended for security proxies such as SafeClaw that intercept and classify agent traffic.
persistent: boolPreserve the box filesystem across stop/start cycles.
When true, the overlay upper layer (or copy rootfs) is kept on disk after the box stops and reused on the next start. Changes made inside the box persist between restarts, similar to a traditional VM.
When false (default), the writable layer is wiped on every stop, giving a clean slate on each start.