Repository navigation
Description
Found while bridging the agent config to Codex (#823).
.claude/settings.json wires scripts/hooks/aws-write-guard.sh as a
PreToolUse hook on Bash(aws *), Bash(terraform *), Bash(kubectl *) and
Bash(helm *). Under Codex nothing equivalent runs. Probed against Codex
0.167.0: a project-level .codex/hooks.json and a project-level
.agents/hooks.json were both placed with a SessionStart hook that touches a
marker file, and neither fired — only $CODEX_HOME/hooks.json did. Those two
path strings do exist in the Codex binary, inside its Claude-Code migration
reader, which imports into $CODEX_HOME — which is exactly what makes them
look repo-scoped when grepped.
permissions.deny is the same story: Codex has no per-command deny list, so
pkill, killall and the destructive aws entries are unenforced there. Its
substitute is sandbox_mode / approval_policy, and the invocation in use here
is codex --dangerously-bypass-approvals-and-sandbox --profile kimi, which
removes that too.
So on the Codex path the only things standing between an agent and this account
are the read-only er-readonly profile in .mcp.json and the IAM denies on the
permission sets. That may well be the right answer — the guard was always
belt-and-braces over IAM — but it is currently true by accident rather than by
decision, and make check cannot see it either way.
The options, in increasing cost
- Decide it is fine and write that down. The guard's own value is that it
catches a mistake before it reaches AWS; IAM catches it at AWS. Record the
decision in theaws-account-operationsskill so the next session does not
re-derive the gap. - Port the guard per-developer. A
scripts/codex-hooks-sync.shalongside
scripts/codex-mcp-sync.sh, writing aPreToolUseentry into
$CODEX_HOME/hooks.jsonthat calls the same script. Codex's hook event
names match Claude Code's (PreToolUse,PostToolUse,SessionStart, …),
so the shape transfers; what needs checking is the payload the hook receives
and whether a non-zero exit actually blocks the call. Note hooks there carry
atrusted_hashper entry inconfig.toml, so a changed hook needs
re-trusting — and in a non-interactivecodex execthat may mean it silently
does not run, which would be a guard that exists and does nothing. - Close it at IAM instead, which is where it cannot be bypassed by a flag.
(2) is only worth doing if its own trust/exit-code behaviour is proved first,
for the reason this repo keeps relearning: a guard whose precondition never
holds is decoration.
Acceptance
Either the decision from (1) is recorded in a skill, or a hook sync exists whose
blocking behaviour has been observed — a denied aws write under Codex,
actually refused, in a non-interactive run.
Activity
feat(agents): bridge CLAUDE.md to Codex, and gate what cannot be bridged
feat(agents): bridge the skills and CLAUDE.md to Codex (#822)
feat(agents): port the PreToolUse guard to Codex, where `ask` means a…