pub struct SandboxConfig {
pub allowed_paths: Vec<PathBuf>,
pub sudo_override: bool,
}Expand description
Filesystem sandbox configuration for built-in tools.
Controls which paths a tool is allowed to access. When allowed_paths
is non-empty, only files under those directories are permitted.
An empty allowed_paths means permissive mode (dev default).
Part of the multi-layer sandboxing stack (k3:D12): governance gate -> environment config -> sudo override.
Fields§
§allowed_paths: Vec<PathBuf>Directories the tool is allowed to access. Empty = permissive (all paths allowed).
sudo_override: boolWhether sudo override is active for this execution. When true and path is denied by environment config, access is granted anyway (but logged to chain). Governance denials can never be overridden.
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
Sourcepub fn is_path_allowed(&self, path: &Path) -> bool
pub fn is_path_allowed(&self, path: &Path) -> bool
Check whether a path is allowed by this sandbox config.
Returns true if allowed_paths is empty (permissive mode)
or the path is under at least one allowed directory.
Sourcepub fn check_path_multilayer(&self, path: &Path) -> SandboxDecision
pub fn check_path_multilayer(&self, path: &Path) -> SandboxDecision
Multi-layer sandbox check (k3:D12).
Evaluates the environment layer and optional sudo override.
The governance layer is evaluated separately by the caller
(via GovernanceEngine::evaluate) because it requires the
full GovernanceRequest context.
Evaluation order:
- Environment config (
allowed_paths) – if empty, permit. - If denied and
sudo_overrideis true, permit withSandboxLayer::SudoOverride(caller must log to chain). - Otherwise deny with
SandboxLayer::Environment.
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 moreSource§impl Debug for SandboxConfig
impl Debug for SandboxConfig
Source§impl Default for SandboxConfig
impl Default for SandboxConfig
Source§fn default() -> SandboxConfig
fn default() -> SandboxConfig
Source§impl<'de> Deserialize<'de> for SandboxConfig
impl<'de> Deserialize<'de> for SandboxConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SandboxConfig
impl RefUnwindSafe for SandboxConfig
impl Send for SandboxConfig
impl Sync for SandboxConfig
impl Unpin for SandboxConfig
impl UnsafeUnpin for SandboxConfig
impl UnwindSafe for SandboxConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more