pub struct EmbeddingGuardConfig {
pub enabled: bool,
pub threshold: f64,
pub min_samples: usize,
pub ema_floor: f32,
}Expand description
Configuration for the embedding anomaly guard, nested under
[security.content_isolation.embedding_guard].
Fields§
§enabled: boolEnable embedding-based anomaly detection (default: false — opt-in).
threshold: f64Cosine distance threshold above which outputs are flagged as anomalous.
min_samples: usizeMinimum clean samples before centroid-based detection activates. Before this count, regex fallback is used instead.
ema_floor: f32EMA alpha floor for centroid updates after stabilization (n >= min_samples).
Once the centroid has accumulated min_samples clean outputs, each new sample
can shift it by at most this fraction. Lower values make the centroid more
resistant to slow drift attacks but slower to adapt to legitimate distribution
changes. Default: 0.01 (1% per sample).
Trait Implementations§
Source§impl Clone for EmbeddingGuardConfig
impl Clone for EmbeddingGuardConfig
Source§fn clone(&self) -> EmbeddingGuardConfig
fn clone(&self) -> EmbeddingGuardConfig
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 EmbeddingGuardConfig
impl Debug for EmbeddingGuardConfig
Source§impl Default for EmbeddingGuardConfig
impl Default for EmbeddingGuardConfig
Source§impl<'de> Deserialize<'de> for EmbeddingGuardConfig
impl<'de> Deserialize<'de> for EmbeddingGuardConfig
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 EmbeddingGuardConfig
impl PartialEq for EmbeddingGuardConfig
Source§impl Serialize for EmbeddingGuardConfig
impl Serialize for EmbeddingGuardConfig
impl StructuralPartialEq for EmbeddingGuardConfig
Auto Trait Implementations§
impl Freeze for EmbeddingGuardConfig
impl RefUnwindSafe for EmbeddingGuardConfig
impl Send for EmbeddingGuardConfig
impl Sync for EmbeddingGuardConfig
impl Unpin for EmbeddingGuardConfig
impl UnsafeUnpin for EmbeddingGuardConfig
impl UnwindSafe for EmbeddingGuardConfig
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