pub struct DetectionConfig {
pub sensitivity: Sensitivity,
pub custom_patterns: Vec<String>,
pub blocklist: Vec<String>,
pub allowlist: Vec<String>,
pub audit_capacity: usize,
pub rule_overrides: BuiltInRuleOverrides,
pub threshold_overrides: ThresholdOverrides,
}Expand description
Detector configuration.
PartialEq is derived but Eq is not, because ThresholdTuple carries
an f64 confidence value. See DetectionResult for the same precedent
elsewhere in this module.
Fields§
§sensitivity: SensitivityDetector sensitivity. Balanced is the default and aims to catch
high-confidence injection attempts without flagging ordinary security
administration questions.
custom_patterns: Vec<String>Additional regular expressions supplied by the embedding application. Public findings expose hashes of these patterns, never the raw regex bodies.
blocklist: Vec<String>Normalized phrase deny-list. Entries must be at least three non-whitespace characters long; matches require token boundaries and prompt-control or exfiltration intent context. Public findings expose hashes, not raw entries.
allowlist: Vec<String>Case-insensitive substring allow-list used to suppress overlapping benign findings without suppressing unrelated malicious spans.
audit_capacity: usizeMaximum number of hash-only audit records retained in memory.
rule_overrides: BuiltInRuleOverridesOptional overrides for the built-in rule corpora.
Operators can add regex rules to a built-in family or disable a
built-in rule by stable ID. Defaults to empty. See
BuiltInRuleOverrides for validation rules and public rule-ID
shaping. Large override sets increase regex compilation cost at
detector construction and matching cost during every scan, so keep
local corpora focused.
threshold_overrides: ThresholdOverridesOptional per-sensitivity threshold overrides.
When a variant is Some(...), the override replaces the built-in
(min_threat_level, min_confidence) tuple for that sensitivity.
Defaults to all None, which preserves built-in behavior. Loosening
these thresholds weakens detection and is the operator’s
responsibility.
Trait Implementations§
Source§impl Clone for DetectionConfig
impl Clone for DetectionConfig
Source§fn clone(&self) -> DetectionConfig
fn clone(&self) -> DetectionConfig
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 DetectionConfig
impl Debug for DetectionConfig
Source§impl Default for DetectionConfig
impl Default for DetectionConfig
Source§impl<'de> Deserialize<'de> for DetectionConfig
impl<'de> Deserialize<'de> for DetectionConfig
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>,
Source§impl PartialEq for DetectionConfig
impl PartialEq for DetectionConfig
Source§impl Serialize for DetectionConfig
impl Serialize for DetectionConfig
impl StructuralPartialEq for DetectionConfig
Auto Trait Implementations§
impl Freeze for DetectionConfig
impl RefUnwindSafe for DetectionConfig
impl Send for DetectionConfig
impl Sync for DetectionConfig
impl Unpin for DetectionConfig
impl UnsafeUnpin for DetectionConfig
impl UnwindSafe for DetectionConfig
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> 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