pub struct FilteredTools { /* private fields */ }Expand description
A config-driven allowlist over another ToolProvider.
AgentDef.tools names the agent’s mounted surface; this wrapper
enforces it at the provider edge: schemas not in the list are hidden
from the request body (prefix minimization — the model never sees
tools the agent may not call), and invoking a hidden name is an
honest ToolError::InvalidCall, never a silent passthrough.
The wrapper is narrow: it only ever removes from the inner surface, so the caller-supplied schema order (the frozen tools array order) is preserved.
Implementations§
Source§impl FilteredTools
impl FilteredTools
Sourcepub fn new(inner: Arc<dyn ToolProvider>, allow: &[String]) -> Self
pub fn new(inner: Arc<dyn ToolProvider>, allow: &[String]) -> Self
Wraps inner so only allow-listed tool names are visible.
Names in allow that the inner provider does not mount are
harmless (they simply never surface); use
unmatched_tool_names for the assembly-time fail-closed check.
Trait Implementations§
Source§impl Clone for FilteredTools
impl Clone for FilteredTools
Source§impl ToolProvider for FilteredTools
impl ToolProvider for FilteredTools
Auto Trait Implementations§
impl !RefUnwindSafe for FilteredTools
impl !UnwindSafe for FilteredTools
impl Forget for FilteredTools
impl Freeze for FilteredToolswhere
*const ArcInner<dyn ToolProvider> is !null: Freeze,
PhantomData<ArcInner<dyn ToolProvider>>: Freeze,
*const LeafNode<String, SetValZST> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, SetValZST)>>: Freeze,
impl Move for FilteredTools
impl Send for FilteredTools
impl Sync for FilteredTools
impl Unpin for FilteredTools
impl UnsafeUnpin for FilteredToolswhere
*const ArcInner<dyn ToolProvider> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn ToolProvider>>: UnsafeUnpin,
*const LeafNode<String, SetValZST> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, SetValZST)>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more