pub struct CompiledRule {
pub id: String,
pub severity: Severity,
pub points: u32,
pub scope: Scope,
pub reason: String,
pub safer_alternative: Option<String>,
pub identity: Option<Requirement>,
/* private fields */
}Fields§
§id: String§severity: Severity§points: u32§scope: Scope§reason: String§safer_alternative: Option<String>§identity: Option<Requirement>Identity gate carried over from the YAML. None for the vast majority of rules; Some for the small set the customer explicitly wires to biometric verification.
Implementations§
Source§impl CompiledRule
impl CompiledRule
pub fn matches_tool_call(&self, tool: &str, params: &Value) -> bool
pub fn matches_text(&self, text: &str) -> bool
Sourcepub fn tool_whitelist(&self) -> Option<&HashSet<String>>
pub fn tool_whitelist(&self) -> Option<&HashSet<String>>
The rule’s tool: whitelist, if any. Used by the scoped-text
evaluator so tool_description / tool_result rules can target
specific tools.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledRule
impl RefUnwindSafe for CompiledRule
impl Send for CompiledRule
impl Sync for CompiledRule
impl Unpin for CompiledRule
impl UnsafeUnpin for CompiledRule
impl UnwindSafe for CompiledRule
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