pub struct AllowListPolicy {
pub allowed_tools: HashSet<String>,
pub allowed_providers: HashSet<String>,
}Expand description
Policy that allows only actions whose tool/provider is in the given sets.
Empty set = no tools or providers allowed for that category. Sleep and WaitSignal are
always allowed. To allow all tools/providers use AllowAllPolicy, or populate the sets explicitly.
Fields§
§allowed_tools: HashSet<String>§allowed_providers: HashSet<String>Implementations§
Source§impl AllowListPolicy
impl AllowListPolicy
pub fn new( allowed_tools: HashSet<String>, allowed_providers: HashSet<String>, ) -> Self
pub fn tools_only(tools: impl IntoIterator<Item = String>) -> Self
pub fn providers_only(providers: impl IntoIterator<Item = String>) -> Self
Trait Implementations§
Source§impl Policy for AllowListPolicy
impl Policy for AllowListPolicy
Whether the action is allowed for this run and context.
Source§fn retry_strategy(&self, err: &dyn Display, _action: &Action) -> RetryDecision
fn retry_strategy(&self, err: &dyn Display, _action: &Action) -> RetryDecision
Whether to retry after an error (and optionally after a delay).
Source§fn retry_strategy_attempt(
&self,
err: &ActionError,
action: &Action,
attempt: u32,
) -> RetryDecision
fn retry_strategy_attempt( &self, err: &ActionError, action: &Action, attempt: u32, ) -> RetryDecision
Retry strategy with attempt count and structured error. Default uses kind: Permanent => Fail,
others may be retried by implementations. Applies only to executor
Err; ActionResult::Failure is not retried. Read moreSource§fn budget(&self) -> BudgetRules
fn budget(&self) -> BudgetRules
Optional budget; default is no limits.
Auto Trait Implementations§
impl Freeze for AllowListPolicy
impl RefUnwindSafe for AllowListPolicy
impl Send for AllowListPolicy
impl Sync for AllowListPolicy
impl Unpin for AllowListPolicy
impl UnsafeUnpin for AllowListPolicy
impl UnwindSafe for AllowListPolicy
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