pub struct DenyAllToolPolicy;Expand description
A ToolPolicy that requires approval for every tool call.
Combined with a deny-all approval handler, this denies every tool for the
agent that carries it. Used by multi-agent runtimes as a fallback when a
child should have “no permission” but its parent has no ToolPolicy of
its own to inherit (so there is no notion of which tools are “dangerous”).
Trait Implementations§
Source§impl Clone for DenyAllToolPolicy
impl Clone for DenyAllToolPolicy
Source§fn clone(&self) -> DenyAllToolPolicy
fn clone(&self) -> DenyAllToolPolicy
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 DenyAllToolPolicy
impl Debug for DenyAllToolPolicy
Source§impl Default for DenyAllToolPolicy
impl Default for DenyAllToolPolicy
Source§fn default() -> DenyAllToolPolicy
fn default() -> DenyAllToolPolicy
Returns the “default value” for a type. Read more
Source§impl ToolPolicy for DenyAllToolPolicy
impl ToolPolicy for DenyAllToolPolicy
Source§fn evaluate_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
_args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Option<ApprovalRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate_approval<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
_args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Option<ApprovalRequest>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Called before every tool call. Read more
Source§fn before_call(
&self,
tool_name: &str,
args: &Value,
ctx: &ToolContext,
) -> AgentResult<()>
fn before_call( &self, tool_name: &str, args: &Value, ctx: &ToolContext, ) -> AgentResult<()>
Called immediately before a tool executes, after approval has been
granted (or auto-approved). Read more
Source§fn after_call(
&self,
tool_name: &str,
args: &Value,
result: &[Content],
ctx: &ToolContext,
) -> AgentResult<()>
fn after_call( &self, tool_name: &str, args: &Value, result: &[Content], ctx: &ToolContext, ) -> AgentResult<()>
Called immediately after a tool executes, before the result is
returned to the LLM. Read more
Auto Trait Implementations§
impl Freeze for DenyAllToolPolicy
impl RefUnwindSafe for DenyAllToolPolicy
impl Send for DenyAllToolPolicy
impl Sync for DenyAllToolPolicy
impl Unpin for DenyAllToolPolicy
impl UnsafeUnpin for DenyAllToolPolicy
impl UnwindSafe for DenyAllToolPolicy
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