pub struct SafetyConfig {
pub prompt_injection_policy: PolicyAction,
pub ssrf_policy: PolicyAction,
pub leak_detection_policy: PolicyAction,
pub prompt_sensitivity: f64,
pub leak_sensitivity: f64,
pub allow_private_ips: bool,
pub blocked_cidr_ranges: Vec<String>,
}Expand description
Safety layer configuration
Fields§
§prompt_injection_policy: PolicyActionPolicy for prompt injection detection
ssrf_policy: PolicyActionPolicy for SSRF protection
leak_detection_policy: PolicyActionPolicy for leak detection
prompt_sensitivity: f64Prompt injection sensitivity (0.0-1.0, higher = stricter)
leak_sensitivity: f64Leak detection sensitivity (0.0-1.0, higher = stricter)
allow_private_ips: boolAllow requests to private IP ranges (for trusted environments)
blocked_cidr_ranges: Vec<String>Additional CIDR ranges to block (beyond defaults)
Trait Implementations§
Source§impl Clone for SafetyConfig
impl Clone for SafetyConfig
Source§fn clone(&self) -> SafetyConfig
fn clone(&self) -> SafetyConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 SafetyConfig
impl Debug for SafetyConfig
Source§impl Default for SafetyConfig
impl Default for SafetyConfig
Source§impl<'de> Deserialize<'de> for SafetyConfig
impl<'de> Deserialize<'de> for SafetyConfig
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
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
Mutably borrows from an owned value. Read more