Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
PolicyEngine
Defined in the policy module.
Rust AI Agent SDK
Engine for evaluating policies.
Fields
| Name | Type | Description |
|---|
rules | Vec<PolicyRule> | Rules |
enabled | bool | Whether the engine is enabled |
Methods
new
Create a new engine.
enable
fn enable(&mut self) -> ()
Enable the engine.
disable
fn disable(&mut self) -> ()
Disable the engine.
add_rule
fn add_rule(&mut self, rule: PolicyRule) -> ()
Add a rule.
Parameters:
remove_rule
fn remove_rule(&mut self, name: &str) -> Option<PolicyRule>
Remove a rule by name.
Parameters:
get_rule
fn get_rule(&self, name: &str) -> Option<&PolicyRule>
Get a rule by name.
Parameters:
get_rule_mut
fn get_rule_mut(&mut self, name: &str) -> Option<&mut PolicyRule>
Get mutable rule by name.
Parameters:
list_rules
fn list_rules(&self) -> Vec<&PolicyRule>
List all rules.
check
fn check(&self, content: &str) -> PolicyResult
Check content against all rules.
Parameters:
check_and_redact
fn check_and_redact(&self, content: &str) -> (PolicyResult, String)
Check and redact content.
Parameters:
rule_count
fn rule_count(&self) -> usize
Get rule count.
clear
fn clear(&mut self) -> ()
Clear all rules.
Source
View on GitHub
praisonai/src/policy/mod.rs at line 278