perspt-policy¶
Starlark-based policy engine for agent action governance.
Core Types¶
pub struct PolicyEngine {
policies: Vec<FrozenModule>,
policy_dir: PathBuf,
}
pub enum PolicyDecision {
Allow,
Prompt(String),
Deny(String),
}
pub struct SanitizeResult {
pub parts: Vec<String>,
pub warnings: Vec<String>,
pub rejected: bool,
pub rejection_reason: Option<String>,
}
Functions¶
Function |
Description |
|---|---|
|
Create engine instance |
|
Load all .star files from policy directory |
|
Parse, validate, and filter a shell command |
|
Ensure command stays within working directory |
|
Whitelist check for auto-approval in balanced mode |