pub struct ToolAllowlist {
pub allowed_tools: Vec<String>,
pub approval_required: Vec<String>,
pub denied_tools: Vec<String>,
}Expand description
A tool allowlist rule
Fields§
§allowed_tools: Vec<String>Allowed tool names (exact match)
approval_required: Vec<String>Tools that require approval before execution
denied_tools: Vec<String>Tools that are explicitly denied
Implementations§
Source§impl ToolAllowlist
impl ToolAllowlist
Sourcepub fn check(&self, tool_name: &str) -> ToolAllowlistResult
pub fn check(&self, tool_name: &str) -> ToolAllowlistResult
Legacy short-circuit check kept for back-compat with existing
callers and tests. Newer code should consult Self::matches +
crate::precedence::resolve_conflicts instead so it picks up
the explanation trace.
Sourcepub fn matches(&self, tool_name: &str) -> Vec<PolicyVerdict>
pub fn matches(&self, tool_name: &str) -> Vec<PolicyVerdict>
Return every matching verdict for tool_name, instead of short-
circuiting on the first hit. Order: denied → approval → allowed.
Empty result means the allowlist saw nothing — the caller is
responsible for the deny-by-default fallback.
Trait Implementations§
Source§impl Clone for ToolAllowlist
impl Clone for ToolAllowlist
Source§fn clone(&self) -> ToolAllowlist
fn clone(&self) -> ToolAllowlist
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ToolAllowlist
impl Debug for ToolAllowlist
Source§impl Default for ToolAllowlist
impl Default for ToolAllowlist
Source§fn default() -> ToolAllowlist
fn default() -> ToolAllowlist
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ToolAllowlist
impl<'de> Deserialize<'de> for ToolAllowlist
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 ToolAllowlist
impl RefUnwindSafe for ToolAllowlist
impl Send for ToolAllowlist
impl Sync for ToolAllowlist
impl Unpin for ToolAllowlist
impl UnsafeUnpin for ToolAllowlist
impl UnwindSafe for ToolAllowlist
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