swastik-oai
a4b4082b5f
Apply PreToolUse hooks before direct Guardian review policy checks ( #58368 )
...
## Why
Direct Guardian review checked recorded `exec_command` calls without applying `PreToolUse` hooks, so approval decisions could miss hook rewrites or denials.
## What changed
Run the shared `PreToolUse` hook handling before evaluating approval requirements. Use the rewritten arguments for policy checks and the Guardian approval request, and return an error when a hook blocks the call, even if policy would otherwise skip review.
## Testing
Add regression tests covering rewritten commands that require approval and hook denials for policy-allowed commands. Verify the rewritten approval request, hook events and recorded denial context, and that reviewed commands are not executed.
GitOrigin-RevId: 3ec7700f695e422ac59c903c285acc0cf633b915
2026-10-30 15:28:20 +00:00
..
2026-10-30 15:11:02 +00:00
2026-10-17 04:02:21 +00:00
2026-10-30 14:47:56 +00:00
2026-10-30 02:43:02 +00:00
2026-10-28 21:22:06 +00:00
2026-10-14 19:47:50 +00:00
2026-10-30 15:28:20 +00:00
2026-10-22 01:42:11 +00:00
2026-10-14 20:53:59 +00:00
2026-10-27 00:52:31 +00:00
2026-10-30 02:43:02 +00:00
2026-10-07 21:52:43 +00:00
2026-10-30 15:11:02 +00:00
2026-10-30 14:40:32 +00:00
2026-10-28 21:22:06 +00:00
2026-10-16 17:31:47 +00:00
2026-10-30 15:28:20 +00:00
2026-10-26 19:35:31 +00:00
2026-10-30 15:11:02 +00:00
2026-10-26 21:48:19 +00:00
2026-10-21 19:36:20 +00:00
2026-10-07 13:05:06 +00:00
2026-10-23 00:02:29 +00:00
2026-09-16 04:59:23 +00:00
2026-10-26 21:15:23 +00:00
2026-10-26 21:15:23 +00:00
2026-10-10 01:25:00 +00:00
2026-10-28 11:48:00 +00:00
2026-10-28 11:48:00 +00:00
2026-10-29 11:15:52 +00:00
2026-10-05 18:52:51 +00:00
2026-09-24 22:54:29 +00:00
2026-10-29 16:39:38 +00:00
2026-10-28 21:34:25 +00:00
2026-10-28 21:34:25 +00:00
2026-10-29 19:29:05 +00:00
2026-10-26 21:48:19 +00:00
2026-10-23 04:52:47 +00:00
2026-10-29 09:48:55 +00:00
2026-10-12 18:53:49 +00:00
2026-10-13 08:13:34 +00:00
2026-10-30 15:11:02 +00:00
2026-10-10 01:25:00 +00:00
2026-10-10 01:25:00 +00:00
2026-10-13 23:51:47 +00:00
2026-10-13 23:51:47 +00:00
2026-10-28 11:48:00 +00:00
2026-10-10 17:30:25 +00:00
2026-10-29 11:15:52 +00:00
2026-10-05 16:10:27 +00:00
2026-10-28 21:22:06 +00:00
2026-10-26 21:08:15 +00:00
2026-10-29 23:24:52 +00:00
2026-10-19 22:55:42 +00:00
2026-10-19 20:30:44 +00:00
2026-10-29 00:42:21 +00:00
2026-10-27 23:53:34 +00:00
2026-10-27 23:53:34 +00:00
2026-10-05 23:52:06 +00:00
2026-10-08 13:45:19 +00:00
2026-10-29 11:23:51 +00:00
2026-10-14 19:47:50 +00:00
2026-10-29 11:23:51 +00:00
2026-10-29 20:39:04 +00:00
2026-10-07 21:52:43 +00:00
2026-09-18 23:07:36 +00:00
2026-09-18 23:07:36 +00:00
2026-10-07 03:07:51 +00:00
2026-10-01 15:57:03 +00:00
2026-10-29 09:48:55 +00:00
2026-10-23 04:01:39 +00:00
2026-10-19 11:40:15 +00:00
2026-10-28 02:00:30 +00:00
2026-10-27 22:59:22 +00:00
2026-10-27 22:59:22 +00:00
2026-10-29 12:54:39 +00:00
2026-10-01 05:33:36 +00:00
2026-10-08 18:42:58 +00:00
2026-10-29 19:34:46 +00:00
2026-10-29 19:34:46 +00:00
2026-10-21 01:55:56 +00:00
2026-10-21 01:55:56 +00:00
2026-10-26 19:37:32 +00:00
2026-09-16 15:17:41 +00:00
2026-10-28 11:48:00 +00:00
2026-09-23 22:10:04 +00:00
2026-10-28 05:46:04 +00:00
2026-10-27 22:59:22 +00:00
2026-10-10 01:25:00 +00:00
2026-10-30 02:43:02 +00:00
2026-10-30 02:43:02 +00:00
2026-10-06 19:29:40 +00:00
2026-10-27 12:17:14 +00:00
2026-10-28 11:48:00 +00:00
2026-09-29 02:05:56 +00:00
2026-10-23 16:09:06 +00:00
2026-10-26 18:31:49 +00:00
2026-09-24 16:36:57 +00:00
2026-09-24 16:36:57 +00:00
2026-09-17 18:20:28 +00:00
2026-09-29 16:53:11 +00:00
2026-10-17 04:02:21 +00:00
2026-10-16 17:31:47 +00:00
2026-10-16 17:31:47 +00:00
2026-10-07 17:59:22 +00:00
2026-10-07 21:52:43 +00:00
2026-10-23 00:02:29 +00:00
2026-10-08 13:45:19 +00:00
2026-09-30 03:22:55 +00:00
2026-09-30 03:22:55 +00:00
2026-10-19 17:02:20 +00:00
2026-10-08 16:19:09 +00:00
2026-10-27 19:50:41 +00:00
2026-10-29 11:15:52 +00:00
2026-10-30 15:11:02 +00:00
2026-10-29 19:29:05 +00:00
2026-10-29 19:29:05 +00:00
2026-10-10 01:25:00 +00:00
2026-10-06 10:39:16 +00:00
2026-10-27 23:02:27 +00:00
2026-10-02 16:55:41 +00:00
2026-10-01 03:31:48 +00:00
2026-10-28 11:48:00 +00:00
2026-10-14 18:01:54 +00:00
2026-10-26 19:35:31 +00:00
2026-10-28 15:04:29 +00:00
2026-10-17 04:02:21 +00:00
2026-09-18 00:25:37 +00:00
2026-09-19 01:21:32 +00:00
2026-10-08 06:31:56 +00:00
2026-09-23 18:40:12 +00:00