pub struct BehavioralConfig {
pub alpha: f64,
pub threshold: f64,
pub min_sessions: u32,
pub max_tools_per_agent: usize,
pub max_agents: usize,
pub absolute_ceiling: Option<u64>,
pub max_initial_ema: Option<f64>,
}Expand description
Configuration for behavioral anomaly detection.
Fields§
§alpha: f64EMA smoothing factor in (0.0, 1.0]. Higher values weight recent data more. Default: 0.2
threshold: f64Deviation threshold multiplier. Anomaly flagged when
current_count / baseline_ema >= threshold.
Default: 10.0
min_sessions: u32Minimum sessions before baselines are actionable (cold start protection). No anomalies are flagged until both the agent and the specific tool have at least this many recorded sessions. Default: 3
max_tools_per_agent: usizeMaximum tool entries tracked per agent. Oldest (by last active use) evicted first. Default: 500
max_agents: usizeMaximum agents tracked. Agent with fewest total sessions evicted first. Default: 10_000
absolute_ceiling: Option<u64>Absolute ceiling for tool call count per session (FIND-080). When set, any session with a tool call count exceeding this value triggers a Critical alert regardless of EMA baseline. Prevents gradual ramp evasion where EMA adapts to slow increases. Default: None (no absolute ceiling)
max_initial_ema: Option<f64>Maximum initial EMA value for cold-start protection (FIND-081). When set, the first observation’s EMA is capped at this value, preventing attackers from setting an artificially high baseline by flooding calls during the first session. Default: None (no cap)
Implementations§
Source§impl BehavioralConfig
impl BehavioralConfig
Sourcepub fn validate(&self) -> Result<(), BehavioralError>
pub fn validate(&self) -> Result<(), BehavioralError>
Validate configuration values.
Trait Implementations§
Source§impl Clone for BehavioralConfig
impl Clone for BehavioralConfig
Source§fn clone(&self) -> BehavioralConfig
fn clone(&self) -> BehavioralConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more