pub struct SafetyConfig {
pub mode: SafetyMode,
pub checkpoint_on_mutation: bool,
pub network: NetworkPolicy,
pub filesystem: FilesystemPolicy,
pub overrides: Vec<PolicyOverride>,
pub external_writes: FloorLevel,
pub system_installs: FloorLevel,
pub auto_classifier_model: Option<String>,
pub allow_untrusted_headless_tools: bool,
}Fields§
§mode: SafetyMode§checkpoint_on_mutation: bool§network: NetworkPolicyNetwork access policy for shell commands. Deny installs the OS
network kill-switch on Linux. See NetworkPolicy.
filesystem: FilesystemPolicyFilesystem write policy for shell commands. Project confines writes
to the project/temp//dev directories on Linux. See
FilesystemPolicy.
overrides: Vec<PolicyOverride>§external_writes: FloorLevelEnforcement floor for write-shaped MCP tools (no server-advertised
readOnlyHint): allow | auto | ask | deny. Safety mode alone
never authorizes an external side effect — with the default auto,
even full_access routes MCP writes through the intent classifier
(aligned runs silently, off-task escalates). allow restores the old
unconditional-allow behavior.
system_installs: FloorLevelEnforcement floor for machine-scoped package operations (npm -g,
cargo install, pip install, brew/apt/winget installs) —
same levels and default as external_writes. They mutate the
MACHINE, not the project (outside checkpoint reach), so even
full_access vets them. Project-local installs (npm install,
cargo add) are untouched.
auto_classifier_model: Option<String>Model id the Auto-mode safety classifier uses to vet borderline
actions. None ⇒ vet with the session’s active model. Set this to
point the vet at a cheaper/faster model than the one driving the work.
allow_untrusted_headless_tools: boolHeadless escape hatch: when true, non-replayable tools (web/mcp/
subagent/computer_use) are allowed to PROCEED on an Ask decision in a
headless run (no approval UI) instead of being blocked. Default false
— mermaid run in ask mode otherwise refuses these. Set via
--allow-untrusted-tools or config for CI that needs them.
Trait Implementations§
Source§impl Clone for SafetyConfig
impl Clone for SafetyConfig
Source§fn clone(&self) -> SafetyConfig
fn clone(&self) -> SafetyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SafetyConfig
impl Debug for SafetyConfig
Source§impl Default for SafetyConfig
impl Default for SafetyConfig
Source§impl<'de> Deserialize<'de> for SafetyConfigwhere
SafetyConfig: Default,
impl<'de> Deserialize<'de> for SafetyConfigwhere
SafetyConfig: Default,
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 SafetyConfig
impl RefUnwindSafe for SafetyConfig
impl Send for SafetyConfig
impl Sync for SafetyConfig
impl Unpin for SafetyConfig
impl UnsafeUnpin for SafetyConfig
impl UnwindSafe for SafetyConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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