pub struct SecurityConfig {
pub bash_risk_threshold: String,
pub sandbox: String,
pub sandbox_network: bool,
pub sandbox_fallback: String,
pub network_allowlist: Vec<String>,
pub network_denylist: Vec<String>,
pub redact_secrets: bool,
}Expand description
Settings for shell safety: risk classification, OS sandbox, and network domain policy for HTTP tools.
The risk classifier inspects the command string a model asked to run. The sandbox (when enabled) confines the process that runs it. They stack; neither replaces the other. See the README security section.
network_allowlist / network_denylist gate webfetch, websearch, and
GitHub API tools by host pattern. Shell network stays binary
(sandbox_network); domain filtering does not apply inside the shell.
Fields§
§bash_risk_threshold: StringLowest risk level that requires confirmation: caution, destructive
or off. Commands classified catastrophic are always refused and
this setting cannot override that.
sandbox: StringOS sandbox for bash / shell: off | workspace (default).
sandbox_network: boolWhen sandbox = "workspace", whether the sandboxed shell may use the
network. Default true so cargo / npm / git keep working.
sandbox_fallback: StringWhen the requested sandbox cannot be applied (no bwrap, non-Linux):
allow (default — warn and run on host) or deny (fail the tool call).
network_allowlist: Vec<String>Host patterns allowed for outbound HTTP tools. Empty (default) means
unrestricted. See NetworkPolicy.
network_denylist: Vec<String>Host patterns always blocked for outbound HTTP tools (wins over allowlist).
redact_secrets: boolReplace credential-looking values (environment variables named like
secrets, known token shapes, URL passwords) with placeholders in every
request sent to a provider, and restore them inside the model’s tool
arguments before execution. Default true.
Implementations§
Source§impl SecurityConfig
impl SecurityConfig
Sourcepub fn network_policy(&self) -> NetworkPolicy
pub fn network_policy(&self) -> NetworkPolicy
Build the HTTP-tool network policy from config lists.
Sourcepub fn sandbox_settings(&self) -> SandboxSettings
pub fn sandbox_settings(&self) -> SandboxSettings
Resolved OS sandbox policy for shell tools.
Trait Implementations§
Source§impl Clone for SecurityConfig
impl Clone for SecurityConfig
Source§impl Debug for SecurityConfig
impl Debug for SecurityConfig
Source§impl Default for SecurityConfig
impl Default for SecurityConfig
Source§impl<'de> Deserialize<'de> for SecurityConfig
impl<'de> Deserialize<'de> for SecurityConfig
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 SecurityConfig
impl RefUnwindSafe for SecurityConfig
impl Send for SecurityConfig
impl Sync for SecurityConfig
impl Unpin for SecurityConfig
impl UnsafeUnpin for SecurityConfig
impl UnwindSafe for SecurityConfig
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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