pub struct PolicyConfig {
pub fs: FsPolicy,
pub shell: ShellPolicy,
}Expand description
Combined L1 policy configuration.
A default-constructed PolicyConfig has no restrictions.
Use PolicyConfig::default_restrictive for a safe baseline.
Fields§
§fs: FsPolicy§shell: ShellPolicyImplementations§
Source§impl PolicyConfig
impl PolicyConfig
Sourcepub fn default_restrictive() -> Self
pub fn default_restrictive() -> Self
A baseline restrictive policy that blocks the most dangerous shell
patterns. Filesystem access is unrestricted (the workspace path check
in tools::resolve_within already handles escapes at a lower level).
Security note: substring matching is a best-effort heuristic and cannot prevent all destructive commands. A determined adversary can bypass these patterns with whitespace variations, Unicode, or indirect execution (e.g. `bash -c “$(curl …)”``). The primary security boundary is OS-level sandboxing (Docker / E2B). These patterns exist as a secondary defence-in-depth layer only.
Sourcepub fn check_shell(&self, command: &str) -> Result<()>
pub fn check_shell(&self, command: &str) -> Result<()>
Returns Ok(()) when command is permitted, Err(PermissionDenied)
when it matches a deny pattern.