failClosed reports whether a hook failure on event must deny the event. PreToolUse (both lanes) is a hard security boundary: a crashed safety hook must not silently allow the call through. Every other event surfaces failures as warnings unless the hook opts into ErrorPolicyBlock.
(event EventType)
| 398 | // Every other event surfaces failures as warnings unless the hook |
| 399 | // opts into ErrorPolicyBlock. |
| 400 | func failClosed(event EventType) bool { |
| 401 | return event == EventPreToolUse || event == EventPreToolUsePreYolo |
| 402 | } |
| 403 | |
| 404 | // stdoutAsContext reports whether plain stdout (non-JSON, exit 0) |
| 405 | // from a hook should be routed into Result.AdditionalContext. It is |