Evidence record / codex
A dated record of one change, kept so the writing that cites it can be checked. Compiled from the sources listed below by the research run, not written for reading. The judgment lives in the signals and issues that cite it, below.
Codex: PreToolUse Hook Input Rewrites
What Changed
PR #20527 enables PreToolUse
hooks to rewrite tool inputs before execution. The hook output schema already
documented updatedInput, but Codex was rejecting it instead of applying it.
Now: when a PreToolUse hook returns permissionDecision: "allow" with an
updatedInput payload, Codex applies the rewritten input before dispatching
the tool call. The tool executes the updated payload, not the original.
Operator Consequence
PreToolUse hooks can now sanitize, normalize, redirect, or augment tool calls before execution. Examples:
- Strip or mask sensitive arguments before a shell command runs
- Normalize file paths to prevent path traversal
- Replace a risky file destination with a safe staging path
Previously, hooks could only observe and allow/deny. Now they can observe, allow with modification, or deny.
Signal
Hook authors who have been waiting for updatedInput to work should test
existing hooks. Hooks that previously allowed-and-returned an updatedInput
(expecting the rewrite to apply) were silently executing the original input.
Finding metadata
Run: 2026-05-12-partial-cycle-codex-refresh-2026-05-12-frontier-v0
Finding ID: 2026-05-12-codex-pretooluse-input-rewrite
Accepted signals
Source links
Primary links, including exact changelog lines when available.
Versioned source: run artifact