pub trait HookFormat: Send + Sync {
// Required methods
fn parse_input(&self, stdin: &str) -> Result<HookInput, ParseError>;
fn render_response(&self, verdict: Verdict) -> HookResponse;
// Provided method
fn render_context(&self, _context: &str) -> HookResponse { ... }
}Required Methods§
fn parse_input(&self, stdin: &str) -> Result<HookInput, ParseError>
fn render_response(&self, verdict: Verdict) -> HookResponse
Provided Methods§
Sourcefn render_context(&self, _context: &str) -> HookResponse
fn render_context(&self, _context: &str) -> HookResponse
Surface explanatory context to the model on a non-approval without changing the permission decision (the command still flows through the tool’s normal approval path, and the user’s own allowlist still applies).
The default abstains silently — same as today’s empty deny body. A target overrides this only when its hook schema has a verified field for injecting model-visible context without a permission decision.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".