Skip to main content

Guard

Trait Guard 

Source
pub trait Guard: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn evaluate(
        &self,
        ctx: &GuardContext<'_>,
    ) -> Result<GuardDecision, KernelError>;
}

Required Methods§

Source

fn name(&self) -> &str

Human-readable guard name (e.g., “forbidden-path”).

Source

fn evaluate(&self, ctx: &GuardContext<'_>) -> Result<GuardDecision, KernelError>

Evaluate the guard against a tool call request.

Returns an allow or deny decision with optional evidence, or Err on internal failure (which the kernel treats as deny).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§