pub struct ToolGateExecutor { /* private fields */ }Available on crate feature
std only.Expand description
Tool-call gate: allow-list + deny-list, optional audit, optional real http_get.
Denied tools never touch the network. When enable_http_get is true and the
tool name is http_get on the allow-list, a GET is performed (response truncated).
Implementations§
Source§impl ToolGateExecutor
impl ToolGateExecutor
Sourcepub fn new(allowed: impl IntoIterator<Item = String>) -> Self
pub fn new(allowed: impl IntoIterator<Item = String>) -> Self
Creates a new value of this type.
Sourcepub fn deny(self, names: impl IntoIterator<Item = String>) -> Self
pub fn deny(self, names: impl IntoIterator<Item = String>) -> Self
Performs deny for this type.
Sourcepub fn with_audit(self, log: AuditLog) -> Self
pub fn with_audit(self, log: AuditLog) -> Self
Creates or updates a value with audit.
Sourcepub fn audit_max_bytes(self, max_bytes: u64) -> Self
pub fn audit_max_bytes(self, max_bytes: u64) -> Self
Set the maximum audit JSONL file size in bytes for tool events.
Sourcepub fn fail_closed(self, on: bool) -> Self
pub fn fail_closed(self, on: bool) -> Self
Performs fail closed for this type.
Sourcepub fn enable_http_get(self, on: bool) -> Self
pub fn enable_http_get(self, on: bool) -> Self
Enable real HTTP GET for tool name http_get after allow-list pass.
Trait Implementations§
Auto Trait Implementations§
impl Forget for ToolGateExecutor
impl Freeze for ToolGateExecutorwhere
PhantomData<fn() -> AHasher>: Freeze,
*const u8 is !null: Freeze,
PhantomData<(String, ())>: Freeze,
PhantomData<u8>: Freeze,
impl Move for ToolGateExecutor
impl RefUnwindSafe for ToolGateExecutor
impl Send for ToolGateExecutor
impl Sync for ToolGateExecutor
impl Unpin for ToolGateExecutor
impl UnsafeUnpin for ToolGateExecutorwhere
PhantomData<fn() -> AHasher>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<(String, ())>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for ToolGateExecutor
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