Files
codex/codex-rs/core/tests/suite
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
..