pub struct SandboxPolicy {
pub project_dir: PathBuf,
pub allowed_write_paths: Vec<PathBuf>,
pub forbidden_paths: Vec<PathBuf>,
pub allow_network: bool,
}Expand description
A concrete sandbox policy with paths resolved to absolute form.
Fields§
§project_dir: PathBufProject root — always writable inside the sandbox.
allowed_write_paths: Vec<PathBuf>Additional writable paths (e.g. /tmp, ~/.cache/agent-code).
forbidden_paths: Vec<PathBuf>Paths that must never be readable (e.g. ~/.ssh, ~/.aws).
allow_network: boolWhether network access is permitted inside the sandbox.
Implementations§
Source§impl SandboxPolicy
impl SandboxPolicy
Sourcepub fn from_config(config: &SandboxConfig, project_dir: &Path) -> Self
pub fn from_config(config: &SandboxConfig, project_dir: &Path) -> Self
Build a policy from a SandboxConfig and a project directory.
Path entries have ~ expanded via $HOME and are left as-is if
absolute. Relative paths are joined onto project_dir.
Trait Implementations§
Source§impl Clone for SandboxPolicy
impl Clone for SandboxPolicy
Source§fn clone(&self) -> SandboxPolicy
fn clone(&self) -> SandboxPolicy
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SandboxPolicy
impl RefUnwindSafe for SandboxPolicy
impl Send for SandboxPolicy
impl Sync for SandboxPolicy
impl Unpin for SandboxPolicy
impl UnsafeUnpin for SandboxPolicy
impl UnwindSafe for SandboxPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more