PolicyRule
Defined in the policy module.Rust AI Agent SDK A policy rule.
Fields
| Name | Type | Description |
|---|---|---|
name | String | Rule name |
description | Option<String> | Rule description |
pattern | Option<String> | Pattern to match (regex) |
keywords | Vec<String> | Keywords to match |
action | PolicyAction | Action to take |
enabled | bool | Whether the rule is enabled |
priority | i32 | Priority (higher = checked first) |
replacement | Option<String> | Replacement text for redaction |
Methods
new
| Name | Type |
|---|---|
name | impl Into<String> |
description
| Name | Type |
|---|---|
desc | impl Into<String> |
pattern
| Name | Type |
|---|---|
pattern | impl Into<String> |
keyword
| Name | Type |
|---|---|
keyword | impl Into<String> |
action
| Name | Type |
|---|---|
action | PolicyAction |
priority
| Name | Type |
|---|---|
priority | i32 |
replacement
| Name | Type |
|---|---|
replacement | impl Into<String> |
enable
disable
matches
| Name | Type |
|---|---|
content | &str |
apply
| Name | Type |
|---|---|
content | &str |
Source
View on GitHub
praisonai/src/policy/mod.rs at line 118
