Skip to main content

PostInvocationHook

Trait PostInvocationHook 

Source
pub trait PostInvocationHook: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn inspect(
        &self,
        ctx: &PostInvocationContext<'_>,
        response: &Value,
    ) -> PostInvocationVerdict;

    // Provided methods
    fn durable_identity(
        &self,
    ) -> Result<Option<PostInvocationHookIdentity>, String> { ... }
    fn take_evidence(&self) -> Option<GuardEvidence> { ... }
}
Expand description

A hook that inspects tool responses after invocation.

Required Methods§

Source

fn name(&self) -> &str

Source

fn inspect( &self, ctx: &PostInvocationContext<'_>, response: &Value, ) -> PostInvocationVerdict

Provided Methods§

Source

fn durable_identity(&self) -> Result<Option<PostInvocationHookIdentity>, String>

Stable identity for deterministic, non-blocking durable evaluation.

Returning an identity asserts that inspect is a pure function of the request context and response, and that it returns only Allow, Redact, or Escalate. Hooks without this contract remain usable on non-durable paths and are rejected before a durable dispatch starts.

Source

fn take_evidence(&self) -> Option<GuardEvidence>

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§