pub struct PreToolOutcome {
pub decision: HookDecision,
pub reason: Option<String>,
pub updated_args: Option<Value>,
}Expand description
BP-10: everything a pre-tool hook can say about one call — a decision, a human-readable reason, and (the rewrite half of the row) REPLACEMENT arguments.
Fields§
§decision: HookDecisionThe hook’s verdict — see HookDecision.
reason: Option<String>Why, in words. Fed back to the model on a denial; carried to the approval door otherwise.
updated_args: Option<Value>BP-10 (the “rewrite” half): arguments to run the tool with INSTEAD
of the model’s own. None (the default) leaves the call untouched.
The rewritten arguments are what the permissions engine then
evaluates and what the tool finally receives — a hook cannot
launder a denied command by rewriting it past the gate, because the
gate runs on the REWRITTEN args.
Implementations§
Trait Implementations§
Source§impl Clone for PreToolOutcome
impl Clone for PreToolOutcome
Source§fn clone(&self) -> PreToolOutcome
fn clone(&self) -> PreToolOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PreToolOutcome
impl Debug for PreToolOutcome
Source§impl Default for PreToolOutcome
impl Default for PreToolOutcome
Source§fn default() -> PreToolOutcome
fn default() -> PreToolOutcome
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PreToolOutcome
impl RefUnwindSafe for PreToolOutcome
impl Send for PreToolOutcome
impl Sync for PreToolOutcome
impl Unpin for PreToolOutcome
impl UnsafeUnpin for PreToolOutcome
impl UnwindSafe for PreToolOutcome
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more