pub struct SentinelConfig {
pub decay_per_turn: f32,
pub window_turns: u32,
pub elevated_at: f32,
pub high_at: f32,
pub critical_at: f32,
pub alert_threshold: f32,
pub auto_recover_after_turns: u32,
pub subagent_inheritance_factor: f32,
pub high_call_rate_threshold: u32,
pub unusual_read_threshold: u32,
}Expand description
Configuration for TrajectorySentinel, nested under [security.trajectory] in TOML.
Controls signal decay, risk level thresholds, auto-recovery, and subagent inheritance.
§Example (TOML)
[security.trajectory]
decay_per_turn = 0.85
elevated_at = 2.0
high_at = 4.0
critical_at = 8.0
alert_threshold = 4.0
auto_recover_after_turns = 16
subagent_inheritance_factor = 0.5Fields§
§decay_per_turn: f32Multiplicative decay applied to the running score at each advance_turn() call.
Must be in (0.0, 1.0]. Default 0.85 gives a half-life of ≈ 4.3 turns.
window_turns: u32Number of past turns to keep in the signal buffer.
Older signals are evicted once the buffer exceeds this size. Default 8.
elevated_at: f32Score threshold for transitioning from Calm to Elevated. Default 2.0.
high_at: f32Score threshold for transitioning from Elevated to High. Default 4.0.
critical_at: f32Score threshold for transitioning from High to Critical. Default 8.0.
alert_threshold: f32Score at which PolicyGateExecutor is notified via RiskAlert. Default 4.0.
Decoupled from elevated_at to prevent alert noise for routine minor events.
auto_recover_after_turns: u32Consecutive Critical turns before a hard auto-recover reset. Minimum 4. Default 16.
subagent_inheritance_factor: f32Fraction of parent score inherited by a subagent when parent is >= Elevated.
Default 0.5 (≈ one decay half-life). Config validator warns when this deviates
more than 0.1 from decay_per_turn ^ (ln(0.5) / ln(decay_per_turn)).
high_call_rate_threshold: u32Tool-call count per 3-turn window above which HighCallRate fires. Default 12.
unusual_read_threshold: u32Distinct paths read within window_turns above which UnusualReadVolume fires. Default 24.
Implementations§
Trait Implementations§
Source§impl Clone for TrajectorySentinelConfig
impl Clone for TrajectorySentinelConfig
Source§fn clone(&self) -> TrajectorySentinelConfig
fn clone(&self) -> TrajectorySentinelConfig
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 TrajectorySentinelConfig
impl Debug for TrajectorySentinelConfig
Source§impl Default for TrajectorySentinelConfig
impl Default for TrajectorySentinelConfig
Source§fn default() -> TrajectorySentinelConfig
fn default() -> TrajectorySentinelConfig
Source§impl<'de> Deserialize<'de> for TrajectorySentinelConfig
impl<'de> Deserialize<'de> for TrajectorySentinelConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrajectorySentinelConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TrajectorySentinelConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for TrajectorySentinelConfig
impl Serialize for TrajectorySentinelConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TrajectorySentinelConfig
impl RefUnwindSafe for TrajectorySentinelConfig
impl Send for TrajectorySentinelConfig
impl Sync for TrajectorySentinelConfig
impl Unpin for TrajectorySentinelConfig
impl UnsafeUnpin for TrajectorySentinelConfig
impl UnwindSafe for TrajectorySentinelConfig
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,
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request