Return this from a PreToolUse hook callback to control tool execution.
Usage
HookResultPreToolUse(
permission = c("allow", "deny"),
reason = NULL,
continue = TRUE,
additional_context = NULL,
stop_reason = NULL
)See also
CallbackResult for read-only properties and S7 inspection.
Examples
# Allow a tool call
HookResultPreToolUse(permission = "allow")
#> <deputy::HookResultPreToolUse>
#> @ permission : chr "allow"
#> @ reason : NULL
#> @ continue : logi TRUE
#> @ additional_context: NULL
#> @ stop_reason : NULL
# Deny a dangerous command
HookResultPreToolUse(
permission = "deny",
reason = "Dangerous command pattern detected"
)
#> <deputy::HookResultPreToolUse>
#> @ permission : chr "deny"
#> @ reason : chr "Dangerous command pattern detected"
#> @ continue : logi TRUE
#> @ additional_context: NULL
#> @ stop_reason : NULL