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§
fn name(&self) -> &str
fn inspect( &self, ctx: &PostInvocationContext<'_>, response: &Value, ) -> PostInvocationVerdict
Provided Methods§
Sourcefn durable_identity(&self) -> Result<Option<PostInvocationHookIdentity>, String>
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.
fn take_evidence(&self) -> Option<GuardEvidence>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".