Are you an LLM? You can read better optimized documentation at /docs/agent-guard/operations/agent-enforcement-differences.md for this page in Markdown format
Enforcement differences between agents
Most of Agent Guard's enforcement is identical whatever agent you run, because it happens outside the agent: artifact admission runs on the host before the agent starts, and guardrails run in the Jozu AI Gateway that inference traffic passes through. Neither depends on the agent cooperating.
Tool enforcement depends on how a given agent reports the tool calls it is about to make. Claude Code, OpenClaw, Antigravity CLI and Codex CLI each call the policy server before a tool runs, so your ToolPolicies are evaluated as written, with full CEL, whichever you use. A custom runtime's MCP tool calls pass through the Jozu gateway and are evaluated the same way; an action it takes without the gateway is outside policy (see Custom runtime limitations). The differences between agents are in the tool names each one uses and in how a verdict reaches it.
Codex
Codex enforces through a PreToolUse hook that Agent Guard installs as a managed hook in /etc/codex/requirements.toml inside the guest. The hook receives the tool name and arguments, asks the policy server, and denies the call when a policy says so. It sees shell commands (Bash), file edits (apply_patch) and MCP tools (mcp__<server>__<tool>). These are Codex's own tool names, and a policy applies to Codex only where it names them.
Regular expressions, Audit policies and rules on any argument all behave as they do elsewhere. There is no translation step and no built-in fallback rule set: Codex enforces your policies, and only your policies.
These behaviors are specific to Codex.
File-tool policies reach Codex edits only where they name apply_patch. Codex has no Read, Write or Edit tool: it reads files through Bash and changes them through apply_patch, whose one argument, command, is the patch text. The hook finds the files a patch touches in its *** Add File:, *** Update File:, *** Delete File: and *** Move to: headers and checks the call once per file, as apply_patch with three arguments added:
| Argument | Value |
|---|---|
file_path | The file's absolute path, resolved against Codex's working directory and cleaned |
raw_file_path | The path as written in the patch, so a rule can see .. |
file_paths | Every file the patch touches |
A rule written against file_path for Claude Code's file tools therefore covers Codex once apply_patch is in its match.tool.names, and the call is denied if any file's check denies. The file-write fence in the Strict, Standard and Permissive pre-built tiers already lists apply_patch. command still carries the patch, so a rule over command meant for shell commands should skip apply_patch, or text in a file that reads like a command is refused.
apply_patch also runs from Codex's shell. A Bash command that carries a patch is checked as the shell call and once per file in the same way. The hook refuses a shell apply_patch whose patch it cannot see, such as one redirected from a file, and one whose paths depend on a cd it cannot follow; the only cd it follows is cd <dir> && apply_patch at the start of the command. A patch that names no file is refused.
Reads and other writes are Bash calls. Fence them with a Bash rule: cat .env or cp into a protected path never reaches a file-tool policy.
Elicit blocks instead of asking. Agent Guard runs Codex with approval prompts turned off, and Codex's PreToolUse event has no "ask" decision, so a policy that elicits confirmation on another agent denies the call on Codex. The message tells the model that confirmation is required. An operator cannot approve a Codex action.
Errors the hook detects block the call. Codex runs a tool call when its hook exits with an unexpected status, so the Agent Guard hook exits with a block status on every error it can see: an unreachable policy server, an engine that could not load its policies, or an unreadable payload. A hook that is killed, runs past its 30-second timeout, or cannot start is the exception: Codex then runs the call. Claude Code and Antigravity CLI handle a failed hook the same way.
Only the managed hook runs. Codex also loads hooks from <workspace>/.codex/hooks.json and from the user's ~/.codex, and the agent can write to the workspace. The managed configuration sets allow_managed_hooks_only, so Codex ignores every other hook source.
Codex version
Managed hooks need Codex 0.131.0 or later. Agent Guard checks the version of the Codex it starts and refuses to start the session on an older one, rather than run Codex without enforcement.
What to do
For controls that must hold regardless of agent, prefer a layer that does not depend on the agent at all. An ArtifactPolicy blocking an MCP server, or a GuardrailPolicy on inference content, applies to every session exactly alike.
To check what Codex has installed, read the managed configuration inside the guest:
bash
cat /etc/codex/requirements.tomlUnaffected by all of this
- ArtifactPolicy. Admission runs on the host before the agent starts, so every agent gets identical treatment
- GuardrailPolicy. Inference traffic passes through the Jozu gateway whatever agent produced it
- Network egress and the microVM boundary. Enforced by the sandbox, not by the agent; see How network access works
