pub struct SandboxPolicy {
pub deny_read: Vec<PathBuf>,
pub deny_write: Vec<PathBuf>,
pub deny_exec: Vec<PathBuf>,
pub allow_paths: Vec<PathBuf>,
pub workspace: PathBuf,
}Expand description
Paths that should be denied to the agent.
Fields§
§deny_read: Vec<PathBuf>Paths the agent cannot read from
deny_write: Vec<PathBuf>Paths the agent cannot write to
deny_exec: Vec<PathBuf>Paths the agent cannot execute from
allow_paths: Vec<PathBuf>Allowed paths (whitelist mode) — if non-empty, only these are allowed
workspace: PathBufWorking directory for the agent
Implementations§
Source§impl SandboxPolicy
impl SandboxPolicy
Sourcepub fn protect_credentials(
credentials_dir: impl Into<PathBuf>,
workspace: impl Into<PathBuf>,
) -> Self
pub fn protect_credentials( credentials_dir: impl Into<PathBuf>, workspace: impl Into<PathBuf>, ) -> Self
Create a policy that protects the credentials directory.
Sourcepub fn strict(workspace: impl Into<PathBuf>, allowed: Vec<PathBuf>) -> Self
pub fn strict(workspace: impl Into<PathBuf>, allowed: Vec<PathBuf>) -> Self
Create a strict policy that only allows access to specific paths.
Sourcepub fn deny_write(self, path: impl Into<PathBuf>) -> Self
pub fn deny_write(self, path: impl Into<PathBuf>) -> Self
Add a path to the deny-write list.
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 moreSource§impl Debug for SandboxPolicy
impl Debug for SandboxPolicy
Auto 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