Skip to main content

claude_code_rs/types/
sandbox.rs

1use serde::{Deserialize, Serialize};
2
3/// Sandbox configuration for the CLI process.
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct SandboxSettings {
6    /// Type of sandbox to use.
7    #[serde(default, skip_serializing_if = "Option::is_none")]
8    pub sandbox_type: Option<SandboxType>,
9
10    /// Network access allowed.
11    #[serde(default)]
12    pub allow_network: bool,
13}
14
15#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
16#[serde(rename_all = "lowercase")]
17pub enum SandboxType {
18    None,
19    Docker,
20    Firecracker,
21}
22
23impl Default for SandboxSettings {
24    fn default() -> Self {
25        Self {
26            sandbox_type: None,
27            allow_network: true,
28        }
29    }
30}