Repository navigation
Description
Follow-up from #826 / PR #830, which shipped the Codex PreToolUse guard.
The guard is installed per machine by scripts/codex-hooks-sync.sh, and
Codex silently skips a hook it has not trusted — no warning, no log line,
the command just runs. So an installed guard protects nothing until trust is
granted, which is the worst state available: it reads as cover.
Two ways to be trusted, and only one is durable:
- Interactive approval, once per machine. Start
codexin the repo and
approve the hook when prompted. That writes a
[hooks.state."<file>:<event>:<i>:<j>"] trusted_hashentry into
$CODEX_HOME/config.toml, after which every later run honours it —
codex execincluded. --dangerously-bypass-hook-truston every invocation. This works but
persists nothing — verified across four bypassed runs, which left
config.tomluntouched — so it has to be remembered every time, and the day
it is forgotten the guard is absent without saying so.
This cannot be scripted. Deriving the trusted_hash so the installer could
self-trust was attempted against the one known-good entry and failed across
twelve candidate recipes (command string, with/without newline, the state key,
key+command, several JSON encodings of the hook entry, the whole file). And an
agent cannot drive an interactive approval from a tool call.
What is owed
- Approve the hook interactively on each machine that runs Codex or Kimi
against this repo, so sessions stop depending on the bypass flag. - Confirm it took, the only way that proves anything: ask a session to run
a denied command without--dangerously-bypass-hook-trustand look
forCommand blocked by PreToolUse hook: ….
Until both are done, treat the Codex path as guarded only when that flag is
passed. What does already hold: a deny blocks even under
--dangerously-bypass-approvals-and-sandbox — sandbox bypass is not hook
bypass — so the protection is real once trusted.
Known state at filing: on the machine that landed #830 the guard is installed
and proven blocking with the bypass flag; trust is not granted.
Activity
athvin commentedon Nov 27, 2026
Closed in the 2026-11-26 board prune. The board now targets a deduplication tool that works the same whatever the data's source. This card is speculative or process upkeep, so it isn't needed for that. It's labelled
prunedand can be reopened if it becomes relevant.