> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ironbee.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> IronBee (ironbee.ai) is an AI QA engineer: it verifies code changes against the running app and keeps the evidence. It is not related to the IronBee open-source web application firewall.
> The console is at https://console.ironbee.ai.
> Install the CLI with `npm install -g @ironbee-ai/cli`, sign in with `ironbee login`, and set up a project with `ironbee install`.
> In GitHub workflows, use the action as `ironbee-ai/ironbee-action@v1` and pass the `IRONBEE_API_KEY` secret as the `ironbee_api_key` input.
> In GitLab pipelines, include the component `gitlab.com/ironbee-ai/ironbee-gitlab/verify@v1`; it reads the `IRONBEE_API_KEY` CI/CD variable by default.
> In Bitbucket Pipelines, run the pipe `docker://ghcr.io/ironbee-ai/ironbee-bitbucket:v1` and pass `IRONBEE_API_KEY: $IRONBEE_API_KEY` and `BITBUCKET_OAUTH_TOKEN: $BITBUCKET_OAUTH_TOKEN` under its `variables:`.
> Console scenarios (https://docs.ironbee.ai/console/scenarios) and CLI saved scenarios (https://docs.ironbee.ai/cli/guides/scenarios) are separate features.
> For plans and prices, link to https://ironbee.ai/pricing; the website is the source of truth for them.

# Codex

> How IronBee integrates with OpenAI Codex CLI - guidance files, hooks, the $ironbee-verify and $ironbee-review skills, MCP servers, and Codex specifics.

When you run `ironbee install` in a project where [Codex CLI](https://github.com/openai/codex) is detected, IronBee wires up the hooks, guidance, and tools Codex needs to verify your agent's work. The integration mirrors [Claude Code](https://docs.ironbee.ai/cli/clients/claude-code.md) and [Cursor](https://docs.ironbee.ai/cli/clients/cursor.md), with a few Codex-specific details covered below.

> [!NOTE]
>
> IronBee supports the **interactive Codex CLI** (the TUI you get from running `codex`). The non-interactive `codex exec` mode is out of scope. Codex [doesn't fire hooks there](https://github.com/openai/codex/issues/24211), so there's nothing for IronBee to gate on.

***

## What gets installed

IronBee writes Codex's active config **per project** (under `<project>/.codex/`) so each project gets its own hooks, MCP server, and verifier - no machine-global "last install wins". These files are committed alongside your `.claude/*` and `AGENTS.md`.

| File | What it does |
| - | - |
| `<project>/.codex/hooks.json` | Registers IronBee's lifecycle hooks |
| `<project>/.codex/config.toml` | Enables Codex's hook runtime (`[features] hooks = true`), registers the verifier agent (`[agents.ironbee-verifier]`), registers the session-level `[mcp_servers.ironbee-devtools]` server, sets the multi-agent options under `[features.multi_agent_v2]`, and adds the sandbox `writable_roots` grant |
| `<project>/.codex/agents/ironbee-verifier.toml` | The **verifier sub-agent** that runs the cycles, with its own `[mcp_servers.ironbee-devtools]` block serving every enabled cycle's tools. Codex 0.154 and later ignore this block and use the session-level one in `config.toml` |
| `<project>/AGENTS.md` | The always-applied verification rule, written into an IronBee-delimited block (`<!-- ironbee:start -->` … `<!-- ironbee:end -->`) |
| `<project>/.agents/skills/ironbee-verification/SKILL.md` | The verification skill the agent follows |
| `<project>/.agents/skills/ironbee-verify/SKILL.md` | The `$ironbee-verify` skill you can invoke by hand |
| `<project>/.agents/skills/ironbee-review/SKILL.md` + `agents/openai.yaml` | The [`$ironbee-review`](#the-ironbee-review-skill) skill, for a code review of your working tree, and its Codex policy, which keeps Codex from invoking it on its own |
| `<project>/.codex/agents/ironbee-scenario.toml` | The **scenario sub-agent** for [saved scenarios](https://docs.ironbee.ai/cli/guides/scenarios.md) (registered like the verifier; its read-only sandbox applies on Codex versions before 0.154) |
| `<project>/.agents/skills/ironbee-{manage,search,run,sync}-scenario/SKILL.md` | The `$ironbee-{manage,search,run,sync}-scenario` skills |
| `<project>/.codex/agents/ironbee-issue-tracker.toml` + `<project>/.agents/skills/ironbee-issue-track/SKILL.md` | The **issue-tracker sub-agent** and its `$ironbee-issue-track` skill - written only when an [issue tracker](https://docs.ironbee.ai/cli/guides/issue-tracking.md) is connected (in `main-agent` mode there's no agent; the skill drives the tools inline) |

IronBee's entries are **merged** into your existing Codex config and `AGENTS.md`. Your own hooks, MCP servers, and guidance outside the IronBee block are never touched. On uninstall, only the IronBee block and skills are removed. Your user-level `~/.codex/config.toml` still applies - for example its top-level `model`.

> [!NOTE]
>
> The layout above is the default **`sub-agent`** delivery mode. In **`main-agent`** mode there's no `ironbee-verifier.toml`: the skill, rule and command are inlined instead of delegating. The session-level `ironbee-devtools` server in `config.toml` is written in both modes. See [How verification is delivered](#how-verification-is-delivered).

> [!NOTE]
>
> Restart Codex after installing so it picks up the new hooks, guidance, and MCP servers. The first time, Codex shows a one-time **"hooks need review"** prompt (its safety gate for project-level hooks) - run `/hooks` to approve. IronBee writes `[features] hooks = true` for you; without it Codex parses hooks but never dispatches them.

***

## The \$ironbee-verify skill

Codex has no user-defined slash commands, so IronBee's manual verification trigger is exposed as a **skill you mention by name**. Type `$ironbee-verify` in the Codex prompt to run a verification cycle for the current changes. As with [`/ironbee-verify` in Claude Code](https://docs.ironbee.ai/cli/clients/claude-code#slash-commands), you can pass a **custom scenario** - inline text or a path to a scenario file - that defines exactly what to verify:

```bash theme={null}
$ironbee-verify                              # default - exercise the changed pages/endpoints
$ironbee-verify check that the cart total    # inline scenario
  recalculates after removing an item
$ironbee-verify ./scenarios/checkout.md      # a scenario file
```

When a scenario is supplied it is authoritative and replaces the default "exercise the changed paths" flow; the completion gate is unchanged. As in Claude Code, an optional leading `fix` switches the default verify-only run into a fix-and-re-verify loop (`$ironbee-verify fix`) - see [Verify-only vs. fix mode](https://docs.ironbee.ai/cli/guides/verification.md#verify-only-vs-fix-mode). Only the invocation syntax differs from Claude Code.

The same mention syntax applies to the other commands - `$ironbee-review` for a [code review](#the-ironbee-review-skill), `$ironbee-{manage,search,run,sync}-scenario` for [saved scenarios](https://docs.ironbee.ai/cli/guides/scenarios.md) and, when an [issue tracker is connected](https://docs.ironbee.ai/cli/guides/issue-tracking.md), `$ironbee-issue-track`.

> [!NOTE]
>
> Using the **GitHub Issues** integration on Codex? Its `gh` calls run inside Codex's tool sandbox, which blocks outbound network by default - enable `[sandbox_workspace_write] network_access = true` if `gh issue view` can't reach `api.github.com`. Install prints a reminder; Jira and Linear are unaffected (their tools run outside the sandbox). See [Issue Tracking → GitHub Issues](https://docs.ironbee.ai/cli/guides/issue-tracking.md#github-issues).

***

## The ironbee-review skill

`$ironbee-review` runs [`ironbee review`](https://docs.ironbee.ai/cli/guides/code-review) on your working tree and reports the findings, with the same modes as `/ironbee-review` in Claude Code: `fix` fixes the blocking findings, `fix loop` and `fix rounds:<n>` review again after each fix pass, and `price` asks what the review would cost.

```bash theme={null}
$ironbee-review              # review the working tree and report it
$ironbee-review fix loop     # fix and review again until nothing blocks, up to the cap
```

The main agent runs it in both delivery modes, without a sub-agent. A review spends your team's credits, so Codex never invokes the skill on its own: its `agents/openai.yaml` sets `allow_implicit_invocation: false`. See [From a coding agent](https://docs.ironbee.ai/cli/guides/code-review.md#from-a-coding-agent) for every mode and option.

Codex's workspace sandbox blocks the review's temporary index under `.git` and its network calls. So the skill runs `ironbee review` and `ironbee credits` with escalated permissions, and Codex asks you once to approve each of the two commands.

***

## How verification is enforced

IronBee registers a **Stop hook** that fires when the agent tries to finish a task. If code files changed, the hook runs verification automatically and blocks completion until every active cycle passes. By default, like Claude Code, Codex **delegates verification to the `ironbee-verifier` sub-agent**, so the main conversation doesn't carry the heavy devtools output. The devtools server is also visible to the main agent (see [How verification is delivered](#how-verification-is-delivered)); IronBee's rule keeps the main agent delegating, and in enforce mode its pre-tool hook refuses a devtools call made outside a verification cycle. The verifier navigates the affected paths and submits a verdict; on failure the main agent fixes the issues and re-verifies, up to your [`maxRetries`](https://docs.ironbee.ai/cli/configuration/configuration#core-options) limit; when the fail streak reaches the limit, the verdict's reply reads `RETRY LIMIT REACHED` and the agent reports the unresolved issues. Issues on a **pass** verdict are advisory. You can pin the verifier's model with [`verification.model`](https://docs.ironbee.ai/cli/guides/verification#picking-the-verifier-model).

> [!NOTE]
>
> Enforcement only blocks task completion in [enforce mode](https://docs.ironbee.ai/cli/guides/verification.md#enforce-mode) (`ironbee verification auto enable`). In the default **assist** mode the verifier and `$ironbee-verify` are installed but nothing gates completion - see [Verification modes](https://docs.ironbee.ai/cli/guides/verification.md#verification-modes).

Codex's Stop hook returns a `decision: "block"` with a continuation reason, which pushes the agent back into the verification loop, the same enforcement semantics as Claude Code.

Codex exposes file edits through its single `apply_patch` tool, so IronBee gates edits on that instead of `Write`/`Edit`. File changes are recorded per patch, with the operation (create / update / delete) read from the patch body.

***

## How verification is delivered

By default Codex runs the cycle in the **`ironbee-verifier` sub-agent** (the `sub-agent` delivery mode), exactly like Claude Code, and the heavy output stays out of the main conversation.

Codex 0.154 and later ignore the `mcp_servers` and `sandbox_mode` settings in an agent file. So IronBee also registers `[mcp_servers.ironbee-devtools]` at the session level in `config.toml`, in both modes and on every Codex version, and the main agent can see the devtools tools. In `sub-agent` mode, IronBee's rule keeps the main agent delegating, and in enforce mode its pre-tool hook refuses a devtools call made outside a verification cycle. The verifier's read-only sandbox is applied only on Codex versions before 0.154.

IronBee also sets `[features.multi_agent_v2]` with `default_wait_timeout_ms = 600000`, so a single `wait_agent` call blocks for up to 10 minutes while the verifier works, instead of polling. If Codex's sub-agent machinery regresses, you can fall back to driving the tools from the **main agent** instead:

```bash theme={null}
ironbee codex verifier mode main-agent   # main agent drives the devtools tools directly
ironbee codex verifier mode sub-agent    # back to the default delegated verifier
```

| Mode | What changes |
| - | - |
| **`sub-agent`** *(default)* | The `ironbee-verifier` custom agent runs the cycles; a slim delegation skill/rule/command tell the main agent to hand off. Heavy devtools output stays in the sub-agent. |
| **`main-agent`** | No verifier sub-agent. The main agent drives the session-level devtools tools itself, with an inline (non-delegating) skill/rule/command: the same shape Cursor uses. |

Switching re-renders the Codex client. The choice maps to the [`codex.verifier.mode`](https://docs.ironbee.ai/cli/configuration/configuration#codex-codex-cli-only) config key; `verification.model` still applies in `sub-agent` mode and is a no-op in `main-agent` mode (there's no sub-agent to spawn).

***

## Codex-specific behavior

A few details differ from the other clients, all handled automatically:

* **No `SessionEnd` hook.** Codex doesn't expose one, so IronBee treats every Stop as a checkpoint and writes a session-end snapshot there (the Collector keeps the latest). Quitting Codex with `/quit` fires no hooks.
* **Interrupt recovery.** Pressing **Esc** to interrupt the agent doesn't fire a Stop hook in Codex ([#22858](https://github.com/openai/codex/issues/22858)). IronBee reconciles the interrupted activity on your next prompt, so the session timeline stays accurate.
* **Sandbox grant for external runtime.** With the default [`external` runtime location](https://docs.ironbee.ai/cli/advanced/runtime-files#where-per-session-data-lives), per-session data lives at `~/.ironbee/projects/` - outside the Codex workspace sandbox. So the agent's verdict writes (`ironbee hook submit-verdict` / `record-fix`) don't hit an approval prompt, IronBee adds a narrow `[sandbox_workspace_write].writable_roots` grant for `~/.ironbee/projects` to `config.toml` (the global `config.json` and collector credentials under `~/.ironbee` stay out of reach). It's reconciled away in `in-project` or monitoring mode and removed on uninstall.
* **Config is project-level.** Hooks, the MCP server, and the verifier are written per project (`<project>/.codex/`), so each repo gets its own setup and there's no machine-global conflict. The devtools are served by one `[mcp_servers.ironbee-devtools]` server whose `COMPOSE_PLATFORMS` lists the enabled cycles - browser on by default, node / python / backend / android / terminal added when you enable those cycles. A model must be resolvable for the verifier sub-agent: it inherits your `~/.codex/config.toml` `model` unless you pin [`verification.model`](https://docs.ironbee.ai/cli/guides/verification#picking-the-verifier-model); if neither supplies one, install warns you.

> [!NOTE]
>
> Session lifecycle, tool calls, file changes, verdicts, and [VCS linkage](https://docs.ironbee.ai/cli/guides/issue-tracking.md#vcs-linkage-sessions-to-prs-and-issues) flow to the Collector exactly as they do on the other clients.

***

## What's next?

> [card] [Claude Code](https://docs.ironbee.ai/cli/clients/claude-code.md)
>
> The same integration for Claude Code.

> [card] [Cursor](https://docs.ironbee.ai/cli/clients/cursor.md)
>
> The same integration for Cursor.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.