Skip to content

Codex with AgentFox
what gets checked, and where

The same hooks as for Claude Code, written to .codex/hooks.json. Codex cannot ask you from a hook, so a call that needs a person is refused with the reason.

Three lines

Everything starts in Watch: nothing is stopped until you switch a library to Block.

Install
agentfox admin hooks install --harness codex --agent codex-dev --write   # add --scope user for every project
agentfox init && agentfox admin hooks daemon
# in Codex: /hooks, then trust the three AgentFox hooks

What gets checked

Each row is a check that runs in your process, before the thing it checks happens.

CheckedHow
Shell commandscurl … | sh, cat .env, rm -rf ~, git reset --hard, terraform apply, npm publish and turning AgentFox off are refused from the start
Every other tool callAuthorised against the agent's grants, including MCP tools, which arrive with no grant
Prompts and tool resultsA refused prompt never reaches the model; a tool result carrying injected instructions is handed to the agent marked as data

Found in the code by agentfox scan: agentfox scan machine reads Codex's own config for the MCP servers it loads. The scan reads the repository and runs nothing, so it works before any of the lines above are added.

Limits
  • Codex skips a hook nobody trusted, and a changed hooks file needs trusting again.
  • A call that needs a person is refused with the reason, since Codex cannot ask from a hook. Hosted tools such as web search run on OpenAI's side and are not checked.
  • The hooks record on this machine, not in your account.

Where to go from here

Claude Code and Codex: the Codex differences Tool access: which tools the agent may call What the checks catch, with their limits Every framework

Try AgentFox on your own agent

One command finds your agents. It starts in watch mode, so nothing is blocked until you say so.

uvx agentfox scan