Skip to main content

ToolGate

Trait ToolGate 

Source
pub trait ToolGate: Send + Sync {
    // Required method
    fn check<'life0, 'life1, 'async_trait>(
        &'life0 self,
        call: &'life1 ToolCall,
    ) -> Pin<Box<dyn Future<Output = GateDecision> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

A host’s check on every tool call, made where the registry executes it.

A registry with a gate asks it before each call. Sub-agents get the gate of the registry they are given, or their manager’s, so the same rules hold for every agent the host runs.

Required Methods§

Source

fn check<'life0, 'life1, 'async_trait>( &'life0 self, call: &'life1 ToolCall, ) -> Pin<Box<dyn Future<Output = GateDecision> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Decide about call before it runs.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§