pub struct GuardrailConfig {
pub enabled: Option<bool>,
pub level: Option<GuardrailLevel>,
pub profile: Option<GuardrailProfile>,
pub critical_paths: Option<Vec<String>>,
pub after_write: Option<Vec<String>>,
}Expand description
Configurable engineering guardrails for agent-time guidance and checks.
Fields§
§enabled: Option<bool>Master switch. None means “use the default”.
level: Option<GuardrailLevel>Advisory vs blocking behavior.
profile: Option<GuardrailProfile>Built-in profile selection.
critical_paths: Option<Vec<String>>File globs that should trigger guardrail checks after writes.
after_write: Option<Vec<String>>Commands to run after writes. None means use profile defaults.
Implementations§
Source§impl GuardrailConfig
impl GuardrailConfig
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns whether guardrails are enabled.
Sourcepub fn effective_level(&self) -> GuardrailLevel
pub fn effective_level(&self) -> GuardrailLevel
Returns the effective configured level.
Sourcepub fn configured_profile(&self) -> GuardrailProfile
pub fn configured_profile(&self) -> GuardrailProfile
Returns the configured profile before auto-detection.
Sourcepub fn resolve_effective_profile(&self, cwd: &Path) -> GuardrailProfile
pub fn resolve_effective_profile(&self, cwd: &Path) -> GuardrailProfile
Resolve the effective profile for a path.
Sourcepub fn should_check_path(&self, path: &Path) -> bool
pub fn should_check_path(&self, path: &Path) -> bool
Check whether a file path should trigger guardrail after-write checks.
Sourcepub fn merge(&mut self, other: GuardrailConfig)
pub fn merge(&mut self, other: GuardrailConfig)
Merge another guardrail config into this one.
Trait Implementations§
Source§impl Clone for GuardrailConfig
impl Clone for GuardrailConfig
Source§fn clone(&self) -> GuardrailConfig
fn clone(&self) -> GuardrailConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GuardrailConfig
impl Debug for GuardrailConfig
Source§impl Default for GuardrailConfig
impl Default for GuardrailConfig
Source§fn default() -> GuardrailConfig
fn default() -> GuardrailConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GuardrailConfig
impl<'de> Deserialize<'de> for GuardrailConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for GuardrailConfig
impl PartialEq for GuardrailConfig
Source§fn eq(&self, other: &GuardrailConfig) -> bool
fn eq(&self, other: &GuardrailConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for GuardrailConfig
impl Serialize for GuardrailConfig
impl Eq for GuardrailConfig
impl StructuralPartialEq for GuardrailConfig
Auto Trait Implementations§
impl Freeze for GuardrailConfig
impl RefUnwindSafe for GuardrailConfig
impl Send for GuardrailConfig
impl Sync for GuardrailConfig
impl Unpin for GuardrailConfig
impl UnsafeUnpin for GuardrailConfig
impl UnwindSafe for GuardrailConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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