policy • Rust AI Agent SDK
Policy Module for PraisonAI Rust SDK.
policy
Rust AI Agent SDK
Policy Module for PraisonAI Rust SDK.
Provides policy engine for controlling agent behavior.
Example
use praisonai::policy::{PolicyEngine, PolicyRule, PolicyAction};
let mut engine = PolicyEngine::new();
engine.add_rule(PolicyRule::new("no-pii")
.pattern(r"\b\d{3}-\d{2}-\d{4}\b")
.action(PolicyAction::Block));Import
use praisonai::policy::*;Classes
PolicyResult
Result of a policy check.
PolicyRuleA policy rule.
PolicyEngineEngine for evaluating policies.
PolicyActionAction to take when a policy is triggered.
Functions
ssn_rule()
Create a rule to block PII (Social Security Numbers).
credit_card_rule()Create a rule to block credit card numbers.
email_rule()Create a rule to block email addresses.
phone_rule()Create a rule to block phone numbers.
profanity_rule()Create a rule to block profanity.