Codex
Codex is OpenAI's coding agent; Octant drives it through the Codex app-server, and it is one of Octant's four first-class providers, with Claude Code, Mistral Vibe and OpenCode.
Codex gets each Octant feature in full first. It runs commands in its own sandbox rather than Octant's.
Set up Codex
- Install the Codex CLI.
- Sign in with the unmodified
codex logincommand in a terminal. Check it withcodex login status. - Open Settings → Providers & Models. On first run, a detected Codex is added switched on.
- Run Check connection and wait for Ready.
Octant never reads auth.json or the keyring, and never writes Codex credential-store settings into your config.
Add another Codex account
You can add more than one Codex account with Add account on the Codex card. The form opens with Codex chosen, your binary path filled in, and a suggested name.
- Octant assigns the first account Codex's default directory (
~/.codex). Each additional account gets its own directory under~/.codex-accounts/. - Sign in only with the unmodified
codex logincommand in a terminal for that account, and check status withcodex login status. The provider card shows the exact command, includingCODEX_HOMEfor an extra account. - The first account still uses an API key already in your environment. Extra accounts do not inherit that key, and keep their thread state in their own directory even when
CODEX_SQLITE_HOMEis set. - An API key you store in Octant for that provider reaches only that account.
- Outside Strict, an account receives your environment without Octant's own variables. The credentials your own tools use, such as
GH_TOKEN,NPM_TOKENand AWS keys, and other model providers' keys reach Codex, sogh,npmandawswork inside its commands, and so do your proxy and certificate settings. Under Strict it gets a short fixed list, to which you can add names for Codex (Let through under Strict). See also Use Codex with Amazon Bedrock. - Each account runs its own Codex app-server. A thread stays on the account it started with until you move it, or until it hands off on a usage limit you opted into (Move a thread to another account). Octant does not fail over, rotate, or load-balance between accounts on its own.
What works natively
| Feature | Codex |
|---|---|
| Reopen the thread's own session | Yes |
| Approval prompts from the runtime | Yes |
| Questions from the agent | Yes |
| Reasoning shown | Yes |
| Token usage counted | Yes |
| File changes and diffs | Yes |
| Attachments sent natively | Image models |
| Octant tools (Browser, Computer) | Yes, as dynamic tools on the app-server thread |
| Change model inside a thread | Yes |
| Compact session | Yes, Codex 0.162.1 or newer |
| Auto-review of approvals in Code | Yes |
Codex commentary and the answer messages after it keep their paragraph boundaries, including when Codex sends a completed message without streaming its text. Responses saved before this behaviour are not rewritten.
Chat offers Codex's other declared options, such as Service tier, in its composer.
If you store several API keys for a Codex account, it uses the first key and does not switch keys within a turn.
Codex keeps its own memory in an account's threads unless you turn off Use Codex's own memory for the account: in every mode outside Strict, as in Codex itself, and only in Work and Code outside Plan under Strict; Codex's own configuration then decides how it uses it. See The provider's own memory.
Questions and plans
When Codex asks you a question, it reaches you as a question form in the thread. A question marked secret, or one asking for a password, passphrase, API key, access token, or private key, is handled differently:
- Outside Strict, in a Code, Work, or Chat thread, Codex shows it to you in a masked field, which you can reveal. An Octant subagent can ask through its parent thread too, following that thread's Strict setting. Octant passes the answer to Codex and never saves it: the thread records only that the question was asked and answered.
- Only you can answer it, from a window on this computer or a phone or browser you paired yourself. In Needs you and the Inbox it is a row that opens the thread, with no answer of its own.
- Under Strict, it is refused at once and never shown.
In Plan, Codex plans in its own plan mode, still read-only, and its finished plan becomes the reply. See Plan mode.
Codex's own sandbox
Outside Strict, a Work or Code thread at Ask first, Accept edits or Auto runs in Codex's own workspace-write sandbox, as Codex runs on its own. The Project's folders are where it may write, and its commands reach the network unless Network limits route the thread through Octant's proxy. From Codex 0.169.0 onward, Codex's own sandbox also refuses other providers' stored sign-ins (Protected files). At Ask first, Codex asks before every command it does not know to be safe. At Accept edits, Codex decides when to ask, as in its own CLI, and edits inside the Project's folders go ahead without a prompt. At Auto, Codex's own reviewer answers, so a command inside its sandbox runs without asking, as in Codex's own Auto. Reading outside content leaves that reviewer on outside Strict.
When Codex asks to run a command outside its sandbox, you get an ordinary Octant approval (at Auto, the reviewer answers).
- An approval you keep for the session. Codex is told to remember it, so it stops asking for a matching command, as it does on its own. An answer for one call, and a reviewer's answer, cover that one command and nothing is remembered.
- A request that reaches outside the Project's folders is shown to you below Full access. Your answer covers that one request and is never remembered. At Full access Codex does not ask; if it sends a request anyway, it is accepted and the turn carries on.
- A file Codex changes outside the Project's folders is recorded as a step that says files outside the Project were changed, without a diff for the outside file, and the turn carries on.
Under Strict, every approval covers one command, a request that reaches outside the Project is declined without being shown, and a change outside the Project ends the turn.
A message from Codex that Octant does not recognise is ignored, so a new Codex release does not end a turn for sending something new.
Octant turns Codex's analytics off unless you turn on Let providers send their own telemetry; see Provider telemetry and updates for what Codex may still send.
Under Strict, in Plan, and in Chat, Codex runs inside Octant's sandbox instead, and a command that needs to leave it fails there rather than asking. Accept edits there asks before every command Codex does not know to be safe, as Ask first does. Auto still runs as Codex's own Auto inside Octant's sandbox, but under Strict it falls back to asking you first once the thread reads outside content, or when a capability it needs is missing. A Strict thread and one outside Strict never share a Codex process. Full access runs Codex with no sandbox, unless the thread keeps it.
Review with /review
Type /review in a Work or Code thread to run Codex's own review of the thread's checkout. With nothing after it, it reviews the uncommitted changes, as Codex does; text after /review becomes the review's instructions. The review runs read-only on a separate Codex thread with no approvals, and its findings appear in the reply under a Codex review heading. They are also added to the thread's own Codex session, so a follow-up such as "fix those findings" sees them.
/review runs in every Work and Code mode — Ask first, Accept edits, Auto, Plan, Full access (with or without the sandbox kept), and under Strict — and attachments reach the thread as usual. Only Chat and a Codex release without review refuse it.
Run Codex as itself
Codex runs as itself unless you turn Run … as itself off for the account or the thread. See Let a provider run as itself for the switches. Codex then loads:
- the skills in the Project, its
.codex/config.tomlwhen the Project is trusted, and itsAGENTS.mdin Work as in Code (AGENTS.mdis always readable); - in Chat, your own MCP servers, plugins, and apps;
- its own subagents. Each one shows in the thread as a subagent run and works under the thread's level: any approval it needs reaches you the same way as the main session's.
Outside Strict, adding a Project or folder in Octant counts as trust for Codex and every other agent. Under Strict, code-running Project configuration such as .codex/config.toml asks once per Project and is listed under Trusted providers on the Project's page.
With Run Codex as itself off for the account, Codex's own subagents stay off unless the thread chose On, the Project trusts Codex, or a Work or Code thread runs at Full access. A thread set to Off keeps them off everywhere, Full access included.
Codex's own web search is on while it runs as itself. With the account turned off, Codex starts every thread with its web search disabled, in every mode.
Run Codex on an SSH server
Unmerged preview work
This section describes behavior in open pull request #2775, which is not yet in a release.
In a Code Project on one of your servers, a thread can run Codex on the server itself, signed in there, with its own sandbox and plan mode, while approvals, Stop and the thread's history stay on this computer. Strict refuses it. See Run Codex or Claude Code on the server.
Sessions, fork, rewind, and @ mentions
- Continue your own Codex sessions. An empty Code or Work thread lists Codex sessions you started outside Octant in the same folder under Continue one. Choosing one adopts that session; an adopted thread keeps Codex's own tools rather than Octant's tools.
- Native fork (0.143.0+). From Codex
0.143.0onward, Fork from here makes a copy using Codex's own session copy, leaving the source session untouched. - Native rewind (0.143.0+). From Codex
0.143.0onward, rewinding a Code thread on the same folder and mode to a turn with an anchor continues on Codex's own session copy (leaving the source untouched). Older releases, turns without an anchor, or a changed folder or mode fall back cleanly to the text handoff. - Skills and plugins in
@. Typing@in the composer lists your Codex account skills ($name), Project skills labeled Project when the thread's launch loads them, and installed Codex plugins (@name). When Project skills are off for the thread, no Project rows appear.
Use Codex with Amazon Bedrock
A Codex CLI configured for Amazon Bedrock works in Octant as it does on its own, outside Strict. It can sign in with:
- a Bedrock API key you signed that Codex account in to Bedrock with;
- for the first Codex account,
AWS_BEARER_TOKEN_BEDROCK(plusAWS_REGION) in the environment Octant starts from; - a provider
authcommand in the Codex config; - your AWS identity: an
aws.profileoraws.credential_exportin the Codex config,AWS_PROFILE, the AWS shared config under~/.aws, single sign-on, or exported IAM keys.
Under Strict, a session that would sign in from your AWS identity is refused when it starts, with a sentence naming Strict, because Strict keeps those credentials out of reach of the commands the model runs. Use a Bedrock API key in a Strict thread. The account itself stays ready for every thread outside Strict.
To use Bedrock with your organization's single sign-on or your AWS profile in Octant Harness, add an Amazon Bedrock endpoint instead.
Update Codex
When Settings can see that a newer release exists, it shows Update available (installed → newest) beside Update CLI. Octant reads the newest version from the npm registry once a day. Nothing updates until you click Update CLI. See Update a CLI.