pub struct PolicyRuleConfig {
pub effect: PolicyEffect,
pub tool: String,
pub paths: Vec<String>,
pub env: Vec<String>,
pub trust_level: Option<SkillTrustLevel>,
pub args_match: Option<String>,
pub capabilities: Vec<String>,
}Expand description
A single policy rule as read from TOML.
Fields§
§effect: PolicyEffect§tool: StringGlob pattern matching the tool id. Required.
paths: Vec<String>Path globs matched against path-like params. Rule fires if ANY path matches.
env: Vec<String>Env var names that must all be present in PolicyContext.env.
trust_level: Option<SkillTrustLevel>Minimum required trust level (rule fires only when context trust <= threshold).
args_match: Option<String>Regex matched against individual string param values.
capabilities: Vec<String>Named capabilities associated with this rule (e.g., “fs:write”, “net:external”). Config-only field: capability matching is deferred until tools expose capability metadata.
Trait Implementations§
Source§impl Clone for PolicyRuleConfig
impl Clone for PolicyRuleConfig
Source§fn clone(&self) -> PolicyRuleConfig
fn clone(&self) -> PolicyRuleConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolicyRuleConfig
impl Debug for PolicyRuleConfig
Source§impl<'de> Deserialize<'de> for PolicyRuleConfig
impl<'de> Deserialize<'de> for PolicyRuleConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PolicyRuleConfig
impl RefUnwindSafe for PolicyRuleConfig
impl Send for PolicyRuleConfig
impl Sync for PolicyRuleConfig
impl Unpin for PolicyRuleConfig
impl UnsafeUnpin for PolicyRuleConfig
impl UnwindSafe for PolicyRuleConfig
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