SpyBara
Go Premium Account
2026
19 Feb 2026, 20:53
14 May 2026, 21:00 14 May 2026, 07:00 13 May 2026, 00:57 12 May 2026, 01:59 11 May 2026, 18:00 7 May 2026, 20:02 7 May 2026, 17:08 5 May 2026, 23:00 2 May 2026, 06:45 2 May 2026, 00:48 1 May 2026, 18:29 30 Apr 2026, 18:36 29 Apr 2026, 12:40 29 Apr 2026, 00:50 25 Apr 2026, 06:37 25 Apr 2026, 00:42 24 Apr 2026, 18:20 24 Apr 2026, 12:28 23 Apr 2026, 18:31 23 Apr 2026, 12:28 23 Apr 2026, 00:46 22 Apr 2026, 18:29 22 Apr 2026, 00:42 21 Apr 2026, 18:29 21 Apr 2026, 12:30 21 Apr 2026, 06:45 20 Apr 2026, 18:26 20 Apr 2026, 06:53 18 Apr 2026, 18:18 17 Apr 2026, 00:44 16 Apr 2026, 18:31 16 Apr 2026, 00:46 15 Apr 2026, 18:31 15 Apr 2026, 06:44 14 Apr 2026, 18:31 14 Apr 2026, 12:29 13 Apr 2026, 18:37 13 Apr 2026, 00:44 12 Apr 2026, 06:38 10 Apr 2026, 18:23 9 Apr 2026, 00:33 8 Apr 2026, 18:32 8 Apr 2026, 00:40 7 Apr 2026, 00:40 2 Apr 2026, 18:23 31 Mar 2026, 06:35 31 Mar 2026, 00:39 28 Mar 2026, 06:26 28 Mar 2026, 00:36 27 Mar 2026, 18:23 27 Mar 2026, 00:39 26 Mar 2026, 18:27 25 Mar 2026, 18:24 23 Mar 2026, 18:22 20 Mar 2026, 00:35 18 Mar 2026, 12:23 18 Mar 2026, 00:36 17 Mar 2026, 18:24 17 Mar 2026, 00:33 16 Mar 2026, 18:25 16 Mar 2026, 12:23 14 Mar 2026, 00:32 13 Mar 2026, 18:15 13 Mar 2026, 00:34 11 Mar 2026, 00:31 9 Mar 2026, 00:34 8 Mar 2026, 18:10 8 Mar 2026, 00:35 7 Mar 2026, 18:10 7 Mar 2026, 06:14 7 Mar 2026, 00:33 6 Mar 2026, 00:38 5 Mar 2026, 18:41 5 Mar 2026, 06:22 5 Mar 2026, 00:34 4 Mar 2026, 18:18 4 Mar 2026, 06:20 3 Mar 2026, 18:20 3 Mar 2026, 00:35 27 Feb 2026, 18:15 24 Feb 2026, 06:27 24 Feb 2026, 00:33 23 Feb 2026, 18:27 21 Feb 2026, 00:33 20 Feb 2026, 12:16 19 Feb 2026, 20:53 19 Feb 2026, 20:37
31 Mar 2026, 00:39
14 May 2026, 21:00 14 May 2026, 07:00 13 May 2026, 00:57 12 May 2026, 01:59 11 May 2026, 18:00 7 May 2026, 20:02 7 May 2026, 17:08 5 May 2026, 23:00 2 May 2026, 06:45 2 May 2026, 00:48 1 May 2026, 18:29 30 Apr 2026, 18:36 29 Apr 2026, 12:40 29 Apr 2026, 00:50 25 Apr 2026, 06:37 25 Apr 2026, 00:42 24 Apr 2026, 18:20 24 Apr 2026, 12:28 23 Apr 2026, 18:31 23 Apr 2026, 12:28 23 Apr 2026, 00:46 22 Apr 2026, 18:29 22 Apr 2026, 00:42 21 Apr 2026, 18:29 21 Apr 2026, 12:30 21 Apr 2026, 06:45 20 Apr 2026, 18:26 20 Apr 2026, 06:53 18 Apr 2026, 18:18 17 Apr 2026, 00:44 16 Apr 2026, 18:31 16 Apr 2026, 00:46 15 Apr 2026, 18:31 15 Apr 2026, 06:44 14 Apr 2026, 18:31 14 Apr 2026, 12:29 13 Apr 2026, 18:37 13 Apr 2026, 00:44 12 Apr 2026, 06:38 10 Apr 2026, 18:23 9 Apr 2026, 00:33 8 Apr 2026, 18:32 8 Apr 2026, 00:40 7 Apr 2026, 00:40 2 Apr 2026, 18:23 31 Mar 2026, 06:35 31 Mar 2026, 00:39 28 Mar 2026, 06:26 28 Mar 2026, 00:36 27 Mar 2026, 18:23 27 Mar 2026, 00:39 26 Mar 2026, 18:27 25 Mar 2026, 18:24 23 Mar 2026, 18:22 20 Mar 2026, 00:35 18 Mar 2026, 12:23 18 Mar 2026, 00:36 17 Mar 2026, 18:24 17 Mar 2026, 00:33 16 Mar 2026, 18:25 16 Mar 2026, 12:23 14 Mar 2026, 00:32 13 Mar 2026, 18:15 13 Mar 2026, 00:34 11 Mar 2026, 00:31 9 Mar 2026, 00:34 8 Mar 2026, 18:10 8 Mar 2026, 00:35 7 Mar 2026, 18:10 7 Mar 2026, 06:14 7 Mar 2026, 00:33 6 Mar 2026, 00:38 5 Mar 2026, 18:41 5 Mar 2026, 06:22 5 Mar 2026, 00:34 4 Mar 2026, 18:18 4 Mar 2026, 06:20 3 Mar 2026, 18:20 3 Mar 2026, 00:35 27 Feb 2026, 18:15 24 Feb 2026, 06:27 24 Feb 2026, 00:33 23 Feb 2026, 18:27 21 Feb 2026, 00:33 20 Feb 2026, 12:16 19 Feb 2026, 20:53 19 Feb 2026, 20:37
Tue 3 00:35 Tue 3 18:20 Wed 4 06:20 Wed 4 18:18 Thu 5 00:34 Thu 5 06:22 Thu 5 18:41 Fri 6 00:38 Sat 7 00:33 Sat 7 06:14 Sat 7 18:10 Sun 8 00:35 Sun 8 18:10 Mon 9 00:34 Wed 11 00:31 Fri 13 00:34 Fri 13 18:15 Sat 14 00:32 Mon 16 12:23 Mon 16 18:25 Tue 17 00:33 Tue 17 18:24 Wed 18 00:36 Wed 18 12:23 Fri 20 00:35 Mon 23 18:22 Wed 25 18:24 Thu 26 18:27 Fri 27 00:39 Fri 27 18:23 Sat 28 00:36 Sat 28 06:26 Tue 31 00:39 Tue 31 06:35

agent-approvals-security.md +261 −0 added

Details

1# Agent approvals & security

2 

3Codex helps protect your code and data and reduces the risk of misuse.

4 

5This page covers how to operate Codex safely, including sandboxing, approvals,

6 and network access. If you are looking for Codex Security, the product for

7 scanning connected GitHub repositories, see [Codex Security](https://developers.openai.com/codex/security).

8 

9By default, the agent runs with network access turned off. Locally, Codex uses an OS-enforced sandbox that limits what it can touch (typically to the current workspace), plus an approval policy that controls when it must stop and ask you before acting.

10 

11For a high-level explanation of how sandboxing works across the Codex app, IDE

12extension, and CLI, see [Sandboxing](https://developers.openai.com/codex/concepts/sandboxing).

13For a broader enterprise security overview, see the [Codex security white paper](https://trust.openai.com/?itemUid=382f924d-54f3-43a8-a9df-c39e6c959958&source=click).

14 

15## Sandbox and approvals

16 

17Codex security controls come from two layers that work together:

18 

19- **Sandbox mode**: What Codex can do technically (for example, where it can write and whether it can reach the network) when it executes model-generated commands.

20- **Approval policy**: When Codex must ask you before it executes an action (for example, leaving the sandbox, using the network, or running commands outside a trusted set).

21 

22Codex uses different sandbox modes depending on where you run it:

23 

24- **Codex cloud**: Runs in isolated OpenAI-managed containers, preventing access to your host system or unrelated data. Uses a two-phase runtime model: setup runs before the agent phase and can access the network to install specified dependencies, then the agent phase runs offline by default unless you enable internet access for that environment. Secrets configured for cloud environments are available only during setup and are removed before the agent phase starts.

25- **Codex CLI / IDE extension**: OS-level mechanisms enforce sandbox policies. Defaults include no network access and write permissions limited to the active workspace. You can configure the sandbox, approval policy, and network settings based on your risk tolerance.

26 

27In the `Auto` preset (for example, `--full-auto`), Codex can read files, make edits, and run commands in the working directory automatically.

28 

29Codex asks for approval to edit files outside the workspace or to run commands that require network access. If you want to chat or plan without making changes, switch to `read-only` mode with the `/permissions` command.

30 

31Codex can also elicit approval for app (connector) tool calls that advertise side effects, even when the action isn't a shell command or file change. Destructive app/MCP tool calls always require approval when the tool advertises a destructive annotation, even if it also advertises other hints (for example, read-only hints).

32 

33## Network access [Elevated Risk](https://help.openai.com/articles/20001061)

34 

35For Codex cloud, see [agent internet access](https://developers.openai.com/codex/cloud/internet-access) to enable full internet access or a domain allow list.

36 

37For the Codex app, CLI, or IDE Extension, the default `workspace-write` sandbox mode keeps network access turned off unless you enable it in your configuration:

38 

39```toml

40[sandbox_workspace_write]

41network_access = true

42```

43 

44You can also control the [web search tool](https://platform.openai.com/docs/guides/tools-web-search) without granting full network access to spawned commands. Codex defaults to using a web search cache to access results. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you are using `--yolo` or another [full access sandbox setting](#common-sandbox-and-approval-combinations), web search defaults to live results. Use `--search` or set `web_search = "live"` to allow live browsing, or set it to `"disabled"` to turn the tool off:

45 

46```toml

47web_search = "cached" # default

48# web_search = "disabled"

49# web_search = "live" # same as --search

50```

51 

52Use caution when enabling network access or web search in Codex. Prompt injection can cause the agent to fetch and follow untrusted instructions.

53 

54## Defaults and recommendations

55 

56- On launch, Codex detects whether the folder is version-controlled and recommends:

57 - Version-controlled folders: `Auto` (workspace write + on-request approvals)

58 - Non-version-controlled folders: `read-only`

59- Depending on your setup, Codex may also start in `read-only` until you explicitly trust the working directory (for example, via an onboarding prompt or `/permissions`).

60- The workspace includes the current directory and temporary directories like `/tmp`. Use the `/status` command to see which directories are in the workspace.

61- To accept the defaults, run `codex`.

62- You can set these explicitly:

63 - `codex --sandbox workspace-write --ask-for-approval on-request`

64 - `codex --sandbox read-only --ask-for-approval on-request`

65 

66### Protected paths in writable roots

67 

68In the default `workspace-write` sandbox policy, writable roots still include protected paths:

69 

70- `<writable_root>/.git` is protected as read-only whether it appears as a directory or file.

71- If `<writable_root>/.git` is a pointer file (`gitdir: ...`), the resolved Git directory path is also protected as read-only.

72- `<writable_root>/.agents` is protected as read-only when it exists as a directory.

73- `<writable_root>/.codex` is protected as read-only when it exists as a directory.

74- Protection is recursive, so everything under those paths is read-only.

75 

76### Run without approval prompts

77 

78You can disable approval prompts with `--ask-for-approval never` or `-a never` (shorthand).

79 

80This option works with all `--sandbox` modes, so you still control Codex's level of autonomy. Codex makes a best effort within the constraints you set.

81 

82If you need Codex to read files, make edits, and run commands with network access without approval prompts, use `--sandbox danger-full-access` (or the `--dangerously-bypass-approvals-and-sandbox` flag). Use caution before doing so.

83 

84For a middle ground, `approval_policy = { granular = { ... } }` lets you keep specific approval prompt categories interactive while automatically rejecting others. The granular policy covers sandbox approvals, execpolicy-rule prompts, MCP elicitations, `request_permissions` prompts, and skill-script approvals.

85 

86### Common sandbox and approval combinations

87 

88| Intent | Flags | Effect |

89| ----------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |

90| Auto (preset) | *no flags needed* or `--full-auto` | Codex can read files, make edits, and run commands in the workspace. Codex requires approval to edit outside the workspace or to access network. |

91| Safe read-only browsing | `--sandbox read-only --ask-for-approval on-request` | Codex can read files and answer questions. Codex requires approval to make edits, run commands, or access network. |

92| Read-only non-interactive (CI) | `--sandbox read-only --ask-for-approval never` | Codex can only read files; never asks for approval. |

93| Automatically edit but ask for approval to run untrusted commands | `--sandbox workspace-write --ask-for-approval untrusted` | Codex can read and edit files but asks for approval before running untrusted commands. |

94| Dangerous full access | `--dangerously-bypass-approvals-and-sandbox` (alias: `--yolo`) | [Elevated Risk](https://help.openai.com/articles/20001061) No sandbox; no approvals *(not recommended)* |

95 

96`--full-auto` is a convenience alias for `--sandbox workspace-write --ask-for-approval on-request`.

97 

98With `--ask-for-approval untrusted`, Codex runs only known-safe read operations automatically. Commands that can mutate state or trigger external execution paths (for example, destructive Git operations or Git output/config-override flags) require approval.

99 

100#### Configuration in `config.toml`

101 

102For the broader configuration workflow, see [Config basics](https://developers.openai.com/codex/config-basic), [Advanced Config](https://developers.openai.com/codex/config-advanced#approval-policies-and-sandbox-modes), and the [Configuration Reference](https://developers.openai.com/codex/config-reference).

103 

104```toml

105# Always ask for approval mode

106approval_policy = "untrusted"

107sandbox_mode = "read-only"

108allow_login_shell = false # optional hardening: disallow login shells for shell-based tools

109 

110# Optional: Allow network in workspace-write mode

111[sandbox_workspace_write]

112network_access = true

113 

114# Optional: granular approval policy

115# approval_policy = { granular = {

116# sandbox_approval = true,

117# rules = true,

118# mcp_elicitations = true,

119# request_permissions = false,

120# skill_approval = false

121# } }

122```

123 

124You can also save presets as profiles, then select them with `codex --profile <name>`:

125 

126```toml

127[profiles.full_auto]

128approval_policy = "on-request"

129sandbox_mode = "workspace-write"

130 

131[profiles.readonly_quiet]

132approval_policy = "never"

133sandbox_mode = "read-only"

134```

135 

136### Test the sandbox locally

137 

138To see what happens when a command runs under the Codex sandbox, use these Codex CLI commands:

139 

140```bash

141# macOS

142codex sandbox macos [--full-auto] [--log-denials] [COMMAND]...

143# Linux

144codex sandbox linux [--full-auto] [COMMAND]...

145```

146 

147The `sandbox` command is also available as `codex debug`, and the platform helpers have aliases (for example `codex sandbox seatbelt` and `codex sandbox landlock`).

148 

149## OS-level sandbox

150 

151Codex enforces the sandbox differently depending on your OS:

152 

153- **macOS** uses Seatbelt policies and runs commands using `sandbox-exec` with a profile (`-p`) that corresponds to the `--sandbox` mode you selected. When restricted read access enables platform defaults, Codex appends a curated macOS platform policy (instead of broadly allowing `/System`) to preserve common tool compatibility.

154- **Linux** uses the bubblewrap pipeline plus `seccomp` by default. `use_legacy_landlock` is available when you need the older path. In managed proxy mode, the default bubblewrap pipeline routes egress through a proxy-only bridge and fails closed if it cannot build valid loopback proxy routes.

155- **Windows** uses the Linux sandbox implementation when running in [Windows Subsystem for Linux (WSL)](https://developers.openai.com/codex/windows#windows-subsystem-for-linux). When running natively on Windows, Codex uses a [Windows sandbox](https://developers.openai.com/codex/windows#windows-sandbox) implementation.

156 

157If you use the Codex IDE extension on Windows, it supports WSL directly. Set the following in your VS Code settings to keep the agent inside WSL whenever it’s available:

158 

159```json

160{

161 "chatgpt.runCodexInWindowsSubsystemForLinux": true

162}

163```

164 

165This ensures the IDE extension inherits Linux sandbox semantics for commands, approvals, and filesystem access even when the host OS is Windows. Learn more in the [Windows setup guide](https://developers.openai.com/codex/windows).

166 

167When running natively on Windows, configure the native sandbox mode in `config.toml`:

168 

169```toml

170[windows]

171sandbox = "unelevated" # or "elevated"

172# sandbox_private_desktop = true # default; set false only for compatibility

173```

174 

175See the [Windows setup guide](https://developers.openai.com/codex/windows#windows-sandbox) for details.

176 

177When you run Linux in a containerized environment such as Docker, the sandbox may not work if the host or container configuration doesn’t support the required `Landlock` and `seccomp` features.

178 

179In that case, configure your Docker container to provide the isolation you need, then run `codex` with `--sandbox danger-full-access` (or the `--dangerously-bypass-approvals-and-sandbox` flag) inside the container.

180 

181## Version control

182 

183Codex works best with a version control workflow:

184 

185- Work on a feature branch and keep `git status` clean before delegating. This keeps Codex patches easier to isolate and revert.

186- Prefer patch-based workflows (for example, `git diff`/`git apply`) over editing tracked files directly. Commit frequently so you can roll back in small increments.

187- Treat Codex suggestions like any other PR: run targeted verification, review diffs, and document decisions in commit messages for auditing.

188 

189## Monitoring and telemetry

190 

191Codex supports opt-in monitoring via OpenTelemetry (OTel) to help teams audit usage, investigate issues, and meet compliance requirements without weakening local security defaults. Telemetry is off by default; enable it explicitly in your configuration.

192 

193### Overview

194 

195- Codex turns off OTel export by default to keep local runs self-contained.

196- When enabled, Codex emits structured log events covering conversations, API requests, SSE/WebSocket stream activity, user prompts (redacted by default), tool approval decisions, and tool results.

197- Codex tags exported events with `service.name` (originator), CLI version, and an environment label to separate dev/staging/prod traffic.

198 

199### Enable OTel (opt-in)

200 

201Add an `[otel]` block to your Codex configuration (typically `~/.codex/config.toml`), choosing an exporter and whether to log prompt text.

202 

203```toml

204[otel]

205environment = "staging" # dev | staging | prod

206exporter = "none" # none | otlp-http | otlp-grpc

207log_user_prompt = false # redact prompt text unless policy allows

208```

209 

210- `exporter = "none"` leaves instrumentation active but doesn't send data anywhere.

211- To send events to your own collector, pick one of:

212 

213```toml

214[otel]

215exporter = { otlp-http = {

216 endpoint = "https://otel.example.com/v1/logs",

217 protocol = "binary",

218 headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }

219}}

220```

221 

222```toml

223[otel]

224exporter = { otlp-grpc = {

225 endpoint = "https://otel.example.com:4317",

226 headers = { "x-otlp-meta" = "abc123" }

227}}

228```

229 

230Codex batches events and flushes them on shutdown. Codex exports only telemetry produced by its OTel module.

231 

232### Event categories

233 

234Representative event types include:

235 

236- `codex.conversation_starts` (model, reasoning settings, sandbox/approval policy)

237- `codex.api_request` (attempt, status/success, duration, and error details)

238- `codex.sse_event` (stream event kind, success/failure, duration, plus token counts on `response.completed`)

239- `codex.websocket_request` and `codex.websocket_event` (request duration plus per-message kind/success/error)

240- `codex.user_prompt` (length; content redacted unless explicitly enabled)

241- `codex.tool_decision` (approved/denied, source: configuration vs. user)

242- `codex.tool_result` (duration, success, output snippet)

243 

244Associated OTel metrics (counter plus duration histogram pairs) include `codex.api_request`, `codex.sse_event`, `codex.websocket.request`, `codex.websocket.event`, and `codex.tool.call` (with corresponding `.duration_ms` instruments).

245 

246For the full event catalog and configuration reference, see the [Codex configuration documentation on GitHub](https://github.com/openai/codex/blob/main/docs/config.md#otel).

247 

248### Security and privacy guidance

249 

250- Keep `log_user_prompt = false` unless policy explicitly permits storing prompt contents. Prompts can include source code and sensitive data.

251- Route telemetry only to collectors you control; apply retention limits and access controls aligned with your compliance requirements.

252- Treat tool arguments and outputs as sensitive. Favor redaction at the collector or SIEM when possible.

253- Review local data retention settings (for example, `history.persistence` / `history.max_bytes`) if you don't want Codex to save session transcripts under `CODEX_HOME`. See [Advanced Config](https://developers.openai.com/codex/config-advanced#history-persistence) and [Configuration Reference](https://developers.openai.com/codex/config-reference).

254- If you run the CLI with network access turned off, OTel export can't reach your collector. To export, allow network access in `workspace-write` mode for the OTel endpoint, or export from Codex cloud with the collector domain on your approved list.

255- Review events periodically for approval/sandbox changes and unexpected tool executions.

256 

257OTel is optional and designed to complement, not replace, the sandbox and approval protections described above.

258 

259## Managed configuration

260 

261Enterprise admins can configure Codex security settings for their workspace in [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration). See that page for setup and policy details.

ambassadors.md +0 −56 deleted

File DeletedView Diff

1# Codex Ambassadors

2 

3Codex is rapidly becoming one of the most powerful ways to build,

4driven by builders who share real-world workflows and lessons with

5each other.

6 

7Codex Ambassadors are community organizers, open-source maintainers,

8student leaders, and power users who actively spread what works, make

9Codex easier to adopt in practice, and help shape where it goes next.

10 

11[Apply Today](https://openai.com/form/codex-ambassadors)

12 

13![Codex Ambassadors leading a community workshop](/images/codex/ambassadors/ambassadors-18.jpg) ![Builders collaborating during a Codex Ambassador event](/images/codex/ambassadors/ambassadors-25.jpg)

14 

15Ambassadors run hands-on meetups, workshops, and community sessions

16around the world.

17 

18## What you’ll do

19 

20As a Codex Ambassador, you’ll join a small global cohort and partner

21with OpenAI to:

22 

23- Run hands-on Codex events in your local community

24- Create reusable learning assets others can build on

25- Experiment with ideas to grow and support builder communities

26- Share candid, real-world feedback directly with the Codex team

27 

28## Who should apply

29 

30We’re looking for people with hands-on experience leading or

31supporting developer communities, like running meetups, maintaining

32open-source projects, teaching workshops, or regularly helping

33others learn how to build.

34 

35## Support from OpenAI

36 

37- Codex credits to support your own work and power local events

38- Ready-to-use starter kits you can tailor to your community

39- A direct line to fellow Ambassadors and the Codex team for

40 collaboration and feedback

41- Invitations to future exclusive events where you can meet the

42 Codex team

43- Exclusive swag and a honorarium for your time and contributions

44 

45This is a two-way program, and will also evolve our support based on

46what the cohort learns on the ground.

47 

48**Time commitment:** ~2–4 hours per week

49 

50## Bring your community with you

51 

52If you like bringing people together to build, learn, and share,

53and you're excited to help shape what a great ambassador program

54can be, we'd love to hear from you.

55 

56[Start your application](https://openai.com/form/codex-ambassadors)

app.md +5 −2

Details

4 4 

5ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. Learn more about [what's included](https://developers.openai.com/codex/pricing).5ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. Learn more about [what's included](https://developers.openai.com/codex/pricing).

6 6 

7![Codex app for Windows showing a project sidebar, active thread, and review pane](/images/codex/windows/codex-windows-light.webp)

8 

7![Codex app window with a project sidebar, active thread, and review pane](/images/codex/app/app-screenshot-light.webp)9![Codex app window with a project sidebar, active thread, and review pane](/images/codex/app/app-screenshot-light.webp)

8 10 

9## Getting started11## Getting started


12 14 

131. Download and install the Codex app151. Download and install the Codex app

14 16 

15 The Codex app is currently only available for macOS.17 Download the Codex app for Windows or macOS.

16 18 

17 [Download for macOS](https://persistent.oaistatic.com/codex-app-prod/Codex.dmg)19 [Download for macOS](https://persistent.oaistatic.com/codex-app-prod/Codex.dmg)

18 20 

19 [Get notified for Windows and Linux](https://openai.com/form/codex-app/)21 [Get notified for Linux](https://openai.com/form/codex-app/)

202. Open Codex and sign in222. Open Codex and sign in

21 23 

22 Once you downloaded and installed the Codex app, open it and sign in with your ChatGPT account or an OpenAI API key.24 Once you downloaded and installed the Codex app, open it and sign in with your ChatGPT account or an OpenAI API key.


39- Find and fix bugs in my codebase with minimal, high-confidence changes.41- Find and fix bugs in my codebase with minimal, high-confidence changes.

40 42 

41 If you need more inspiration, check out the [explore section](https://developers.openai.com/codex/explore).43 If you need more inspiration, check out the [explore section](https://developers.openai.com/codex/explore).

44 If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).

42 45 

43---46---

44 47 

app-server.md +298 −37

Details

21Requests include `method`, `params`, and `id`:21Requests include `method`, `params`, and `id`:

22 22 

23```json23```json

24{ "method": "thread/start", "id": 10, "params": { "model": "gpt-5.1-codex" } }24{ "method": "thread/start", "id": 10, "params": { "model": "gpt-5.4" } }

25```25```

26 26 

27Responses echo the `id` with either `result` or `error`:27Responses echo the `id` with either `result` or `error`:


99 },99 },

100});100});

101send({ method: "initialized", params: {} });101send({ method: "initialized", params: {} });

102send({ method: "thread/start", id: 1, params: { model: "gpt-5.1-codex" } });102send({ method: "thread/start", id: 1, params: { model: "gpt-5.4" } });

103```103```

104 104 

105## Core primitives105## Core primitives


116- **Start (or resume) a thread**: Call `thread/start` for a new conversation, `thread/resume` to continue an existing one, or `thread/fork` to branch history into a new thread id.116- **Start (or resume) a thread**: Call `thread/start` for a new conversation, `thread/resume` to continue an existing one, or `thread/fork` to branch history into a new thread id.

117- **Begin a turn**: Call `turn/start` with the target `threadId` and user input. Optional fields override model, personality, `cwd`, sandbox policy, and more.117- **Begin a turn**: Call `turn/start` with the target `threadId` and user input. Optional fields override model, personality, `cwd`, sandbox policy, and more.

118- **Steer an active turn**: Call `turn/steer` to append user input to the currently in-flight turn without creating a new turn.118- **Steer an active turn**: Call `turn/steer` to append user input to the currently in-flight turn without creating a new turn.

119- **Stream events**: After `turn/start`, keep reading notifications on stdout: `item/started`, `item/completed`, `item/agentMessage/delta`, tool progress, and other updates.119- **Stream events**: After `turn/start`, keep reading notifications on stdout: `thread/archived`, `thread/unarchived`, `item/started`, `item/completed`, `item/agentMessage/delta`, tool progress, and other updates.

120- **Finish the turn**: The server emits `turn/completed` with final status when the model finishes or after a `turn/interrupt` cancellation.120- **Finish the turn**: The server emits `turn/completed` with final status when the model finishes or after a `turn/interrupt` cancellation.

121 121 

122## Initialization122## Initialization

123 123 

124Clients must send a single `initialize` request per transport connection before invoking any other method on that connection, then acknowledge with an `initialized` notification. Requests sent before initialization receive a `Not initialized` error, and repeated `initialize` calls on the same connection return `Already initialized`.124Clients must send a single `initialize` request per transport connection before invoking any other method on that connection, then acknowledge with an `initialized` notification. Requests sent before initialization receive a `Not initialized` error, and repeated `initialize` calls on the same connection return `Already initialized`.

125 125 

126The server returns the user agent string it will present to upstream services. Set `clientInfo` to identify your integration.126The server returns the user agent string it will present to upstream services plus `platformFamily` and `platformOs` values that describe the runtime target. Set `clientInfo` to identify your integration.

127 127 

128`initialize.params.capabilities` also supports per-connection notification opt-out via `optOutNotificationMethods`, which is a list of exact method names to suppress for that connection. Matching is exact (no wildcards/prefixes). Unknown method names are accepted and ignored.128`initialize.params.capabilities` also supports per-connection notification opt-out via `optOutNotificationMethods`, which is a list of exact method names to suppress for that connection. Matching is exact (no wildcards/prefixes). Unknown method names are accepted and ignored.

129 129 


159 },159 },

160 "capabilities": {160 "capabilities": {

161 "experimentalApi": true,161 "experimentalApi": true,

162 "optOutNotificationMethods": [162 "optOutNotificationMethods": ["thread/started", "item/agentMessage/delta"]

163 "codex/event/session_configured",

164 "item/agentMessage/delta"

165 ]

166 }163 }

167 }164 }

168}165}


201- `thread/start` - create a new thread; emits `thread/started` and automatically subscribes you to turn/item events for that thread.198- `thread/start` - create a new thread; emits `thread/started` and automatically subscribes you to turn/item events for that thread.

202- `thread/resume` - reopen an existing thread by id so later `turn/start` calls append to it.199- `thread/resume` - reopen an existing thread by id so later `turn/start` calls append to it.

203- `thread/fork` - fork a thread into a new thread id by copying stored history; emits `thread/started` for the new thread.200- `thread/fork` - fork a thread into a new thread id by copying stored history; emits `thread/started` for the new thread.

204- `thread/read` - read a stored thread by id without resuming it; set `includeTurns` to return full turn history.201- `thread/read` - read a stored thread by id without resuming it; set `includeTurns` to return full turn history. Returned `thread` objects include runtime `status`.

205- `thread/list` - page through stored thread logs; supports cursor-based pagination plus `modelProviders`, `sourceKinds`, `archived`, and `cwd` filters.202- `thread/list` - page through stored thread logs; supports cursor-based pagination plus `modelProviders`, `sourceKinds`, `archived`, and `cwd` filters. Returned `thread` objects include runtime `status`.

206- `thread/loaded/list` - list the thread ids currently loaded in memory.203- `thread/loaded/list` - list the thread ids currently loaded in memory.

207- `thread/archive` - move a threads log file into the archived directory; returns `{}` on success.204- `thread/name/set` - set or update a thread's user-facing name for a loaded thread or a persisted rollout; emits `thread/name/updated`.

208- `thread/unarchive` - restore an archived thread rollout back into the active sessions directory; returns the restored `thread`.205- `thread/archive` - move a thread's log file into the archived directory; returns `{}` on success and emits `thread/archived`.

206- `thread/unsubscribe` - unsubscribe this connection from thread turn/item events. If this was the last subscriber, the server unloads the thread and emits `thread/closed`.

207- `thread/unarchive` - restore an archived thread rollout back into the active sessions directory; returns the restored `thread` and emits `thread/unarchived`.

208- `thread/status/changed` - notification emitted when a loaded thread's runtime `status` changes.

209- `thread/compact/start` - trigger conversation history compaction for a thread; returns `{}` immediately while progress streams via `turn/*` and `item/*` notifications.209- `thread/compact/start` - trigger conversation history compaction for a thread; returns `{}` immediately while progress streams via `turn/*` and `item/*` notifications.

210- `thread/rollback` - drop the last N turns from the in-memory context and persist a rollback marker; returns the updated `thread`.210- `thread/rollback` - drop the last N turns from the in-memory context and persist a rollback marker; returns the updated `thread`.

211- `turn/start` - add user input to a thread and begin Codex generation; responds with the initial `turn` and streams events. For `collaborationMode`, `settings.developer_instructions: null` means "use built-in instructions for the selected mode."211- `turn/start` - add user input to a thread and begin Codex generation; responds with the initial `turn` and streams events. For `collaborationMode`, `settings.developer_instructions: null` means "use built-in instructions for the selected mode."


213- `turn/interrupt` - request cancellation of an in-flight turn; success is `{}` and the turn ends with `status: "interrupted"`.213- `turn/interrupt` - request cancellation of an in-flight turn; success is `{}` and the turn ends with `status: "interrupted"`.

214- `review/start` - kick off the Codex reviewer for a thread; emits `enteredReviewMode` and `exitedReviewMode` items.214- `review/start` - kick off the Codex reviewer for a thread; emits `enteredReviewMode` and `exitedReviewMode` items.

215- `command/exec` - run a single command under the server sandbox without starting a thread/turn.215- `command/exec` - run a single command under the server sandbox without starting a thread/turn.

216- `command/exec/write` - write stdin bytes to a running `command/exec` session or close stdin.

217- `command/exec/resize` - resize a running PTY-backed `command/exec` session.

218- `command/exec/terminate` - terminate a running `command/exec` session.

216- `model/list` - list available models (set `includeHidden: true` to include entries with `hidden: true`) with effort options, optional `upgrade`, and `inputModalities`.219- `model/list` - list available models (set `includeHidden: true` to include entries with `hidden: true`) with effort options, optional `upgrade`, and `inputModalities`.

217- `experimentalFeature/list` - list feature flags with lifecycle stage metadata and cursor pagination.220- `experimentalFeature/list` - list feature flags with lifecycle stage metadata and cursor pagination.

218- `collaborationMode/list` - list collaboration mode presets (experimental, no pagination).221- `collaborationMode/list` - list collaboration mode presets (experimental, no pagination).

219- `skills/list` - list skills for one or more `cwd` values (supports `forceReload` and optional `perCwdExtraUserRoots`).222- `skills/list` - list skills for one or more `cwd` values (supports `forceReload` and optional `perCwdExtraUserRoots`).

223- `plugin/list` - list discovered plugin marketplaces and plugin state, including install/auth policy metadata.

224- `plugin/read` - read one plugin by marketplace path and plugin name, including bundled skills, apps, and MCP server names.

220- `app/list` - list available apps (connectors) with pagination plus accessibility/enabled metadata.225- `app/list` - list available apps (connectors) with pagination plus accessibility/enabled metadata.

221- `skills/config/write` - enable or disable skills by path.226- `skills/config/write` - enable or disable skills by path.

222- `mcpServer/oauth/login` - start an OAuth login for a configured MCP server; returns an authorization URL and emits `mcpServer/oauthLogin/completed` on completion.227- `mcpServer/oauth/login` - start an OAuth login for a configured MCP server; returns an authorization URL and emits `mcpServer/oauthLogin/completed` on completion.

223- `tool/requestUserInput` - prompt the user with 1-3 short questions for a tool call (experimental); questions can set `isOther` for a free-form option.228- `tool/requestUserInput` - prompt the user with 1-3 short questions for a tool call (experimental); questions can set `isOther` for a free-form option.

224- `config/mcpServer/reload` - reload MCP server configuration from disk and queue a refresh for loaded threads.229- `config/mcpServer/reload` - reload MCP server configuration from disk and queue a refresh for loaded threads.

225- `mcpServerStatus/list` - list MCP servers, tools, resources, and auth status (cursor + limit pagination).230- `mcpServerStatus/list` - list MCP servers, tools, resources, and auth status (cursor + limit pagination).

226- `feedback/upload` - submit a feedback report (classification + optional reason/logs + conversation id).231- `windowsSandbox/setupStart` - start Windows sandbox setup for `elevated` or `unelevated` mode; returns quickly and later emits `windowsSandbox/setupCompleted`.

232- `feedback/upload` - submit a feedback report (classification + optional reason/logs + conversation id, plus optional `extraLogFiles` attachments).

227- `config/read` - fetch the effective configuration on disk after resolving configuration layering.233- `config/read` - fetch the effective configuration on disk after resolving configuration layering.

234- `externalAgentConfig/detect` - detect migratable external-agent artifacts with `includeHome` and optional `cwds`; each detected item includes `cwd` (`null` for home).

235- `externalAgentConfig/import` - apply selected external-agent migration items by passing explicit `migrationItems` with `cwd` (`null` for home).

228- `config/value/write` - write a single configuration key/value to the user's `config.toml` on disk.236- `config/value/write` - write a single configuration key/value to the user's `config.toml` on disk.

229- `config/batchWrite` - apply configuration edits atomically to the user's `config.toml` on disk.237- `config/batchWrite` - apply configuration edits atomically to the user's `config.toml` on disk.

230- `configRequirements/read` - fetch requirements from `requirements.toml` and/or MDM, including allow-lists and residency requirements (or `null` if you havent set any up).238- `configRequirements/read` - fetch requirements from `requirements.toml` and/or MDM, including allow-lists, pinned `featureRequirements`, and residency/network requirements (or `null` if you haven't set any up).

239- `fs/readFile`, `fs/writeFile`, `fs/createDirectory`, `fs/getMetadata`, `fs/readDirectory`, `fs/remove`, and `fs/copy` - operate on absolute filesystem paths through the app-server v2 filesystem API.

231 240 

232## Models241## Models

233 242 


239{ "method": "model/list", "id": 6, "params": { "limit": 20, "includeHidden": false } }248{ "method": "model/list", "id": 6, "params": { "limit": 20, "includeHidden": false } }

240{ "id": 6, "result": {249{ "id": 6, "result": {

241 "data": [{250 "data": [{

242 "id": "gpt-5.2-codex",251 "id": "gpt-5.4",

243 "model": "gpt-5.2-codex",252 "model": "gpt-5.4",

244 "upgrade": "gpt-5.3-codex",253 "displayName": "GPT-5.4",

245 "displayName": "GPT-5.2 Codex",

246 "hidden": false,254 "hidden": false,

247 "defaultReasoningEffort": "medium",255 "defaultReasoningEffort": "medium",

248 "reasoningEffort": [{256 "supportedReasoningEfforts": [{

249 "effort": "low",257 "reasoningEffort": "low",

250 "description": "Lower latency"258 "description": "Lower latency"

251 }],259 }],

252 "inputModalities": ["text", "image"],260 "inputModalities": ["text", "image"],


259 267 

260Each model entry can include:268Each model entry can include:

261 269 

262- `reasoningEffort` - supported effort options for the model.270- `supportedReasoningEfforts` - supported effort options for the model.

263- `defaultReasoningEffort` - suggested default effort for clients.271- `defaultReasoningEffort` - suggested default effort for clients.

264- `upgrade` - optional recommended upgrade model id for migration prompts in clients.272- `upgrade` - optional recommended upgrade model id for migration prompts in clients.

273- `upgradeInfo` - optional upgrade metadata for migration prompts in clients.

265- `hidden` - whether the model is hidden from the default picker list.274- `hidden` - whether the model is hidden from the default picker list.

266- `inputModalities` - supported input types for the model (for example `text`, `image`).275- `inputModalities` - supported input types for the model (for example `text`, `image`).

267- `supportsPersonality` - whether the model supports personality-specific instructions such as `/personality`.276- `supportsPersonality` - whether the model supports personality-specific instructions such as `/personality`.


299- `thread/list` supports cursor pagination plus `modelProviders`, `sourceKinds`, `archived`, and `cwd` filtering.308- `thread/list` supports cursor pagination plus `modelProviders`, `sourceKinds`, `archived`, and `cwd` filtering.

300- `thread/loaded/list` returns the thread IDs currently in memory.309- `thread/loaded/list` returns the thread IDs currently in memory.

301- `thread/archive` moves the thread's persisted JSONL log into the archived directory.310- `thread/archive` moves the thread's persisted JSONL log into the archived directory.

311- `thread/unsubscribe` unsubscribes the current connection from a loaded thread and can trigger `thread/closed`.

302- `thread/unarchive` restores an archived thread rollout back into the active sessions directory.312- `thread/unarchive` restores an archived thread rollout back into the active sessions directory.

303- `thread/compact/start` triggers compaction and returns `{}` immediately.313- `thread/compact/start` triggers compaction and returns `{}` immediately.

304- `thread/rollback` drops the last N turns from the in-memory context and records a rollback marker in the thread's persisted JSONL log.314- `thread/rollback` drops the last N turns from the in-memory context and records a rollback marker in the thread's persisted JSONL log.


309 319 

310```json320```json

311{ "method": "thread/start", "id": 10, "params": {321{ "method": "thread/start", "id": 10, "params": {

312 "model": "gpt-5.1-codex",322 "model": "gpt-5.4",

313 "cwd": "/Users/me/project",323 "cwd": "/Users/me/project",

314 "approvalPolicy": "never",324 "approvalPolicy": "never",

315 "sandbox": "workspaceWrite",325 "sandbox": "workspaceWrite",

316 "personality": "friendly"326 "personality": "friendly",

327 "serviceName": "my_app_server_client"

317} }328} }

318{ "id": 10, "result": {329{ "id": 10, "result": {

319 "thread": {330 "thread": {

320 "id": "thr_123",331 "id": "thr_123",

321 "preview": "",332 "preview": "",

333 "ephemeral": false,

322 "modelProvider": "openai",334 "modelProvider": "openai",

323 "createdAt": 1730910000335 "createdAt": 1730910000

324 }336 }


326{ "method": "thread/started", "params": { "thread": { "id": "thr_123" } } }338{ "method": "thread/started", "params": { "thread": { "id": "thr_123" } } }

327```339```

328 340 

341`serviceName` is optional. Set it when you want app-server to tag thread-level metrics with your integration's service name.

342 

329To continue a stored session, call `thread/resume` with the `thread.id` you recorded earlier. The response shape matches `thread/start`. You can also pass the same configuration overrides supported by `thread/start`, such as `personality`:343To continue a stored session, call `thread/resume` with the `thread.id` you recorded earlier. The response shape matches `thread/start`. You can also pass the same configuration overrides supported by `thread/start`, such as `personality`:

330 344 

331```json345```json


333 "threadId": "thr_123",347 "threadId": "thr_123",

334 "personality": "friendly"348 "personality": "friendly"

335} }349} }

336{ "id": 11, "result": { "thread": { "id": "thr_123" } } }350{ "id": 11, "result": { "thread": { "id": "thr_123", "name": "Bug bash notes", "ephemeral": false } } }

337```351```

338 352 

339Resuming a thread doesn't update `thread.updatedAt` (or the rollout file's modified time) by itself. The timestamp updates when you start a turn.353Resuming a thread doesn't update `thread.updatedAt` (or the rollout file's modified time) by itself. The timestamp updates when you start a turn.


352{ "method": "thread/started", "params": { "thread": { "id": "thr_456" } } }366{ "method": "thread/started", "params": { "thread": { "id": "thr_456" } } }

353```367```

354 368 

369When a user-facing thread title has been set, app-server hydrates `thread.name` on `thread/list`, `thread/read`, `thread/resume`, `thread/unarchive`, and `thread/rollback` responses. `thread/start` and `thread/fork` may omit `name` (or return `null`) until a title is set later.

370 

355### Read a stored thread (without resuming)371### Read a stored thread (without resuming)

356 372 

357Use `thread/read` when you want stored thread data but don't want to resume the thread or subscribe to its events.373Use `thread/read` when you want stored thread data but don't want to resume the thread or subscribe to its events.

358 374 

359- `includeTurns` - when `true`, the response includes the thread's turns; when `false` or omitted, you get the thread summary only.375- `includeTurns` - when `true`, the response includes the thread's turns; when `false` or omitted, you get the thread summary only.

376- Returned `thread` objects include runtime `status` (`notLoaded`, `idle`, `systemError`, or `active` with `activeFlags`).

360 377 

361```json378```json

362{ "method": "thread/read", "id": 19, "params": { "threadId": "thr_123", "includeTurns": true } }379{ "method": "thread/read", "id": 19, "params": { "threadId": "thr_123", "includeTurns": true } }

363{ "id": 19, "result": { "thread": { "id": "thr_123", "turns": [] } } }380{ "id": 19, "result": { "thread": { "id": "thr_123", "name": "Bug bash notes", "ephemeral": false, "status": { "type": "notLoaded" }, "turns": [] } } }

364```381```

365 382 

366Unlike `thread/resume`, `thread/read` doesn't load the thread into memory or emit `thread/started`.383Unlike `thread/resume`, `thread/read` doesn't load the thread into memory or emit `thread/started`.


400} }417} }

401{ "id": 20, "result": {418{ "id": 20, "result": {

402 "data": [419 "data": [

403 { "id": "thr_a", "preview": "Create a TUI", "modelProvider": "openai", "createdAt": 1730831111, "updatedAt": 1730831111 },420 { "id": "thr_a", "preview": "Create a TUI", "ephemeral": false, "modelProvider": "openai", "createdAt": 1730831111, "updatedAt": 1730831111, "name": "TUI prototype", "status": { "type": "notLoaded" } },

404 { "id": "thr_b", "preview": "Fix tests", "modelProvider": "openai", "createdAt": 1730750000, "updatedAt": 1730750000 }421 { "id": "thr_b", "preview": "Fix tests", "ephemeral": true, "modelProvider": "openai", "createdAt": 1730750000, "updatedAt": 1730750000, "status": { "type": "notLoaded" } }

405 ],422 ],

406 "nextCursor": "opaque-token-or-null"423 "nextCursor": "opaque-token-or-null"

407} }424} }


409 426 

410When `nextCursor` is `null`, you have reached the final page.427When `nextCursor` is `null`, you have reached the final page.

411 428 

429### Track thread status changes

430 

431`thread/status/changed` is emitted whenever a loaded thread's runtime status changes. The payload includes `threadId` and the new `status`.

432 

433```json

434{

435 "method": "thread/status/changed",

436 "params": {

437 "threadId": "thr_123",

438 "status": { "type": "active", "activeFlags": ["waitingOnApproval"] }

439 }

440}

441```

442 

412### List loaded threads443### List loaded threads

413 444 

414`thread/loaded/list` returns thread IDs currently loaded in memory.445`thread/loaded/list` returns thread IDs currently loaded in memory.


418{ "id": 21, "result": { "data": ["thr_123", "thr_456"] } }449{ "id": 21, "result": { "data": ["thr_123", "thr_456"] } }

419```450```

420 451 

452### Unsubscribe from a loaded thread

453 

454`thread/unsubscribe` removes the current connection's subscription to a thread. The response status is one of:

455 

456- `unsubscribed` when the connection was subscribed and is now removed.

457- `notSubscribed` when the connection was not subscribed to that thread.

458- `notLoaded` when the thread is not loaded.

459 

460If this was the last subscriber, the server unloads the thread and emits a `thread/status/changed` transition to `notLoaded` plus `thread/closed`.

461 

462```json

463{ "method": "thread/unsubscribe", "id": 22, "params": { "threadId": "thr_123" } }

464{ "id": 22, "result": { "status": "unsubscribed" } }

465{ "method": "thread/status/changed", "params": {

466 "threadId": "thr_123",

467 "status": { "type": "notLoaded" }

468} }

469{ "method": "thread/closed", "params": { "threadId": "thr_123" } }

470```

471 

421### Archive a thread472### Archive a thread

422 473 

423Use `thread/archive` to move the persisted thread log (stored as a JSONL file on disk) into the archived sessions directory.474Use `thread/archive` to move the persisted thread log (stored as a JSONL file on disk) into the archived sessions directory.


425```json476```json

426{ "method": "thread/archive", "id": 22, "params": { "threadId": "thr_b" } }477{ "method": "thread/archive", "id": 22, "params": { "threadId": "thr_b" } }

427{ "id": 22, "result": {} }478{ "id": 22, "result": {} }

479{ "method": "thread/archived", "params": { "threadId": "thr_b" } }

428```480```

429 481 

430Archived threads won't appear in future calls to `thread/list` unless you pass `archived: true`.482Archived threads won't appear in future calls to `thread/list` unless you pass `archived: true`.


435 487 

436```json488```json

437{ "method": "thread/unarchive", "id": 24, "params": { "threadId": "thr_b" } }489{ "method": "thread/unarchive", "id": 24, "params": { "threadId": "thr_b" } }

438{ "id": 24, "result": { "thread": { "id": "thr_b" } } }490{ "id": 24, "result": { "thread": { "id": "thr_b", "name": "Bug bash notes" } } }

491{ "method": "thread/unarchived", "params": { "threadId": "thr_b" } }

439```492```

440 493 

441### Trigger thread compaction494### Trigger thread compaction


449{ "id": 25, "result": {} }502{ "id": 25, "result": {} }

450```503```

451 504 

505### Roll back recent turns

506 

507Use `thread/rollback` to remove the last `numTurns` entries from the in-memory context and persist a rollback marker in the rollout log. The returned `thread` includes `turns` populated after the rollback.

508 

509```json

510{ "method": "thread/rollback", "id": 26, "params": { "threadId": "thr_b", "numTurns": 1 } }

511{ "id": 26, "result": { "thread": { "id": "thr_b", "name": "Bug bash notes", "ephemeral": false } } }

512```

513 

452## Turns514## Turns

453 515 

454The `input` field accepts a list of items:516The `input` field accepts a list of items:


478}540}

479```541```

480 542 

543On macOS, `includePlatformDefaults: true` appends a curated platform-default Seatbelt policy for restricted-read sessions. This improves tool compatibility without broadly allowing all of `/System`.

544 

481Examples:545Examples:

482 546 

483```json547```json


510 "writableRoots": ["/Users/me/project"],574 "writableRoots": ["/Users/me/project"],

511 "networkAccess": true575 "networkAccess": true

512 },576 },

513 "model": "gpt-5.1-codex",577 "model": "gpt-5.4",

514 "effort": "medium",578 "effort": "medium",

515 "summary": "concise",579 "summary": "concise",

516 "personality": "friendly",580 "personality": "friendly",


653- The server rejects empty `command` arrays.717- The server rejects empty `command` arrays.

654- `sandboxPolicy` accepts the same shape used by `turn/start` (for example, `dangerFullAccess`, `readOnly`, `workspaceWrite`, `externalSandbox`).718- `sandboxPolicy` accepts the same shape used by `turn/start` (for example, `dangerFullAccess`, `readOnly`, `workspaceWrite`, `externalSandbox`).

655- When omitted, `timeoutMs` falls back to the server default.719- When omitted, `timeoutMs` falls back to the server default.

720- Set `tty: true` for PTY-backed sessions, and use `processId` when you plan to follow up with `command/exec/write`, `command/exec/resize`, or `command/exec/terminate`.

721- Set `streamStdoutStderr: true` to receive `command/exec/outputDelta` notifications while the command is running.

722 

723### Read admin requirements (`configRequirements/read`)

724 

725Use `configRequirements/read` to inspect the effective admin requirements loaded from `requirements.toml` and/or MDM.

726 

727```json

728{ "method": "configRequirements/read", "id": 52, "params": {} }

729{ "id": 52, "result": {

730 "requirements": {

731 "allowedApprovalPolicies": ["onRequest", "unlessTrusted"],

732 "allowedSandboxModes": ["readOnly", "workspaceWrite"],

733 "featureRequirements": {

734 "personality": true,

735 "unified_exec": false

736 },

737 "network": {

738 "enabled": true,

739 "allowedDomains": ["api.openai.com"],

740 "allowUnixSockets": ["/tmp/example.sock"],

741 "dangerouslyAllowAllUnixSockets": false

742 }

743 }

744} }

745```

746 

747`result.requirements` is `null` when no requirements are configured. See the docs on [`requirements.toml`](https://developers.openai.com/codex/config-reference#requirementstoml) for details on supported keys and values.

748 

749### Windows sandbox setup (`windowsSandbox/setupStart`)

750 

751Custom Windows clients can trigger sandbox setup asynchronously instead of blocking on startup checks.

752 

753```json

754{ "method": "windowsSandbox/setupStart", "id": 53, "params": { "mode": "elevated" } }

755{ "id": 53, "result": { "started": true } }

756```

757 

758App-server starts setup in the background and later emits a completion notification:

759 

760```json

761{

762 "method": "windowsSandbox/setupCompleted",

763 "params": { "mode": "elevated", "success": true, "error": null }

764}

765```

766 

767Modes:

768 

769- `elevated` - run the elevated Windows sandbox setup path.

770- `unelevated` - run the legacy setup/preflight path.

656 771 

657## Events772## Events

658 773 

659Event notifications are the server-initiated stream for thread lifecycles, turn lifecycles, and the items within them. After you start or resume a thread, keep reading the active transport stream for `thread/started`, `turn/*`, and `item/*` notifications.774Event notifications are the server-initiated stream for thread lifecycles, turn lifecycles, and the items within them. After you start or resume a thread, keep reading the active transport stream for `thread/started`, `thread/archived`, `thread/unarchived`, `thread/closed`, `thread/status/changed`, `turn/*`, `item/*`, and `serverRequest/resolved` notifications.

660 775 

661### Notification opt-out776### Notification opt-out

662 777 


664 779 

665- Exact-match only: `item/agentMessage/delta` suppresses only that method.780- Exact-match only: `item/agentMessage/delta` suppresses only that method.

666- Unknown method names are ignored.781- Unknown method names are ignored.

667- Applies to both legacy (`codex/event/*`) and v2 (`thread/*`, `turn/*`, `item/*`, etc.) notifications.782- Applies to the current `thread/*`, `turn/*`, `item/*`, and related v2 notifications.

668- Doesn't apply to requests, responses, or errors.783- Doesn't apply to requests, responses, or errors.

669 784 

670### Fuzzy file search events (experimental)785### Fuzzy file search events (experimental)


674- `fuzzyFileSearch/sessionUpdated` - `{ sessionId, query, files }` with the current matches for the active query.789- `fuzzyFileSearch/sessionUpdated` - `{ sessionId, query, files }` with the current matches for the active query.

675- `fuzzyFileSearch/sessionCompleted` - `{ sessionId }` once indexing and matching for that query completes.790- `fuzzyFileSearch/sessionCompleted` - `{ sessionId }` once indexing and matching for that query completes.

676 791 

792### Windows sandbox setup events

793 

794- `windowsSandbox/setupCompleted` - `{ mode, success, error }` emitted after a `windowsSandbox/setupStart` request finishes.

795 

677### Turn events796### Turn events

678 797 

679- `turn/started` - `{ turn }` with the turn id, empty `items`, and `status: "inProgress"`.798- `turn/started` - `{ turn }` with the turn id, empty `items`, and `status: "inProgress"`.


689`ThreadItem` is the tagged union carried in turn responses and `item/*` notifications. Common item types include:808`ThreadItem` is the tagged union carried in turn responses and `item/*` notifications. Common item types include:

690 809 

691- `userMessage` - `{id, content}` where `content` is a list of user inputs (`text`, `image`, or `localImage`).810- `userMessage` - `{id, content}` where `content` is a list of user inputs (`text`, `image`, or `localImage`).

692- `agentMessage` - `{id, text}` containing the accumulated agent reply.811- `agentMessage` - `{id, text, phase?}` containing the accumulated agent reply. When present, `phase` uses Responses API wire values (`commentary`, `final_answer`).

693- `plan` - `{id, text}` containing proposed plan text in plan mode. Treat the final `plan` item from `item/completed` as authoritative.812- `plan` - `{id, text}` containing proposed plan text in plan mode. Treat the final `plan` item from `item/completed` as authoritative.

694- `reasoning` - `{id, summary, content}` where `summary` holds streamed reasoning summaries and `content` holds raw reasoning blocks.813- `reasoning` - `{id, summary, content}` where `summary` holds streamed reasoning summaries and `content` holds raw reasoning blocks.

695- `commandExecution` - `{id, command, cwd, status, commandActions, aggregatedOutput?, exitCode?, durationMs?}`.814- `commandExecution` - `{id, command, cwd, status, commandActions, aggregatedOutput?, exitCode?, durationMs?}`.

696- `fileChange` - `{id, changes, status}` describing proposed edits; `changes` list `{path, kind, diff}`.815- `fileChange` - `{id, changes, status}` describing proposed edits; `changes` list `{path, kind, diff}`.

697- `mcpToolCall` - `{id, server, tool, status, arguments, result?, error?}`.816- `mcpToolCall` - `{id, server, tool, status, arguments, result?, error?}`.

817- `dynamicToolCall` - `{id, tool, arguments, status, contentItems?, success?, durationMs?}` for client-executed dynamic tool invocations.

698- `collabToolCall` - `{id, tool, status, senderThreadId, receiverThreadId?, newThreadId?, prompt?, agentStatus?}`.818- `collabToolCall` - `{id, tool, status, senderThreadId, receiverThreadId?, newThreadId?, prompt?, agentStatus?}`.

699- `webSearch` - `{id, query, action?}` for web search requests issued by the agent.819- `webSearch` - `{id, query, action?}` for web search requests issued by the agent.

700- `imageView` - `{id, path}` emitted when the agent invokes the image viewer tool.820- `imageView` - `{id, path}` emitted when the agent invokes the image viewer tool.


751Order of messages:871Order of messages:

752 872 

7531. `item/started` shows the pending `commandExecution` item with `command`, `cwd`, and other fields.8731. `item/started` shows the pending `commandExecution` item with `command`, `cwd`, and other fields.

7542. `item/commandExecution/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, optional `command`, optional `cwd`, optional `commandActions`, and optional `proposedExecpolicyAmendment`.8742. `item/commandExecution/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, optional `command`, optional `cwd`, optional `commandActions`, optional `proposedExecpolicyAmendment`, optional `networkApprovalContext`, and optional `availableDecisions`. When `initialize.params.capabilities.experimentalApi = true`, the payload can also include experimental `additionalPermissions` describing requested per-command sandbox access. Any filesystem paths inside `additionalPermissions` are absolute on the wire.

7553. Client responds with one of the command execution approval decisions above.8753. Client responds with one of the command execution approval decisions above.

7564. `item/completed` returns the final `commandExecution` item with `status: completed | failed | declined`.8764. `serverRequest/resolved` confirms that the pending request has been answered or cleared.

8775. `item/completed` returns the final `commandExecution` item with `status: completed | failed | declined`.

878 

879When `networkApprovalContext` is present, the prompt is for managed network access (not a general shell-command approval). The current v2 schema exposes the target `host` and `protocol`; clients should render a network-specific prompt and not rely on `command` being a user-meaningful shell command preview.

880 

881Codex groups concurrent network approval prompts by destination (`host`, protocol, and port). The app-server may therefore send one prompt that unblocks multiple queued requests to the same destination, while different ports on the same host are treated separately.

757 882 

758### File change approvals883### File change approvals

759 884 


7621. `item/started` emits a `fileChange` item with proposed `changes` and `status: "inProgress"`.8871. `item/started` emits a `fileChange` item with proposed `changes` and `status: "inProgress"`.

7632. `item/fileChange/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, and optional `grantRoot`.8882. `item/fileChange/requestApproval` includes `itemId`, `threadId`, `turnId`, optional `reason`, and optional `grantRoot`.

7643. Client responds with one of the file change approval decisions above.8893. Client responds with one of the file change approval decisions above.

7654. `item/completed` returns the final `fileChange` item with `status: completed | failed | declined`.8904. `serverRequest/resolved` confirms that the pending request has been answered or cleared.

8915. `item/completed` returns the final `fileChange` item with `status: completed | failed | declined`.

892 

893### `tool/requestUserInput`

894 

895When the client responds to `item/tool/requestUserInput`, app-server emits `serverRequest/resolved` with `{ threadId, requestId }`. If the pending request is cleared by turn start, turn completion, or turn interruption before the client answers, the server emits the same notification for that cleanup.

896 

897### Dynamic tool calls (experimental)

898 

899`dynamicTools` on `thread/start` and the corresponding `item/tool/call` request or response flow are experimental APIs.

900 

901When a dynamic tool is invoked during a turn, app-server emits:

902 

9031. `item/started` with `item.type = "dynamicToolCall"`, `status = "inProgress"`, plus `tool` and `arguments`.

9042. `item/tool/call` as a server request to the client.

9053. The client response payload with returned content items.

9064. `item/completed` with `item.type = "dynamicToolCall"`, the final `status`, and any returned `contentItems` or `success` value.

766 907 

767### MCP tool-call approvals (apps)908### MCP tool-call approvals (apps)

768 909 

769App (connector) tool calls can also require approval. When an app tool call has side effects, the server may elicit approval with `tool/requestUserInput` and options such as **Accept**, **Decline**, and **Cancel**. If the user declines or cancels, the related `mcpToolCall` item completes with an error instead of running the tool.910App (connector) tool calls can also require approval. When an app tool call has side effects, the server may elicit approval with `tool/requestUserInput` and options such as **Accept**, **Decline**, and **Cancel**. Destructive tool annotations always trigger approval even when the tool also advertises less-privileged hints. If the user declines or cancels, the related `mcpToolCall` item completes with an error instead of running the tool.

770 911 

771## Skills912## Skills

772 913 


863 1004 

864## Apps (connectors)1005## Apps (connectors)

865 1006 

866Use `app/list` to fetch available apps. In the CLI/TUI, `/apps` is the user-facing picker; in custom clients, call `app/list` directly. Each entry includes both `isAccessible` (available to the user) and `isEnabled` (enabled in `config.toml`) so clients can distinguish install/access from local enabled state.1007Use `app/list` to fetch available apps. In the CLI/TUI, `/apps` is the user-facing picker; in custom clients, call `app/list` directly. Each entry includes both `isAccessible` (available to the user) and `isEnabled` (enabled in `config.toml`) so clients can distinguish install/access from local enabled state. App entries can also include optional `branding`, `appMetadata`, and `labels` fields.

867 1008 

868```json1009```json

869{ "method": "app/list", "id": 50, "params": {1010{ "method": "app/list", "id": 50, "params": {


879 "name": "Demo App",1020 "name": "Demo App",

880 "description": "Example connector for documentation.",1021 "description": "Example connector for documentation.",

881 "logoUrl": "https://example.com/demo-app.png",1022 "logoUrl": "https://example.com/demo-app.png",

1023 "logoUrlDark": null,

1024 "distributionChannel": null,

1025 "branding": null,

1026 "appMetadata": null,

1027 "labels": null,

882 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",1028 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",

883 "isAccessible": true,1029 "isAccessible": true,

884 "isEnabled": true1030 "isEnabled": true


904 "name": "Demo App",1050 "name": "Demo App",

905 "description": "Example connector for documentation.",1051 "description": "Example connector for documentation.",

906 "logoUrl": "https://example.com/demo-app.png",1052 "logoUrl": "https://example.com/demo-app.png",

1053 "logoUrlDark": null,

1054 "distributionChannel": null,

1055 "branding": null,

1056 "appMetadata": null,

1057 "labels": null,

907 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",1058 "installUrl": "https://chatgpt.com/apps/demo-app/demo-app",

908 "isAccessible": true,1059 "isAccessible": true,

909 "isEnabled": true1060 "isEnabled": true


936}1087}

937```1088```

938 1089 

1090### Config RPC examples for app settings

1091 

1092Use `config/read`, `config/value/write`, and `config/batchWrite` to inspect or update app controls in `config.toml`.

1093 

1094Read the effective app config shape (including `_default` and per-tool overrides):

1095 

1096```json

1097{ "method": "config/read", "id": 60, "params": { "includeLayers": false } }

1098{ "id": 60, "result": {

1099 "config": {

1100 "apps": {

1101 "_default": {

1102 "enabled": true,

1103 "destructive_enabled": true,

1104 "open_world_enabled": true

1105 },

1106 "google_drive": {

1107 "enabled": true,

1108 "destructive_enabled": false,

1109 "default_tools_approval_mode": "prompt",

1110 "tools": {

1111 "files/delete": { "enabled": false, "approval_mode": "approve" }

1112 }

1113 }

1114 }

1115 }

1116} }

1117```

1118 

1119Update a single app setting:

1120 

1121```json

1122{

1123 "method": "config/value/write",

1124 "id": 61,

1125 "params": {

1126 "keyPath": "apps.google_drive.default_tools_approval_mode",

1127 "value": "prompt",

1128 "mergeStrategy": "replace"

1129 }

1130}

1131```

1132 

1133Apply multiple app edits atomically:

1134 

1135```json

1136{

1137 "method": "config/batchWrite",

1138 "id": 62,

1139 "params": {

1140 "edits": [

1141 {

1142 "keyPath": "apps._default.destructive_enabled",

1143 "value": false,

1144 "mergeStrategy": "upsert"

1145 },

1146 {

1147 "keyPath": "apps.google_drive.tools.files/delete.approval_mode",

1148 "value": "approve",

1149 "mergeStrategy": "upsert"

1150 }

1151 ]

1152 }

1153}

1154```

1155 

1156### Detect and import external agent config

1157 

1158Use `externalAgentConfig/detect` to discover migratable external-agent artifacts, then pass the selected entries to `externalAgentConfig/import`.

1159 

1160Detection example:

1161 

1162```json

1163{ "method": "externalAgentConfig/detect", "id": 63, "params": {

1164 "includeHome": true,

1165 "cwds": ["/Users/me/project"]

1166} }

1167{ "id": 63, "result": {

1168 "items": [

1169 {

1170 "itemType": "AGENTS_MD",

1171 "description": "Import /Users/me/project/CLAUDE.md to /Users/me/project/AGENTS.md.",

1172 "cwd": "/Users/me/project"

1173 },

1174 {

1175 "itemType": "SKILLS",

1176 "description": "Copy skill folders from /Users/me/.claude/skills to /Users/me/.agents/skills.",

1177 "cwd": null

1178 }

1179 ]

1180} }

1181```

1182 

1183Import example:

1184 

1185```json

1186{ "method": "externalAgentConfig/import", "id": 64, "params": {

1187 "migrationItems": [

1188 {

1189 "itemType": "AGENTS_MD",

1190 "description": "Import /Users/me/project/CLAUDE.md to /Users/me/project/AGENTS.md.",

1191 "cwd": "/Users/me/project"

1192 }

1193 ]

1194} }

1195{ "id": 64, "result": {} }

1196```

1197 

1198Supported `itemType` values are `AGENTS_MD`, `CONFIG`, `SKILLS`, and `MCP_SERVER_CONFIG`. Detection returns only items that still have work to do. For example, AGENTS migration is skipped when `AGENTS.md` already exists and is non-empty, and skill imports do not overwrite existing skill directories.

1199 

939## Auth endpoints1200## Auth endpoints

940 1201 

941The JSON-RPC auth/account surface exposes request/response methods plus server-initiated notifications (no `id`). Use these to determine auth state, start or cancel logins, logout, and inspect ChatGPT rate limits.1202The JSON-RPC auth/account surface exposes request/response methods plus server-initiated notifications (no `id`). Use these to determine auth state, start or cancel logins, logout, and inspect ChatGPT rate limits.

app/automations.md +24 −13

Details

2 2 

3Automate recurring tasks in the background. Codex adds findings to the inbox, or automatically archives the task if there's nothing to report. You can combine automations with [skills](https://developers.openai.com/codex/skills) for more complex tasks.3Automate recurring tasks in the background. Codex adds findings to the inbox, or automatically archives the task if there's nothing to report. You can combine automations with [skills](https://developers.openai.com/codex/skills) for more complex tasks.

4 4 

5Automations run locally in the Codex app. The app needs to be running, and the5Automations run in the background in the Codex app. The app needs to be

6selected project needs to be available on disk.6running, and the selected project needs to be available on disk.

7 7 

8In Git repositories, each automation run starts in a new8In Git repositories, you can choose whether an automation runs in your local

9[worktree](https://developers.openai.com/codex/app/worktrees) so it doesn’t interfere with your main9project or on a new [worktree](https://developers.openai.com/codex/app/worktrees). Both options run in the

10checkout. In non-version-controlled projects, automations run directly in the10background. Worktrees keep automation changes separate from unfinished local

11work, while running in your local project can modify files you are still

12working on. In non-version-controlled projects, automations run directly in the

11project directory.13project directory.

12 14 

13![Automation creation form with schedule and prompt fields](/images/codex/app/create-automation-light.webp)15You can also leave the model and reasoning effort on their default settings, or

16choose them explicitly if you want more control over how the automation runs.

17 

18![Automation creation form with schedule and prompt fields](/images/codex/app/codex-automations-light.webp)

14 19 

15## Managing tasks20## Managing tasks

16 21 


18 23 

19The "Triage" section acts as your inbox. Automation runs with findings show up there, and you can filter your inbox to show all automation runs or only unread ones.24The "Triage" section acts as your inbox. Automation runs with findings show up there, and you can filter your inbox to show all automation runs or only unread ones.

20 25 

21When an automation runs in a Git repository, Codex uses a dedicated background [worktree](https://developers.openai.com/codex/app/features#worktree-support). In non-version-controlled projects, automations run directly in the project directory. Consider using Git to enable running on background worktrees. You can have the same automation run on multiple projects.26For Git repositories, each automation can run either in your local project or

27on a dedicated background [worktree](https://developers.openai.com/codex/app/features#worktree-support). Use

28worktrees when you want to isolate automation changes from unfinished local

29work. Use local mode when you want the automation to work directly in your main

30checkout, keeping in mind that it can modify files you are actively editing.

31In non-version-controlled projects, automations run directly in the project

32directory. You can have the same automation run on multiple projects.

22 33 

23Automations use your default sandbox settings. In read-only mode, tool calls fail if they require modifying files, network access, or working with apps on your computer. With full access enabled, background automations carry elevated risk. You can adjust sandbox settings in [Settings](https://developers.openai.com/codex/app/settings) and selectively allowlist commands with [rules](https://developers.openai.com/codex/rules).34Automations use your default sandbox settings. In read-only mode, tool calls fail if they require modifying files, network access, or working with apps on your computer. With full access enabled, background automations carry elevated risk. You can adjust sandbox settings in [Settings](https://developers.openai.com/codex/app/settings) and selectively allowlist commands with [rules](https://developers.openai.com/codex/rules).

24 35 


30first. This helps you confirm:41first. This helps you confirm:

31 42 

32- The prompt is clear and scoped correctly.43- The prompt is clear and scoped correctly.

33- The selected model and tools behave as expected.44- The selected or default model, reasoning effort, and tools behave as expected.

34- The resulting diff is reviewable.45- The resulting diff is reviewable.

35 46 

36When you start scheduling runs, review the first few outputs closely and adjust47When you start scheduling runs, review the first few outputs closely and adjust


38 49 

39## Worktree cleanup for automations50## Worktree cleanup for automations

40 51 

41For Git repositories, automations run in worktrees. Frequent schedules can52If you choose worktrees for Git repositories, frequent schedules can create

42create many worktrees over time. Archive automation runs you no longer need,53many worktrees over time. Archive automation runs you no longer need, and avoid

43and avoid pinning runs unless you intend to keep their worktrees.54pinning runs unless you intend to keep their worktrees.

44 55 

45## Permissions and security model56## Permissions and security model

46 57 


62 73 

63If you are in a managed environment, admins can restrict these behaviors using74If you are in a managed environment, admins can restrict these behaviors using

64admin-enforced requirements. For example, they can disallow `approval_policy = "never"` or constrain allowed sandbox modes. See75admin-enforced requirements. For example, they can disallow `approval_policy = "never"` or constrain allowed sandbox modes. See

65[Admin-enforced requirements (`requirements.toml`)](https://developers.openai.com/codex/security#admin-enforced-requirements-requirementstoml).76[Admin-enforced requirements (`requirements.toml`)](https://developers.openai.com/codex/enterprise/managed-configuration#admin-enforced-requirements-requirementstoml).

66 77 

67Automations use `approval_policy = "never"` when your organization policy78Automations use `approval_policy = "never"` when your organization policy

68allows it. If `approval_policy = "never"` is disallowed by admin requirements,79allows it. If `approval_policy = "never"` is disallowed by admin requirements,

app/commands.md +18 −0

Details

48| `/review` | Start code review mode to review uncommitted changes or compare against a base branch. |48| `/review` | Start code review mode to review uncommitted changes or compare against a base branch. |

49| `/status` | Show the thread ID, context usage, and rate limits. |49| `/status` | Show the thread ID, context usage, and rate limits. |

50 50 

51## Deeplinks

52 

53The Codex app registers the `codex://` URL scheme so links can open specific parts of the app directly.

54 

55| Deeplink | Opens | Supported query parameters |

56| --- | --- | --- |

57| `codex://settings` | Settings. | None. |

58| `codex://skills` | Skills. | None. |

59| `codex://automations` | Inbox in automation create mode. | None. |

60| `codex://threads/<thread-id>` | A local thread. `<thread-id>` must be a UUID. | None. |

61| `codex://new` | A new thread. | Optional: `prompt`, `originUrl`, `path`. |

62 

63For new-thread deeplinks:

64 

65- `prompt` prefills the composer.

66- `path` must be an absolute path to a local directory and, when valid, makes that directory the active workspace for the new thread.

67- `originUrl` tries to match one of your current workspace roots by Git remote URL. If both `path` and `originUrl` are present, Codex resolves `path` first.

68 

51## See also69## See also

52 70 

53- [Features](https://developers.openai.com/codex/app/features)71- [Features](https://developers.openai.com/codex/app/features)

app/features.md +18 −4

Details

14session in a specific directory.14session in a specific directory.

15 15 

16If you work in a single repository with two or more apps or packages, split16If you work in a single repository with two or more apps or packages, split

17distinct projects into separate app projects so the [sandbox](https://developers.openai.com/codex/security)17distinct projects into separate app projects so the [sandbox](https://developers.openai.com/codex/agent-approvals-security)

18only includes the files for that project.18only includes the files for that project.

19 19 

20![Codex app showing multiple projects in the sidebar and threads in the main pane](/images/codex/app/multitask-light.webp)20![Codex app showing multiple projects in the sidebar and threads in the main pane](/images/codex/app/multitask-light.webp)


85pressing <kbd>Cmd</kbd>+<kbd>J</kbd>.85pressing <kbd>Cmd</kbd>+<kbd>J</kbd>.

86 86 

87Use the terminal to validate changes, run scripts, and perform Git operations87Use the terminal to validate changes, run scripts, and perform Git operations

88without leaving the app.88without leaving the app. Codex can also read the current terminal output, so

89it can check the status of a running development server or refer back to a

90failed build while it works with you.

89 91 

90Common tasks include:92Common tasks include:

91 93 


101 103 

102![Integrated terminal drawer open beneath a Codex thread](/images/codex/app/integrated-terminal-light.webp)104![Integrated terminal drawer open beneath a Codex thread](/images/codex/app/integrated-terminal-light.webp)

103 105 

106## Native Windows sandbox

107 

108On Windows, Codex can run natively in PowerShell with a native Windows sandbox

109instead of requiring WSL or a virtual machine. This lets you stay in

110Windows-native workflows while keeping bounded permissions in place.

111 

112[Learn more about Windows setup and sandboxing](https://developers.openai.com/codex/app/windows).

113 

114![Codex app Windows sandbox setup prompt above the message composer](/images/codex/windows/windows-sandbox-setup.webp)

115 

104## Voice dictation116## Voice dictation

105 117 

106Use your voice to prompt Codex. Hold <kbd>Ctrl</kbd>+<kbd>M</kbd> while the composer is visible and start talking. Your voice will be transcribed. Edit the transcribed prompt or hit send to have Codex start work.118Use your voice to prompt Codex. Hold <kbd>Ctrl</kbd>+<kbd>M</kbd> while the composer is visible and start talking. Your voice will be transcribed. Edit the transcribed prompt or hit send to have Codex start work.


152opening separate projects or using worktrees rather than asking Codex to roam164opening separate projects or using worktrees rather than asking Codex to roam

153outside the project root.165outside the project root.

154 166 

155For details on how Codex handles sandboxing, check out the [security documentation](https://developers.openai.com/codex/security).167For a high-level overview, see [Sandboxing](https://developers.openai.com/codex/concepts/sandboxing). For

168configuration details, see the

169[agent approvals & security documentation](https://developers.openai.com/codex/agent-approvals-security).

156 170 

157## MCP support171## MCP support

158 172 


165 179 

166Codex ships with a first-party web search tool. For local tasks in the Codex IDE Extension, Codex180Codex ships with a first-party web search tool. For local tasks in the Codex IDE Extension, Codex

167enables web search by default and serves results from a web search cache. If you configure your181enables web search by default and serves results from a web search cache. If you configure your

168sandbox for [full access](https://developers.openai.com/codex/security), web search defaults to live results. See182sandbox for [full access](https://developers.openai.com/codex/agent-approvals-security), web search defaults to live results. See

169[Config basics](https://developers.openai.com/codex/config-basic) to disable web search or switch to live results that fetch the183[Config basics](https://developers.openai.com/codex/config-basic) to disable web search or switch to live results that fetch the

170most recent data.184most recent data.

171 185 

app/settings.md +9 −6

Details

10require <kbd>Cmd</kbd>+<kbd>Enter</kbd> for multiline prompts or prevent sleep while a10require <kbd>Cmd</kbd>+<kbd>Enter</kbd> for multiline prompts or prevent sleep while a

11thread runs.11thread runs.

12 12 

13## Appearance

14 

15Pick a theme, decide whether the window is solid, and adjust UI or code fonts. Font

16choices apply across the app, including the diff review panel and terminal.

17 

18## Notifications13## Notifications

19 14 

20Choose when turn completion notifications appear, and whether the app should prompt for15Choose when turn completion notifications appear, and whether the app should prompt for


24 19 

25Codex agents in the app inherit the same configuration as the IDE and CLI extension.20Codex agents in the app inherit the same configuration as the IDE and CLI extension.

26Use the in-app controls for common settings, or edit `config.toml` for advanced21Use the in-app controls for common settings, or edit `config.toml` for advanced

27options. See [Codex security](https://developers.openai.com/codex/security) and22options. See [Codex security](https://developers.openai.com/codex/agent-approvals-security) and

28[config basics](https://developers.openai.com/codex/config-basic) for more detail.23[config basics](https://developers.openai.com/codex/config-basic) for more detail.

29 24 

25## Appearance

26 

27In **Settings**, you can change the Codex app appearance by choosing a base theme,

28adjusting accent, background, and foreground colors, and changing the UI and code

29fonts. You can also share your custom theme with friends.

30 

31![Codex app Appearance settings showing theme selection, color controls, and font options](/images/codex/app/theme-selection-light.webp)

32 

30## Git33## Git

31 34 

32Use Git settings to standardize branch naming and choose whether Codex uses force35Use Git settings to standardize branch naming and choose whether Codex uses force

Details

32### Only some threads appear in the sidebar32### Only some threads appear in the sidebar

33 33 

34The sidebar allows filtering of threads depending on the state of a project. If34The sidebar allows filtering of threads depending on the state of a project. If

35youre missing threads, check whether you have any filters applied by clicking35you're missing threads, click the filter icon next to the **Threads** label and

36the filter icon next to the **Threads** label.36switch to Chronological. If you still don't see the thread, open

37[Settings](codex://settings) and check the archived chats or archived threads

38section.

37 39 

38### Code doesn't run on a worktree40### Code doesn't run on a worktree

39 41 

app/windows.md +214 −0 added

Details

1# Windows

2 

3The [Codex app for Windows](https://apps.microsoft.com/detail/9plm9xgg6vks?hl=en-US&gl=US) gives you one interface for

4working across projects, running parallel agent threads, and reviewing results.

5It runs natively on Windows using PowerShell and the

6[Windows sandbox](https://developers.openai.com/codex/windows#windows-sandbox), or you can configure it to

7run in [Windows Subsystem for Linux (WSL)](#windows-subsystem-for-linux-wsl).

8 

9![Codex app for Windows showing a project sidebar, active thread, and review pane](/images/codex/windows/codex-windows-light.webp)

10 

11## Download and update the Codex app

12 

13Download the Codex app from the

14[Microsoft Store](https://apps.microsoft.com/detail/9plm9xgg6vks?hl=en-US&gl=US).

15 

16Then follow the [quickstart](https://developers.openai.com/codex/quickstart?setup=app) to get started.

17 

18To update the app, open the Microsoft Store, go to **Downloads**, and click

19**Check for updates**. The Store installs the latest version afterward.

20 

21For enterprises, administrators can deploy the app with Microsoft Store app

22distribution through enterprise management tools.

23 

24If you prefer a command-line install path, or need an alternative to opening

25the Microsoft Store UI, run:

26 

27```powershell

28winget install Codex -s msstore

29```

30 

31## Native sandbox

32 

33The Codex app on Windows supports a native [Windows sandbox](https://developers.openai.com/codex/windows#windows-sandbox) when the agent runs in PowerShell, and uses Linux sandboxing when you run the agent in [Windows Subsystem for Linux (WSL)](#windows-subsystem-for-linux-wsl). To apply sandbox protections in either mode, set sandbox permissions to **Default permissions** in the Composer before sending messages to Codex.

34 

35Running Codex in full access mode means Codex is not limited to your project

36 directory and might perform unintentional destructive actions that can lead to

37 data loss. Keep sandbox boundaries in place and use [rules](https://developers.openai.com/codex/rules) for

38 targeted exceptions, or set your [approval policy to

39 never](https://developers.openai.com/codex/agent-approvals-security#run-without-approval-prompts) to have

40 Codex attempt to solve problems without asking for escalated permissions,

41 based on your [approval and security setup](https://developers.openai.com/codex/agent-approvals-security).

42 

43## Customize for your dev setup

44 

45### Preferred editor

46 

47Choose a default app for **Open**, such as Visual Studio, VS Code, or another

48editor. You can override that choice per project. If you already picked a

49different app from the **Open** menu for a project, that project-specific

50choice takes precedence.

51 

52![Codex app settings showing the default Open In app on Windows](/images/codex/windows/open-in-windows-light.webp)

53 

54### Integrated terminal

55 

56You can also choose the default integrated terminal. Depending on what you have

57installed, options include:

58 

59- PowerShell

60- Command Prompt

61- Git Bash

62- WSL

63 

64This change applies only to new terminal sessions. If you already have an

65integrated terminal open, restart the app or start a new thread before

66expecting the new default terminal to appear.

67 

68![Codex app settings showing the integrated terminal selection on Windows](/images/codex/windows/integrated-shell-light.webp)

69 

70## Windows Subsystem for Linux (WSL)

71 

72By default, the Codex app uses the Windows-native agent. That means the agent

73runs commands in PowerShell. The app can still work with projects that live in

74Windows Subsystem for Linux (WSL) by using the `wsl` CLI when needed.

75 

76If you want to add a project from the WSL filesystem, click **Add new project**

77or press <kbd>Ctrl</kbd>+<kbd>O</kbd>, then type `\\wsl$\` into the File

78Explorer window. From there, choose your Linux distribution and the folder you

79want to open.

80 

81If you plan to keep using the Windows-native agent, prefer storing projects on

82your Windows filesystem and accessing them from WSL through

83`/mnt/<drive>/...`. This setup is more reliable than opening projects

84directly from the WSL filesystem.

85 

86If you want the agent itself to run in WSL, open **[Settings](codex://settings)**,

87switch the agent from Windows native to WSL, and **restart the app**. The

88change doesn't take effect until you restart. Your projects should remain in

89place after restart.

90 

91![Codex app settings showing the agent selector with Windows native and WSL options](/images/codex/windows/wsl-select-light.webp)

92 

93You configure the integrated terminal independently from the agent. See

94[Customize for your dev setup](#customize-for-your-dev-setup) for the

95terminal options. You can keep the agent in WSL and still use PowerShell in the

96terminal, or use WSL for both, depending on your workflow.

97 

98## Useful developer tools

99 

100Codex works best when a few common developer tools are already installed:

101 

102- **Git**: Powers the review panel in the Codex app and lets you inspect or

103 revert changes.

104- **Node.js**: A common tool that the agent uses to perform tasks more

105 efficiently.

106- **Python**: A common tool that the agent uses to perform tasks more

107 efficiently.

108- **.NET SDK**: Useful when you want to build native Windows apps.

109- **GitHub CLI**: Powers GitHub-specific functionality in the Codex app.

110 

111Install them with the default Windows package manager `winget` by pasting this

112into the [integrated terminal](https://developers.openai.com/codex/app/features#integrated-terminal) or

113asking Codex to install them:

114 

115```powershell

116winget install --id Git.Git

117winget install --id OpenJS.NodeJS.LTS

118winget install --id Python.Python.3.14

119winget install --id Microsoft.DotNet.SDK.10

120winget install --id GitHub.cli

121```

122 

123After installing GitHub CLI, run `gh auth login` to enable GitHub features in

124the app.

125 

126If you need a different Python or .NET version, change the package IDs to the

127version you want.

128 

129## Troubleshooting and FAQ

130 

131### Run commands with elevated permissions

132 

133If you need Codex to run commands with elevated permissions, start the Codex app

134itself as an administrator. After installation, open the Start menu, find

135Codex, and choose Run as administrator. The Codex agent inherits that

136permission level.

137 

138### PowerShell execution policy blocks commands

139 

140If you have never used tools such as Node.js or `npm` in PowerShell before, the

141Codex agent or integrated terminal may hit execution policy errors.

142 

143This can also happen if Codex creates PowerShell scripts for you. In that case,

144you may need a less restrictive execution policy before PowerShell will run

145them.

146 

147An error may look something like this:

148 

149```text

150npm.ps1 cannot be loaded because running scripts is disabled on this system.

151```

152 

153A common fix is to set the execution policy to `RemoteSigned`:

154 

155```powershell

156Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

157```

158 

159For details and other options, check Microsoft's

160[execution policy guide](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_execution_policies)

161before changing the policy.

162 

163### Local environment scripts on Windows

164 

165If your [local environment](https://developers.openai.com/codex/app/local-environments) uses cross-platform

166commands such as `npm` scripts, you can keep one shared setup script or

167set of actions for every platform.

168 

169If you need Windows-specific behavior, create Windows-specific setup scripts or

170Windows-specific actions.

171 

172Actions run in the environment used by your integrated terminal. See

173[Customize for your dev setup](#customize-for-your-dev-setup).

174 

175Local setup scripts run in the agent environment: WSL if the agent uses WSL,

176and PowerShell otherwise.

177 

178### Share config, auth, and sessions with WSL

179 

180The Windows app uses the same Codex home directory as native Codex on Windows:

181`%USERPROFILE%\.codex`.

182 

183If you also run the Codex CLI inside WSL, the CLI uses the Linux home

184directory by default, so it does not automatically share configuration, cached

185auth, or session history with the Windows app.

186 

187To share them, use one of these approaches:

188 

189- Sync WSL `~/.codex` with `%USERPROFILE%\.codex` on your file system.

190- Point WSL at the Windows Codex home directory by setting `CODEX_HOME`:

191 

192```bash

193export CODEX_HOME=/mnt/c/Users/<windows-user>/.codex

194```

195 

196If you want that setting in every shell, add it to your WSL shell profile, such

197as `~/.bashrc` or `~/.zshrc`.

198 

199### Git features are unavailable

200 

201If you don't have Git installed natively on Windows, the app can't use some

202features. Install it with `winget install Git.Git` from PowerShell or `cmd.exe`.

203 

204### Git isn't detected for projects opened from `\\wsl$`

205 

206For now, if you want to use the Windows-native agent with a project that is

207also accessible from WSL, the most reliable workaround is to store the project

208on the native Windows drive and access it in WSL through `/mnt/<drive>/...`.

209 

210### Cmder is not listed in the open dialog

211 

212If Cmder is installed but doesn’t show in Codex’s open dialog, add it to the

213Windows Start Menu: right-click Cmder and choose **Add to Start**, then restart

214Codex or reboot.

app/worktrees.md +45 −43

Details

1# Worktrees1# Worktrees

2 2 

3In the Codex app, worktrees let Codex run multiple independent tasks in the same project without interfering with each other. For Git repositories, [automations](https://developers.openai.com/codex/app/automations) run on dedicated background worktrees so they dont conflict with your ongoing work. In non-version-controlled projects, automations run directly in the project directory. You can also start threads on a worktree manually.3In the Codex app, worktrees let Codex run multiple independent tasks in the same project without interfering with each other. For Git repositories, [automations](https://developers.openai.com/codex/app/automations) run on dedicated background worktrees so they don't conflict with your ongoing work. In non-version-controlled projects, automations run directly in the project directory. You can also start threads on a worktree manually, and use Handoff to move a thread between Local and Worktree.

4 4 

5## What's a worktree5## What's a worktree

6 6 


10 10 

11- **Local checkout**: The repository that you created. Sometimes just referred to as **Local** in the Codex app.11- **Local checkout**: The repository that you created. Sometimes just referred to as **Local** in the Codex app.

12- **Worktree**: A [Git worktree](https://git-scm.com/docs/git-worktree) that was created from your local checkout in the Codex app.12- **Worktree**: A [Git worktree](https://git-scm.com/docs/git-worktree) that was created from your local checkout in the Codex app.

13- **Handoff**: The flow that moves a thread between Local and Worktree. Codex handles the Git operations required to move your work safely between them.

13 14 

14## Why use a worktree15## Why use a worktree

15 16 

161. Work in parallel with Codex without breaking each other as you work.171. Work in parallel with Codex without disturbing your current Local setup.

172. Start a thread unrelated to your current work182. Queue up background work while you stay focused on the foreground.

18 - Staging area to queue up work you want Codex to start but aren’t ready to test yet.193. Move a thread into Local later when you're ready to inspect, test, or collaborate more directly.

19 20 

20## Getting started21## Getting started

21 22 


313. Submit your prompt323. Submit your prompt

32 33 

33 Submit your task and Codex will create a Git worktree based on the branch you selected. By default, Codex works in a ["detached HEAD"](https://git-scm.com/docs/git-checkout#_detached_head).34 Submit your task and Codex will create a Git worktree based on the branch you selected. By default, Codex works in a ["detached HEAD"](https://git-scm.com/docs/git-checkout#_detached_head).

344. Verify your changes354. Choose where to keep working

35 36 

36 When you’re ready, follow one of the paths [below](#verifying-and-pushing-workflow-changes)37 When you’re ready, you can either keep working directly on the worktree or hand the thread off to your local checkout. Handing off to or from local will move your thread *and* code so you can continue in the other checkout.

37 based on your project and flow.

38 38 

39## Verifying and pushing workflow changes39## Working between Local and Worktree

40 40 

41Worktrees look and feel much like your local checkout. But **Git only allows a branch to be checked out in one place at a time**. If you check out a branch on a worktree, you **can’t** check it out in your local checkout at the same time, and vice versa.41Worktrees look and feel much like your local checkout. The difference is where they fit into your flow. You can think of Local as the foreground and Worktree as the background. Handoff lets you move a thread between them.

42 42 

43Because of this, choose how you want to verify and commit changes Codex made on a worktree:43Under the hood, Handoff handles the Git operations required to move work between two checkouts safely. This matters because **Git only allows a branch to be checked out in one place at a time**. If you check out a branch on a worktree, you **can't** check it out in your local checkout at the same time, and vice versa.

44 

45In practice, there are two common paths:

44 46 

451. [Work exclusively on the worktree](#option-1-working-on-the-worktree). This path works best when you can verify changes directly on the worktree, for example because you have dependencies and tools installed using a [local environment setup script](https://developers.openai.com/codex/app/local-environments).471. [Work exclusively on the worktree](#option-1-working-on-the-worktree). This path works best when you can verify changes directly on the worktree, for example because you have dependencies and tools installed using a [local environment setup script](https://developers.openai.com/codex/app/local-environments).

462. [Work in your local checkout](#option-2-working-in-your-local-checkout). Use this when you need to bring changes back into your main checkout, for example because you can run only one instance of your app.482. [Hand the thread off to Local](#option-2-handing-a-thread-off-to-local). Use this when you want to bring the thread into the foreground, for example because you want to inspect changes in your usual IDE or can run only one instance of your app.

47 49 

48### Option 1: Working on the worktree50### Option 1: Working on the worktree

49 51 


57 59 

58Remember, if you create a branch on a worktree, you can't check it out in any other worktree, including your local checkout.60Remember, if you create a branch on a worktree, you can't check it out in any other worktree, including your local checkout.

59 61 

60If you plan to keep working on this branch, you can [add it to the sidebar](#adding-a-worktree-to-the-sidebar). Otherwise, archive the thread after you’re done so the worktree can be deleted.62### Option 2: Handing a thread off to Local

61 

62### Option 2: Working in your local checkout

63 63 

64If you don’t want to verify your changes directly on the worktree and instead check them out on your local checkout, click **Sync with local** in the header of your thread.64If you want to bring a thread into the foreground, click **Hand off** in the header of your thread and move it to **Local**.

65 65 

66You will be presented with the option of creating a new branch or syncing to an existing branch.66This path works well when you want to read the changes in your usual IDE window, run your existing development server, or validate the work in the same environment you already use day to day.

67 67 

68You can sync with local at any point. To do so, click **Sync with local** in the header again. From here, you can choose which direction to sync (to local or from local) and a sync method:68Codex handles the Git steps required to move the thread safely between the worktree and your local checkout.

69 69 

70- **Overwrite**: Makes the destination checkout match the source checkout’s files and commit history.70Each thread keeps the same associated worktree over time. If you hand the thread back to a worktree later, Codex returns it to that same background environment so you can pick up where you left off.

71- **Apply**: Calculates the source changes since the nearest shared commit and applies that patch onto the destination checkout, preserving destination commit history while bringing over source code changes (not source commits).

72 71 

73![Sync worktree dialog with options to apply or pull changes](/images/codex/app/sync-worktree-light.webp)72![Handoff dialog moving a thread from a worktree to Local](/images/codex/app/handoff-light.webp)

74 73 

75You can create multiple worktrees and sync them to the same feature branch to split up your work into parallel threads.74You can also go the other direction. If you're already working in Local and want to free up the foreground, use **Hand off** to move the thread to a worktree. This is useful when you want Codex to keep working in the background while you switch your attention back to something else locally.

76 75 

77In some cases, changes on your worktree might conflict with changes on your local checkout, for example from testing a previous worktree. In those cases, you can use the **Overwrite local** option to reset the previous changes and cleanly apply your worktree changes.76Since Handoff uses Git operations, any files that are part of your `.gitignore` file won't move with the thread.

78 77 

79Since this process uses Git operations, any files that are part of the `.gitignore` file won’t be transferred during the sync process.78## Advanced details

80 79 

81## Adding a worktree to the sidebar80### Codex-managed and permanent worktrees

82 81 

83If you choose option one above (work on the worktree), once you have created a branch on the worktree, an option appears in the header to add the worktree to your sidebar. This promotes the worktree to a permanent home. When you do this, it will never be automatically deleted, and you can even kick off new threads from the same worktree.82By default, threads use a Codex-managed worktree. These are meant to feel lightweight and disposable. A Codex-managed worktree is typically dedicated to one thread, and Codex returns that thread to the same worktree if you hand it back there later.

84 83 

85## Advanced details84If you want a long-lived environment, create a permanent worktree from the three-dot menu on a project in the sidebar. This creates a new permanent worktree as its own project. Permanent worktrees are not automatically deleted, and you can start multiple threads from the same worktree.

86 85 

87### How Codex manages worktrees for you86### How Codex manages worktrees for you

88 87 

89Codex will create a worktree in `$CODEX_HOME/worktrees`. The starting commit will be the `HEAD` commit of the branch selected when you start your thread. If you chose a branch with local changes, the uncommitted changes will be applied to the worktree as well. The worktree will *not* be checked out as a branch. It will be in a [detached HEAD](https://git-scm.com/docs/git-checkout#_detached_head) state. This means you can create several worktrees without polluting your branches.88Codex creates worktrees in `$CODEX_HOME/worktrees`. The starting commit will be the `HEAD` commit of the branch selected when you start your thread. If you chose a branch with local changes, the uncommitted changes will be applied to the worktree as well. The worktree will *not* be checked out as a branch. It will be in a [detached HEAD](https://git-scm.com/docs/git-checkout#_detached_head) state. This lets Codex create several worktrees without polluting your branches.

90 89 

91### Branch limitations90### Branch limitations

92 91 


98 97 

99To resolve this, you would need to check out another branch instead of `feature/a` on the worktree.98To resolve this, you would need to check out another branch instead of `feature/a` on the worktree.

100 99 

101If you plan on checking out the branch locally, try Workflow 2 ([sync with local](#option-2-working-in-your-local-checkout)).100If you plan on checking out the branch locally, use Handoff to move the thread into Local instead of trying to keep the same branch checked out in both places at once.

102 101 

103Why this limitation exists102Why this limitation exists

104 103 


112 111 

113Worktrees can take up a lot of disk space. Each one has its own set of repository files, dependencies, build caches, etc. As a result, the Codex app tries to keep the number of worktrees to a reasonable limit.112Worktrees can take up a lot of disk space. Each one has its own set of repository files, dependencies, build caches, etc. As a result, the Codex app tries to keep the number of worktrees to a reasonable limit.

114 113 

115Worktrees will never be cleaned up if:114By default, Codex keeps your most recent 15 Codex-managed worktrees. You can change this limit or turn off automatic deletion in settings if you prefer to manage disk usage yourself.

116 115 

117- A pinned conversation is tied to it116Codex tries to avoid deleting worktrees that are still important. Codex-managed worktrees won't be deleted automatically if:

118- The worktree was added to the sidebar (see above)

119 117 

120Worktrees are eligible for cleanup when:118- A pinned conversation is tied to it

119- The thread is still in progress

120- The worktree is a permanent worktree

121 121 

122- It’s more than 4 days old122Codex-managed worktrees are deleted automatically when:

123- You have more than 10 worktrees

124 123 

125When either of those conditions are met, Codex automatically cleans up a worktree when you archive a thread, or on app startup if it finds a worktree with no associated threads.124- You archive the associated thread

125- Codex needs to delete older worktrees to stay within your configured limit

126 126 

127Before cleaning up a worktree, Codex will save a snapshot of the work on it that you can restore at any point in a new worktree. If you open a conversation after its worktree was cleaned up, youll see the option to restore it.127Before deleting a Codex-managed worktree, Codex saves a snapshot of the work on it. If you open a conversation after its worktree was deleted, you'll see the option to restore it.

128 128 

129## Frequently asked questions129## Frequently asked questions

130 130 


133 Not today. Codex creates worktrees under `$CODEX_HOME/worktrees` so it can133 Not today. Codex creates worktrees under `$CODEX_HOME/worktrees` so it can

134 manage them consistently.134 manage them consistently.

135 135 

136Can I move a session between worktrees?136Can I move a thread between Local and Worktree?

137 137 

138Not yet. If you need to change environments, you have to start a new thread in138 Yes. Use **Hand off** in the thread header to move a thread between your local

139the target environment and restate the prompt. You can use the up arrow keys139 checkout and a worktree. Codex handles the Git operations needed to move the

140in the composer to try to recover your prompt.140 thread safely between environments. If you hand a thread back to a worktree

141 later, Codex returns it to the same associated worktree.

141 142 

142What happens to threads if a worktree is deleted?143What happens to threads if a worktree is deleted?

143 144 

144 Threads can remain in your history even if the underlying worktree directory145 Threads can remain in your history even if the underlying worktree directory

145is cleaned up. However, Codex saves a snapshot of the worktree prior to146 is deleted. For Codex-managed worktrees, Codex saves a snapshot before

146cleaning it up and offers to restore it if you reopen the thread associated147 deleting the worktree and offers to restore it if you reopen the associated

147with it.148 thread. Permanent worktrees are not automatically deleted when you archive

149 their threads.

auth.md +41 −1

Details

9 9 

10Codex cloud requires signing in with ChatGPT. The Codex CLI and IDE extension support both sign-in methods.10Codex cloud requires signing in with ChatGPT. The Codex CLI and IDE extension support both sign-in methods.

11 11 

12Your sign-in method also determines which admin controls and data-handling policies apply.

13 

14- With sign in with ChatGPT, Codex usage follows your ChatGPT workspace permissions, RBAC, and ChatGPT Enterprise retention and residency settings

15- With an API key, usage follows your API organization's retention and data-sharing settings instead

16 

17For the CLI, Sign in with ChatGPT is the default authentication path when no valid session is available.

18 

12### Sign in with ChatGPT19### Sign in with ChatGPT

13 20 

14When you sign in with ChatGPT from the Codex app, CLI, or IDE Extension, Codex opens a browser window for you to complete the login flow. After you sign in, the browser returns an access token to the CLI or IDE extension.21When you sign in with ChatGPT from the Codex app, CLI, or IDE Extension, Codex opens a browser window for you to complete the login flow. After you sign in, the browser returns an access token to the CLI or IDE extension.


19 26 

20OpenAI bills API key usage through your OpenAI Platform account at standard API rates. See the [API pricing page](https://openai.com/api/pricing/).27OpenAI bills API key usage through your OpenAI Platform account at standard API rates. See the [API pricing page](https://openai.com/api/pricing/).

21 28 

29Features that rely on ChatGPT credits, such as [fast mode](https://developers.openai.com/codex/speed), are

30available only when you sign in with ChatGPT. If you sign in with an API key,

31Codex uses standard API pricing instead.

32 

33Recommendation is to use API key authentication for programmatic Codex CLI workflows (for example CI/CD jobs). Don't expose Codex execution in untrusted or public environments.

34 

22## Secure your Codex cloud account35## Secure your Codex cloud account

23 36 

24Codex cloud interacts directly with your codebase, so it needs stronger security than many other ChatGPT features. Enable multi-factor authentication (MFA).37Codex cloud interacts directly with your codebase, so it needs stronger security than many other ChatGPT features. Enable multi-factor authentication (MFA).


43 56 

44Codex caches login details locally in a plaintext file at `~/.codex/auth.json` or in your OS-specific credential store.57Codex caches login details locally in a plaintext file at `~/.codex/auth.json` or in your OS-specific credential store.

45 58 

59For sign in with ChatGPT sessions, Codex refreshes tokens automatically during use before they expire, so active sessions usually continue without requiring another browser login.

60 

46## Credential storage61## Credential storage

47 62 

48Use `cli_auth_credentials_store` to control where the Codex CLI stores cached credentials:63Use `cli_auth_credentials_store` to control where the Codex CLI stores cached credentials:


74 89 

75If the active credentials don't match the configured restrictions, Codex logs the user out and exits.90If the active credentials don't match the configured restrictions, Codex logs the user out and exits.

76 91 

77These settings are commonly applied via managed configuration rather than per-user setup. See [Managed configuration](https://developers.openai.com/codex/security#managed-configuration).92These settings are commonly applied via managed configuration rather than per-user setup. See [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration).

93 

94## Login diagnostics

95 

96Direct `codex login` runs write a dedicated `codex-login.log` file under

97your configured log directory. Use it when you need to debug browser-login or

98device-code failures, or when support asks for login-specific logs.

99 

100## Custom CA bundles

101 

102If your network uses a corporate TLS proxy or private root CA, set

103`CODEX_CA_CERTIFICATE` to a PEM bundle before logging in. When

104`CODEX_CA_CERTIFICATE` is unset, Codex falls back to `SSL_CERT_FILE`. The same

105custom CA settings apply to login, normal HTTPS requests, and secure websocket

106connections.

107 

108```shell

109export CODEX_CA_CERTIFICATE=/path/to/corporate-root-ca.pem

110codex login

111```

78 112 

79## Login on headless devices113## Login on headless devices

80 114 


130docker cp ~/.codex/auth.json MY_CONTAINER:"$CONTAINER_HOME/.codex/auth.json"164docker cp ~/.codex/auth.json MY_CONTAINER:"$CONTAINER_HOME/.codex/auth.json"

131```165```

132 166 

167For a more advanced version of this same pattern on trusted CI/CD runners, see

168[Maintain Codex account auth in CI/CD (advanced)](https://developers.openai.com/codex/auth/ci-cd-auth).

169That guide explains how to let Codex refresh `auth.json` during normal runs and

170then keep the updated file for the next job. API keys are still the recommended

171default for automation.

172 

133### Fallback: Forward the localhost callback over SSH173### Fallback: Forward the localhost callback over SSH

134 174 

135If you can forward ports between your local machine and the remote host, you can use the standard browser-based flow by tunneling Codex's local callback server (default `localhost:1455`).175If you can forward ports between your local machine and the remote host, you can use the standard browser-based flow by tunneling Codex's local callback server (default `localhost:1455`).

auth/ci-cd-auth.md +277 −0 added

Details

1# Maintain Codex account auth in CI/CD (advanced)

2 

3This guide shows how to keep ChatGPT-managed Codex auth working on a trusted

4CI/CD runner without calling the OAuth token endpoint yourself.

5 

6The right way to authenticate automation is with an API key. Use this guide

7only if you specifically need to run the workflow as your Codex account.

8 

9The pattern is:

10 

111. Create `auth.json` once on a trusted machine with `codex login`.

122. Put that file on the runner.

133. Run Codex normally.

144. Let Codex refresh the session when it becomes stale.

155. Keep the refreshed `auth.json` for the next run.

16 

17This is an advanced workflow for enterprise and other trusted private

18automation. API keys are still the recommended option for most CI/CD jobs.

19 

20Treat `~/.codex/auth.json` like a password: it contains access tokens. Don't

21 commit it, paste it into tickets, or share it in chat. Do not use this

22 workflow for public or open-source repositories.

23 

24## Why this works

25 

26Codex already knows how to refresh a ChatGPT-managed session.

27 

28As of the current open-source client:

29 

30- Codex loads the local auth cache from `auth.json`

31- if `last_refresh` is older than about 8 days, Codex refreshes the token

32 bundle before the run continues

33- after a successful refresh, Codex writes the new tokens and a new

34 `last_refresh` back to `auth.json`

35- if a request gets a `401`, Codex also has a built-in refresh-and-retry path

36 

37That means the supported CI/CD strategy is not "call the refresh API yourself."

38It is "run Codex and persist the updated `auth.json`."

39 

40## When to use this

41 

42Use this guide only when all of the following are true:

43 

44- you need ChatGPT-managed Codex auth rather than an API key

45- `codex login` cannot run on the remote runner

46- the runner is trusted private infrastructure

47- you can preserve the refreshed `auth.json` between runs

48- only one machine or serialized job stream will use a given `auth.json` copy

49 

50This guide applies to Codex-managed ChatGPT auth (`auth_mode: "chatgpt"`).

51 

52It does not apply to:

53 

54- API key auth

55- external-token host integrations (`auth_mode: "chatgptAuthTokens"`)

56- generic OAuth clients outside Codex

57 

58If your credentials are stored in the OS keyring, switch to file-backed storage

59first. See [Credential storage](https://developers.openai.com/codex/auth#credential-storage).

60 

61## Seed `auth.json` once

62 

63On a trusted machine where browser login is possible:

64 

651. Configure Codex to store credentials in a file:

66 

67```toml

68cli_auth_credentials_store = "file"

69```

70 

712. Run:

72 

73```bash

74codex login

75```

76 

773. Verify the file looks like managed ChatGPT auth:

78 

79```bash

80AUTH_FILE="${CODEX_HOME:-$HOME/.codex}/auth.json"

81 

82jq '{

83 auth_mode,

84 has_tokens: (.tokens != null),

85 has_refresh_token: ((.tokens.refresh_token // "") != ""),

86 last_refresh

87}' "$AUTH_FILE"

88```

89 

90Continue only if:

91 

92- `auth_mode` is `"chatgpt"`

93- `has_refresh_token` is `true`

94 

95Then place the contents of `auth.json` into your CI/CD secret manager or copy

96it to a trusted persistent runner.

97 

98## Recommended pattern: GitHub Actions on a self-hosted runner

99 

100The simplest fully automated setup is a self-hosted GitHub Actions runner with a

101persistent `CODEX_HOME`.

102 

103Why this pattern works well:

104 

105- the runner can keep `auth.json` on disk between jobs

106- Codex can refresh the file in place

107- later jobs automatically pick up the refreshed tokens

108- you only need the original secret for bootstrap or reseeding

109 

110The critical detail is to seed `auth.json` only if it is missing. If you

111rewrite the file from the original secret on every run, you throw away the

112refreshed tokens that Codex just wrote.

113 

114Example scheduled workflow:

115 

116```yaml

117name: Keep Codex auth fresh

118 

119on:

120 schedule:

121 - cron: "0 9 * * 1"

122 workflow_dispatch:

123 

124jobs:

125 keep-codex-auth-fresh:

126 runs-on: self-hosted

127 steps:

128 - name: Bootstrap auth.json if needed

129 shell: bash

130 env:

131 CODEX_AUTH_JSON: ${{ secrets.CODEX_AUTH_JSON }}

132 run: |

133 export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"

134 mkdir -p "$CODEX_HOME"

135 chmod 700 "$CODEX_HOME"

136 

137 if [ ! -f "$CODEX_HOME/auth.json" ]; then

138 printf '%s' "$CODEX_AUTH_JSON" > "$CODEX_HOME/auth.json"

139 chmod 600 "$CODEX_HOME/auth.json"

140 fi

141 

142 - name: Run Codex

143 shell: bash

144 run: |

145 codex exec --json "Reply with the single word OK." >/dev/null

146```

147 

148What this does:

149 

150- the first run seeds `auth.json`

151- later runs reuse the same file

152- once the cached session is old enough, Codex refreshes it during the normal

153 `codex exec` step

154- the refreshed file remains on disk for the next workflow run

155 

156A weekly schedule is usually enough because Codex treats the session as stale

157after roughly 8 days in the current open-source client.

158 

159## Ephemeral runners: restore, run Codex, persist the updated file

160 

161If you use GitHub-hosted runners, GitLab shared runners, or any other ephemeral

162environment, the runner filesystem disappears after each job. In that setup,

163you need a round-trip:

164 

1651. restore the current `auth.json` from secure storage

1662. run Codex

1673. write the updated `auth.json` back to secure storage

168 

169Generic GitHub Actions shape:

170 

171```yaml

172name: Run Codex with managed auth

173 

174on:

175 workflow_dispatch:

176 

177jobs:

178 codex-job:

179 runs-on: ubuntu-latest

180 steps:

181 - name: Restore auth.json

182 shell: bash

183 run: |

184 export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}"

185 mkdir -p "$CODEX_HOME"

186 chmod 700 "$CODEX_HOME"

187 

188 # Replace this with your secret manager or secure storage command.

189 my-secret-cli read codex-auth-json > "$CODEX_HOME/auth.json"

190 chmod 600 "$CODEX_HOME/auth.json"

191 

192 - name: Run Codex

193 shell: bash

194 run: |

195 codex exec --json "summarize the failing tests"

196 

197 - name: Persist refreshed auth.json

198 if: always()

199 shell: bash

200 run: |

201 # Replace this with your secret manager or secure storage command.

202 my-secret-cli write codex-auth-json < "$CODEX_HOME/auth.json"

203```

204 

205The key requirement is that the write-back step stores the refreshed file that

206Codex produced during the run, not the original seed.

207 

208## You do not need a separate refresh command

209 

210Any normal Codex run can refresh the session.

211 

212That means you have two good options:

213 

214- let your existing CI/CD Codex job refresh the file naturally

215- add a lightweight scheduled maintenance job, like the GitHub Actions example

216 above, if your real jobs do not run often enough

217 

218The first Codex run after the session becomes stale is the one that refreshes

219`auth.json`.

220 

221## Operational rules that matter

222 

223- Use one `auth.json` per runner or per serialized workflow stream.

224- Do not share the same file across concurrent jobs or multiple machines.

225- Do not overwrite a persistent runner's refreshed file from the original seed

226 on every run.

227- Do not store `auth.json` in the repository, logs, or public artifact storage.

228- Reseed from a trusted machine if built-in refresh stops working.

229 

230## What to do when refresh stops working

231 

232This flow reduces manual work, but it does not guarantee the same session lasts

233forever.

234 

235Reseed the runner with a fresh `auth.json` if:

236 

237- Codex starts returning `401` and the runner can no longer refresh

238- the refresh token was revoked or expired

239- another machine or concurrent job rotated the token first

240- your secure-storage round trip failed and an old file was restored

241 

242To reseed:

243 

2441. Run `codex login` on a trusted machine.

2452. Replace the stored CI/CD copy of `auth.json`.

2463. Let the next runner job continue using Codex's built-in refresh flow.

247 

248## Verify that the runner is maintaining the session

249 

250Check that the runner still has managed auth tokens and that `last_refresh`

251exists:

252 

253```bash

254AUTH_FILE="${CODEX_HOME:-$HOME/.codex}/auth.json"

255 

256jq '{

257 auth_mode,

258 last_refresh,

259 has_access_token: ((.tokens.access_token // "") != ""),

260 has_id_token: ((.tokens.id_token // "") != ""),

261 has_refresh_token: ((.tokens.refresh_token // "") != "")

262}' "$AUTH_FILE"

263```

264 

265If your runner is persistent, you should see the same file continue to exist

266between runs. If your runner is ephemeral, confirm that your write-back step is

267storing the updated file from the last job.

268 

269## Source references

270 

271If you want to verify this behavior in the open-source client:

272 

273- [`codex-rs/core/src/auth.rs`](https://github.com/openai/codex/blob/main/codex-rs/core/src/auth.rs)

274 covers stale-token detection, automatic refresh, refresh-on-401 recovery, and

275 persistence of refreshed tokens

276- [`codex-rs/core/src/auth/storage.rs`](https://github.com/openai/codex/blob/main/codex-rs/core/src/auth/storage.rs)

277 covers file-backed `auth.json` storage

cli.md +7 −5

Details

3Codex CLI is OpenAI's coding agent that you can run locally from your terminal. It can read, change, and run code on your machine in the selected directory.3Codex CLI is OpenAI's coding agent that you can run locally from your terminal. It can read, change, and run code on your machine in the selected directory.

4It's [open source](https://github.com/openai/codex) and built in Rust for speed and efficiency.4It's [open source](https://github.com/openai/codex) and built in Rust for speed and efficiency.

5 5 

6Codex is included with ChatGPT Plus, Pro, Business, Edu, and Enterprise plans. Learn more about [whats included](https://developers.openai.com/codex/pricing).6ChatGPT Plus, Pro, Business, Edu, and Enterprise plans include Codex. Learn more about [what's included](https://developers.openai.com/codex/pricing).

7 7 

8## CLI setup8## CLI setup

9 9 


47experimental. For the best Windows experience, use Codex in a WSL workspace47experimental. For the best Windows experience, use Codex in a WSL workspace

48and follow our [Windows setup guide](https://developers.openai.com/codex/windows).48and follow our [Windows setup guide](https://developers.openai.com/codex/windows).

49 49 

50If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).

51 

50---52---

51 53 

52## Work with the Codex CLI54## Work with the Codex CLI


55 57 

56Run `codex` to start an interactive terminal UI (TUI) session.](https://developers.openai.com/codex/cli/features#running-in-interactive-mode)[### Control model and reasoning58Run `codex` to start an interactive terminal UI (TUI) session.](https://developers.openai.com/codex/cli/features#running-in-interactive-mode)[### Control model and reasoning

57 59 

58Use `/model` to switch between GPT-5.3-Codex and other available models, or adjust reasoning levels.](https://developers.openai.com/codex/cli/features#models-reasoning)[### Image inputs60Use `/model` to switch between GPT-5.4, GPT-5.3-Codex, and other available models, or adjust reasoning levels.](https://developers.openai.com/codex/cli/features#models-reasoning)[### Image inputs

59 61 

60Attach screenshots or design specs so Codex reads them alongside your prompt.](https://developers.openai.com/codex/cli/features#image-inputs)[### Run local code review62Attach screenshots or design specs so Codex reads them alongside your prompt.](https://developers.openai.com/codex/cli/features#image-inputs)[### Run local code review

61 63 

62Get your code reviewed by a separate Codex agent before you commit or push your changes.](https://developers.openai.com/codex/cli/features#running-local-code-review)[### Use multi-agent64Get your code reviewed by a separate Codex agent before you commit or push your changes.](https://developers.openai.com/codex/cli/features#running-local-code-review)[### Use subagents

63 65 

64Enable experimental multi-agent collaboration and parallelize complex tasks.](https://developers.openai.com/codex/multi-agent)[### Web search66Use subagents to parallelize complex tasks.](https://developers.openai.com/codex/subagents)[### Web search

65 67 

66Use Codex to search the web and get up-to-date information for your task.](https://developers.openai.com/codex/cli/features#web-search)[### Codex Cloud tasks68Use Codex to search the web and get up-to-date information for your task.](https://developers.openai.com/codex/cli/features#web-search)[### Codex Cloud tasks

67 69 

68Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.](https://developers.openai.com/codex/cli/features#working-with-codex-cloud)[### Scripting Codex70Launch a Codex Cloud task, choose environments, and apply the resulting diffs without leaving your terminal.](https://developers.openai.com/codex/cli/features#working-with-codex-cloud)[### Scripting Codex

69 71 

70Automate repeatable workflows by scripting Codex with the `exec` command.](https://developers.openai.com/codex/sdk#using-codex-cli-programmatically)[### Model Context Protocol72Automate repeatable workflows by scripting Codex with the `exec` command.](https://developers.openai.com/codex/noninteractive)[### Model Context Protocol

71 73 

72Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).](https://developers.openai.com/codex/mcp)[### Approval modes74Give Codex access to additional third-party tools and context with Model Context Protocol (MCP).](https://developers.openai.com/codex/mcp)[### Approval modes

73 75 

cli/features.md +24 −6

Details

20 20 

21- Send prompts, code snippets, or screenshots (see [image inputs](#image-inputs)) directly into the composer.21- Send prompts, code snippets, or screenshots (see [image inputs](#image-inputs)) directly into the composer.

22- Watch Codex explain its plan before making a change, and approve or reject steps inline.22- Watch Codex explain its plan before making a change, and approve or reject steps inline.

23- Read syntax-highlighted markdown code blocks and diffs in the TUI, then use `/theme` to preview and save a preferred theme.

24- Use `/clear` to wipe the terminal and start a fresh chat, or press <kbd>Ctrl</kbd>+<kbd>L</kbd> to clear the screen without starting a new conversation.

25- Use `/copy` to copy the latest completed Codex output. If a turn is still running, Codex copies the most recent finished output instead of in-progress text.

23- Navigate draft history in the composer with <kbd>Up</kbd>/<kbd>Down</kbd>; Codex restores prior draft text and image placeholders.26- Navigate draft history in the composer with <kbd>Up</kbd>/<kbd>Down</kbd>; Codex restores prior draft text and image placeholders.

24- Press <kbd>Ctrl</kbd>+<kbd>C</kbd> or use `/exit` to close the interactive session when you're done.27- Press <kbd>Ctrl</kbd>+<kbd>C</kbd> or use `/exit` to close the interactive session when you're done.

25 28 


43 46 

44## Models and reasoning47## Models and reasoning

45 48 

46For most coding tasks in Codex, `gpt-5.3-codex` is the go-to model. It’s available for ChatGPT-authenticated Codex sessions in the Codex app, CLI, IDE extension, and Codex Cloud. For extra fast tasks, ChatGPT Pro subscribers have access to the GPT-5.3-Codex-Spark model in research preview.49For most tasks in Codex, `gpt-5.4` is the recommended model. It brings the

50industry-leading coding capabilities of `gpt-5.3-codex` to OpenAI’s flagship

51frontier model, combining frontier coding performance with stronger reasoning,

52native computer use, and broader professional workflows. For extra fast tasks,

53ChatGPT Pro subscribers have access to the GPT-5.3-Codex-Spark model in

54research preview.

47 55 

48Switch models mid-session with the /model command, or specify one when launching the CLI.56Switch models mid-session with the `/model` command, or specify one when launching the CLI.

49 57 

50```bash58```bash

51codex --model gpt-5.3-codex59codex --model gpt-5.4

52```60```

53 61 

54[Learn more about the models available in Codex](https://developers.openai.com/codex/models).62[Learn more about the models available in Codex](https://developers.openai.com/codex/models).


65 73 

66`codex features enable <feature>` and `codex features disable <feature>` write to `~/.codex/config.toml`. If you launch Codex with `--profile`, Codex stores the change in that profile rather than the root configuration.74`codex features enable <feature>` and `codex features disable <feature>` write to `~/.codex/config.toml`. If you launch Codex with `--profile`, Codex stores the change in that profile rather than the root configuration.

67 75 

68## Multi-agents (experimental)76## Subagents

69 77 

70Use Codex multi-agent workflows to parallelize larger tasks. For setup, role configuration (`[agents]` in `config.toml`), and examples, see [Multi-agents](https://developers.openai.com/codex/multi-agent).78Use Codex subagent workflows to parallelize larger tasks. For setup, role configuration (`[agents]` in `config.toml`), and examples, see [Subagents](https://developers.openai.com/codex/subagents).

79 

80Codex only spawns subagents when you explicitly ask it to. Because each

81subagent does its own model and tool work, subagent workflows consume more

82tokens than comparable single-agent runs.

71 83 

72## Image inputs84## Image inputs

73 85 


83 95 

84Codex accepts common formats such as PNG and JPEG. Use comma-separated filenames for two or more images, and combine them with text instructions to add context.96Codex accepts common formats such as PNG and JPEG. Use comma-separated filenames for two or more images, and combine them with text instructions to add context.

85 97 

98## Syntax highlighting and themes

99 

100The TUI syntax-highlights fenced markdown code blocks and file diffs so code is easier to scan during reviews and debugging.

101 

102Use `/theme` to open the theme picker, preview themes live, and save your selection to `tui.theme` in `~/.codex/config.toml`. You can also add custom `.tmTheme` files under `$CODEX_HOME/themes` and select them in the picker.

103 

86## Running local code review104## Running local code review

87 105 

88Type `/review` in the CLI to open Codex's review presets. The CLI launches a dedicated reviewer that reads the diff you select and reports prioritized, actionable findings without touching your working tree. By default it uses the current session model; set `review_model` in `config.toml` to override.106Type `/review` in the CLI to open Codex's review presets. The CLI launches a dedicated reviewer that reads the diff you select and reports prioritized, actionable findings without touching your working tree. By default it uses the current session model; set `review_model` in `config.toml` to override.


96 114 

97## Web search115## Web search

98 116 

99Codex ships with a first-party web search tool. For local tasks in the Codex CLI, Codex enables web search by default and serves results from a web search cache. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you are using `--yolo` or another [full access sandbox setting](https://developers.openai.com/codex/security), web search defaults to live results. To fetch the most recent data, pass `--search` for a single run or set `web_search = "live"` in [Config basics](https://developers.openai.com/codex/config-basic). You can also set `web_search = "disabled"` to turn the tool off.117Codex ships with a first-party web search tool. For local tasks in the Codex CLI, Codex enables web search by default and serves results from a web search cache. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you are using `--yolo` or another [full access sandbox setting](https://developers.openai.com/codex/agent-approvals-security), web search defaults to live results. To fetch the most recent data, pass `--search` for a single run or set `web_search = "live"` in [Config basics](https://developers.openai.com/codex/config-basic). You can also set `web_search = "disabled"` to turn the tool off.

100 118 

101You'll see `web_search` items in the transcript or `codex exec --json` output whenever Codex looks something up.119You'll see `web_search` items in the transcript or `codex exec --json` output whenever Codex looks something up.

102 120 

Details

1# Slash commands in Codex CLI1# Slash commands in Codex CLI

2 2 

3Slash commands give you fast, keyboard-first control over Codex. Type `/` in the composer to open the slash popup, choose a command, and Codex will perform actions such as switching models, adjusting permissions, or summarizing long conversations without leaving the terminal.3Slash commands give you fast, keyboard-first control over Codex. Type `/` in

4the composer to open the slash popup, choose a command, and Codex will perform

5actions such as switching models, adjusting permissions, or summarizing long

6conversations without leaving the terminal.

4 7 

5This guide shows you how to:8This guide shows you how to:

6 9 

7- Find the right built-in slash command for a task10- Find the right built-in slash command for a task

8- Steer an active session with commands like `/model`, `/personality`, `/permissions`, `/experimental`, `/agent`, and `/status`11- Steer an active session with commands like `/model`, `/fast`,

12 `/personality`, `/permissions`, `/agent`, and `/status`

9 13 

10## Built-in slash commands14## Built-in slash commands

11 15 

12Codex ships with the following commands. Open the slash popup and start typing the command name to filter the list.16Codex ships with the following commands. Open the slash popup and start typing

17the command name to filter the list.

13 18 

14| Command | Purpose | When to use it |19| Command | Purpose | When to use it |

15| ------------------------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |20| ------------------------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |

16| [`/permissions`](#update-permissions-with-permissions) | Set what Codex can do without asking first. | Relax or tighten approval requirements mid-session, such as switching between Auto and Read Only. |21| [`/permissions`](#update-permissions-with-permissions) | Set what Codex can do without asking first. | Relax or tighten approval requirements mid-session, such as switching between Auto and Read Only. |

17| [`/sandbox-add-read-dir`](#grant-sandbox-read-access-with-sandbox-add-read-dir) | Grant sandbox read access to an extra directory (Windows only). | Unblock commands that need to read an absolute directory path outside the current readable roots. |22| [`/sandbox-add-read-dir`](#grant-sandbox-read-access-with-sandbox-add-read-dir) | Grant sandbox read access to an extra directory (Windows only). | Unblock commands that need to read an absolute directory path outside the current readable roots. |

18| [`/agent`](#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned sub-agent thread. |23| [`/agent`](#switch-agent-threads-with-agent) | Switch the active agent thread. | Inspect or continue work in a spawned subagent thread. |

19| [`/apps`](#browse-apps-with-apps) | Browse apps (connectors) and insert them into your prompt. | Attach an app as `$app-slug` before asking Codex to use it. |24| [`/apps`](#browse-apps-with-apps) | Browse apps (connectors) and insert them into your prompt. | Attach an app as `$app-slug` before asking Codex to use it. |

25| [`/clear`](#clear-the-terminal-and-start-a-new-chat-with-clear) | Clear the terminal and start a fresh chat. | Reset the visible UI and conversation together when you want a clean slate. |

20| [`/compact`](#keep-transcripts-lean-with-compact) | Summarize the visible conversation to free tokens. | Use after long runs so Codex retains key points without blowing the context window. |26| [`/compact`](#keep-transcripts-lean-with-compact) | Summarize the visible conversation to free tokens. | Use after long runs so Codex retains key points without blowing the context window. |

27| [`/copy`](#copy-the-latest-response-with-copy) | Copy the latest completed Codex output. | Grab the latest finished response or plan text without manually selecting it. |

21| [`/diff`](#review-changes-with-diff) | Show the Git diff, including files Git isn't tracking yet. | Review Codex's edits before you commit or run tests. |28| [`/diff`](#review-changes-with-diff) | Show the Git diff, including files Git isn't tracking yet. | Review Codex's edits before you commit or run tests. |

22| [`/exit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI (same as `/quit`). | Alternative spelling; both commands exit the session. |29| [`/exit`](#exit-the-cli-with-quit-or-exit) | Exit the CLI (same as `/quit`). | Alternative spelling; both commands exit the session. |

23| [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable optional features such as sub-agents from the CLI. |30| [`/experimental`](#toggle-experimental-features-with-experimental) | Toggle experimental features. | Enable optional features such as subagents from the CLI. |

24| [`/feedback`](#send-feedback-with-feedback) | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |31| [`/feedback`](#send-feedback-with-feedback) | Send logs to the Codex maintainers. | Report issues or share diagnostics with support. |

25| [`/init`](#generate-agentsmd-with-init) | Generate an `AGENTS.md` scaffold in the current directory. | Capture persistent instructions for the repository or subdirectory you're working in. |32| [`/init`](#generate-agentsmd-with-init) | Generate an `AGENTS.md` scaffold in the current directory. | Capture persistent instructions for the repository or subdirectory you're working in. |

26| [`/logout`](#sign-out-with-logout) | Sign out of Codex. | Clear local credentials when using a shared machine. |33| [`/logout`](#sign-out-with-logout) | Sign out of Codex. | Clear local credentials when using a shared machine. |

27| [`/mcp`](#list-mcp-tools-with-mcp) | List configured Model Context Protocol (MCP) tools. | Check which external tools Codex can call during the session. |34| [`/mcp`](#list-mcp-tools-with-mcp) | List configured Model Context Protocol (MCP) tools. | Check which external tools Codex can call during the session. |

28| [`/mention`](#highlight-files-with-mention) | Attach a file to the conversation. | Point Codex at specific files or folders you want it to inspect next. |35| [`/mention`](#highlight-files-with-mention) | Attach a file to the conversation. | Point Codex at specific files or folders you want it to inspect next. |

29| [`/model`](#set-the-active-model-with-model) | Choose the active model (and reasoning effort, when available). | Switch between general-purpose models (`gpt-4.1-mini`) and deeper reasoning models before running a task. |36| [`/model`](#set-the-active-model-with-model) | Choose the active model (and reasoning effort, when available). | Switch between general-purpose models (`gpt-4.1-mini`) and deeper reasoning models before running a task. |

37| [`/fast`](#toggle-fast-mode-with-fast) | Toggle Fast mode for GPT-5.4. | Turn Fast mode on or off, or check whether the current thread is using it. |

30| [`/plan`](#switch-to-plan-mode-with-plan) | Switch to plan mode and optionally send a prompt. | Ask Codex to propose an execution plan before implementation work starts. |38| [`/plan`](#switch-to-plan-mode-with-plan) | Switch to plan mode and optionally send a prompt. | Ask Codex to propose an execution plan before implementation work starts. |

31| [`/personality`](#set-a-communication-style-with-personality) | Choose a communication style for responses. | Make Codex more concise, more explanatory, or more collaborative without changing your instructions. |39| [`/personality`](#set-a-communication-style-with-personality) | Choose a communication style for responses. | Make Codex more concise, more explanatory, or more collaborative without changing your instructions. |

32| [`/ps`](#check-background-terminals-with-ps) | Show experimental background terminals and their recent output. | Check long-running commands without leaving the main transcript. |40| [`/ps`](#check-background-terminals-with-ps) | Show experimental background terminals and their recent output. | Check long-running commands without leaving the main transcript. |


39| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |47| [`/debug-config`](#inspect-config-layers-with-debug-config) | Print config layer and requirements diagnostics. | Debug precedence and policy requirements, including experimental network constraints. |

40| [`/statusline`](#configure-footer-items-with-statusline) | Configure TUI status-line fields interactively. | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist in config.toml. |48| [`/statusline`](#configure-footer-items-with-statusline) | Configure TUI status-line fields interactively. | Pick and reorder footer items (model/context/limits/git/tokens/session) and persist in config.toml. |

41 49 

42`/quit` and `/exit` both exit the CLI. Use them only after you have saved or committed any important work.50`/quit` and `/exit` both exit the CLI. Use them only after you have saved or

51committed any important work.

43 52 

44The `/approvals` command still works as an alias, but it no longer appears in the slash popup list.53The `/approvals` command still works as an alias, but it no longer appears in the slash popup list.

45 54 


55 64 

56Expected: Codex confirms the new model in the transcript. Run `/status` to verify the change.65Expected: Codex confirms the new model in the transcript. Run `/status` to verify the change.

57 66 

67### Toggle Fast mode with `/fast`

68 

691. Type `/fast on`, `/fast off`, or `/fast status`.

702. If you want the setting to persist, confirm the update when Codex offers to save it.

71 

72Expected: Codex reports whether Fast mode is on or off for the current thread. In the TUI footer, you can also show a Fast mode status-line item with `/statusline`.

73 

58### Set a communication style with `/personality`74### Set a communication style with `/personality`

59 75 

60Use `/personality` to change how Codex communicates without rewriting your prompt.76Use `/personality` to change how Codex communicates without rewriting your prompt.


621. In an active conversation, type `/personality` and press Enter.781. In an active conversation, type `/personality` and press Enter.

632. Choose a style from the popup.792. Choose a style from the popup.

64 80 

65Expected: Codex confirms the new style in the transcript and uses it for later responses in the thread.81Expected: Codex confirms the new style in the transcript and uses it for later

82responses in the thread.

66 83 

67Codex supports `friendly`, `pragmatic`, and `none` personalities. Use `none` to disable personality instructions.84Codex supports `friendly`, `pragmatic`, and `none` personalities. Use `none`

85to disable personality instructions.

68 86 

69If the active model doesn't support personality-specific instructions, Codex hides this command.87If the active model doesn't support personality-specific instructions, Codex hides this command.

70 88 

71### Switch to plan mode with `/plan`89### Switch to plan mode with `/plan`

72 90 

731. Type `/plan` and press Enter to switch the active conversation into plan mode.911. Type `/plan` and press Enter to switch the active conversation into plan

92 mode.

742. Optional: provide inline prompt text (for example, `/plan Propose a migration plan for this service`).932. Optional: provide inline prompt text (for example, `/plan Propose a migration plan for this service`).

753. You can paste content or attach images while using inline `/plan` arguments.943. You can paste content or attach images while using inline `/plan` arguments.

76 95 


81### Toggle experimental features with `/experimental`100### Toggle experimental features with `/experimental`

82 101 

831. Type `/experimental` and press Enter.1021. Type `/experimental` and press Enter.

842. Toggle the features you want (for example, **Multi-agents**), then restart Codex.1032. Toggle the features you want (for example, Apps or Smart Approvals), then restart Codex if the prompt asks you to.

85 104 

86Expected: Codex saves your feature choices to config and applies them on restart.105Expected: Codex saves your feature choices to config and applies them on restart.

87 106 

107### Clear the terminal and start a new chat with `/clear`

108 

1091. Type `/clear` and press Enter.

110 

111Expected: Codex clears the terminal, resets the visible transcript, and starts

112a fresh chat in the same CLI session.

113 

114Unlike <kbd>Ctrl</kbd>+<kbd>L</kbd>, `/clear` starts a new conversation.

115 

116<kbd>Ctrl</kbd>+<kbd>L</kbd> only clears the terminal view and keeps the current

117chat. Codex disables both actions while a task is in progress.

118 

88### Update permissions with `/permissions`119### Update permissions with `/permissions`

89 120 

901. Type `/permissions` and press Enter.1211. Type `/permissions` and press Enter.

912. Select the approval preset that matches your comfort level, for example `Auto` for hands-off runs or `Read Only` to review edits.1222. Select the approval preset that matches your comfort level, for example

123 `Auto` for hands-off runs or `Read Only` to review edits.

124 

125Expected: Codex announces the updated policy. Future actions respect the

126updated approval mode until you change it again.

127 

128### Copy the latest response with `/copy`

92 129 

93Expected: Codex announces the updated policy. Future actions respect the new approval mode until you change it again.1301. Type `/copy` and press Enter.

131 

132Expected: Codex copies the latest completed Codex output to your clipboard.

133 

134If a turn is still running, `/copy` uses the latest completed output instead of

135the in-progress response. The command is unavailable before the first completed

136Codex output and immediately after a rollback.

94 137 

95### Grant sandbox read access with `/sandbox-add-read-dir`138### Grant sandbox read access with `/sandbox-add-read-dir`

96 139 


991. Type `/sandbox-add-read-dir C:\absolute\directory\path` and press Enter.1421. Type `/sandbox-add-read-dir C:\absolute\directory\path` and press Enter.

1002. Confirm the path is an existing absolute directory.1432. Confirm the path is an existing absolute directory.

101 144 

102Expected: Codex refreshes the Windows sandbox policy and grants read access to that directory for later commands that run in the sandbox.145Expected: Codex refreshes the Windows sandbox policy and grants read access to

146that directory for later commands that run in the sandbox.

103 147 

104### Inspect the session with `/status`148### Inspect the session with `/status`

105 149 

1061. In any conversation, type `/status`.1501. In any conversation, type `/status`.

1072. Review the output for the active model, approval policy, writable roots, and current token usage.1512. Review the output for the active model, approval policy, writable roots, and current token usage.

108 152 

109Expected: You see a summary like what `codex status` prints in the shell, confirming Codex is operating where you expect.153Expected: You see a summary like what `codex status` prints in the shell,

154confirming Codex is operating where you expect.

110 155 

111### Inspect config layers with `/debug-config`156### Inspect config layers with `/debug-config`

112 157 

1131. Type `/debug-config`.1581. Type `/debug-config`.

1142. Review the output for config layer order (lowest precedence first), on/off state, and policy sources.1592. Review the output for config layer order (lowest precedence first), on/off

160 state, and policy sources.

115 161 

116Expected: Codex prints layer diagnostics plus policy details such as `allowed_approval_policies`, `allowed_sandbox_modes`, `mcp_servers`, `rules`, `enforce_residency`, and `experimental_network` when configured.162Expected: Codex prints layer diagnostics plus policy details such as

163`allowed_approval_policies`, `allowed_sandbox_modes`, `mcp_servers`, `rules`,

164`enforce_residency`, and `experimental_network` when configured.

117 165 

118Use this output to debug why an effective setting differs from `config.toml`.166Use this output to debug why an effective setting differs from `config.toml`.

119 167 


1221. Type `/statusline`.1701. Type `/statusline`.

1232. Use the picker to toggle and reorder items, then confirm.1712. Use the picker to toggle and reorder items, then confirm.

124 172 

125Expected: The footer status line updates immediately and persists to `tui.status_line` in `config.toml`.173Expected: The footer status line updates immediately and persists to

174`tui.status_line` in `config.toml`.

126 175 

127Available status-line items include model, model+reasoning, context stats, rate limits, git branch, token counters, session id, current directory/project root, and Codex version.176Available status-line items include model, model+reasoning, context stats, rate

177limits, git branch, token counters, session id, current directory/project root,

178and Codex version.

128 179 

129### Check background terminals with `/ps`180### Check background terminals with `/ps`

130 181 

1311. Type `/ps`.1821. Type `/ps`.

1322. Review the list of background terminals and their status.1832. Review the list of background terminals and their status.

133 184 

134Expected: Codex shows each background terminals command plus up to three recent, non-empty output lines so you can gauge progress at a glance.185Expected: Codex shows each background terminal's command plus up to three

186recent, non-empty output lines so you can gauge progress at a glance.

135 187 

136Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.188Background terminals appear when `unified_exec` is in use; otherwise, the list may be empty.

137 189 


1401. After a long exchange, type `/compact`.1921. After a long exchange, type `/compact`.

1412. Confirm when Codex offers to summarize the conversation so far.1932. Confirm when Codex offers to summarize the conversation so far.

142 194 

143Expected: Codex replaces earlier turns with a concise summary, freeing context while keeping critical details.195Expected: Codex replaces earlier turns with a concise summary, freeing context

196while keeping critical details.

144 197 

145### Review changes with `/diff`198### Review changes with `/diff`

146 199 

1471. Type `/diff` to inspect the Git diff.2001. Type `/diff` to inspect the Git diff.

1482. Scroll through the output inside the CLI to review edits and added files.2012. Scroll through the output inside the CLI to review edits and added files.

149 202 

150Expected: Codex shows changes youve staged, changes you havent staged yet, and files Git hasn’t started tracking, so you can decide what to keep.203Expected: Codex shows changes you've staged, changes you haven't staged yet,

204and files Git hasn't started tracking, so you can decide what to keep.

151 205 

152### Highlight files with `/mention`206### Highlight files with `/mention`

153 207 


160 214 

1611. Type `/new` and press Enter.2151. Type `/new` and press Enter.

162 216 

163Expected: Codex starts a fresh conversation in the same CLI session, so you can switch tasks without leaving your terminal.217Expected: Codex starts a fresh conversation in the same CLI session, so you

218can switch tasks without leaving your terminal.

219 

220Unlike `/clear`, `/new` does not clear the current terminal view first.

164 221 

165### Resume a saved conversation with `/resume`222### Resume a saved conversation with `/resume`

166 223 

1671. Type `/resume` and press Enter.2241. Type `/resume` and press Enter.

1682. Choose the session you want from the saved-session picker.2252. Choose the session you want from the saved-session picker.

169 226 

170Expected: Codex reloads the selected conversations transcript so you can pick up where you left off, keeping the original history intact.227Expected: Codex reloads the selected conversation's transcript so you can pick

228up where you left off, keeping the original history intact.

171 229 

172### Fork the current conversation with `/fork`230### Fork the current conversation with `/fork`

173 231 

1741. Type `/fork` and press Enter.2321. Type `/fork` and press Enter.

175 233 

176Expected: Codex clones the current conversation into a new thread with a fresh ID, leaving the original transcript untouched so you can explore an alternative approach in parallel.234Expected: Codex clones the current conversation into a new thread with a fresh

235ID, leaving the original transcript untouched so you can explore an alternative

236approach in parallel.

177 237 

178If you need to fork a saved session instead of the current one, run `codex fork` in your terminal to open the session picker.238If you need to fork a saved session instead of the current one, run

239`codex fork` in your terminal to open the session picker.

179 240 

180### Generate `AGENTS.md` with `/init`241### Generate `AGENTS.md` with `/init`

181 242 

1821. Run `/init` in the directory where you want Codex to look for persistent instructions.2431. Run `/init` in the directory where you want Codex to look for persistent instructions.

1832. Review the generated `AGENTS.md`, then edit it to match your repository conventions.2442. Review the generated `AGENTS.md`, then edit it to match your repository conventions.

184 245 

185Expected: Codex creates an `AGENTS.md` scaffold you can refine and commit for future sessions.246Expected: Codex creates an `AGENTS.md` scaffold you can refine and commit for

247future sessions.

186 248 

187### Ask for a working tree review with `/review`249### Ask for a working tree review with `/review`

188 250 

1891. Type `/review`.2511. Type `/review`.

1902. Follow up with `/diff` if you want to inspect the exact file changes.2522. Follow up with `/diff` if you want to inspect the exact file changes.

191 253 

192Expected: Codex summarizes issues it finds in your working tree, focusing on behavior changes and missing tests. It uses the current session model unless you set `review_model` in `config.toml`.254Expected: Codex summarizes issues it finds in your working tree, focusing on

255behavior changes and missing tests. It uses the current session model unless

256you set `review_model` in `config.toml`.

193 257 

194### List MCP tools with `/mcp`258### List MCP tools with `/mcp`

195 259 


2031. Type `/apps`.2671. Type `/apps`.

2042. Pick an app from the list.2682. Pick an app from the list.

205 269 

206Expected: Codex inserts the app mention into the composer as `$app-slug`, so you can immediately ask Codex to use it.270Expected: Codex inserts the app mention into the composer as `$app-slug`, so

271you can immediately ask Codex to use it.

207 272 

208### Switch agent threads with `/agent`273### Switch agent threads with `/agent`

209 274 

2101. Type `/agent` and press Enter.2751. Type `/agent` and press Enter.

2112. Select the thread you want from the picker.2762. Select the thread you want from the picker.

212 277 

213Expected: Codex switches the active thread so you can inspect or continue that agent’s work.278Expected: Codex switches the active thread so you can inspect or continue that

279agent's work.

214 280 

215### Send feedback with `/feedback`281### Send feedback with `/feedback`

216 282 

2171. Type `/feedback` and press Enter.2831. Type `/feedback` and press Enter.

2182. Follow the prompts to include logs or diagnostics.2842. Follow the prompts to include logs or diagnostics.

219 285 

220Expected: Codex collects the requested diagnostics and submits them to the maintainers.286Expected: Codex collects the requested diagnostics and submits them to the

287maintainers.

221 288 

222### Sign out with `/logout`289### Sign out with `/logout`

223 290 

codex.md +6 −2

Details

22 22 

23 Learn more](https://developers.openai.com/codex/explore) [### Community23 Learn more](https://developers.openai.com/codex/explore) [### Community

24 24 

25Join the OpenAI Discord to ask questions, share workflows and connect with others.25Read community posts, explore meetups, and connect with Codex builders.

26 26 

27 Join the Discord](https://discord.gg/openai)27 See community](/community) [### Codex for Open Source

28 

29Apply or nominate maintainers for API credits, ChatGPT Pro with Codex, and selective Codex Security access.

30 

31 Learn more](https://developers.openai.com/community/codex-for-oss)

codex-for-oss-terms.md +47 −0 added

Details

1# Codex for Open Source Program Terms

2 

3These Program Terms govern the Codex for OSS program (the "Program") offered by OpenAI OpCo, LLC and its affiliates ("OpenAI," "we," "our," or "us"). By submitting an application to the Program or accepting any Program benefit, you agree to these Program Terms.

4 

5These Program Terms supplement, and do not replace, the OpenAI Terms of Use, Privacy Policy, applicable service terms, and OpenAI policies that govern your use of ChatGPT, Codex, the API, and any other OpenAI services made available through the Program. If there is a conflict, these Program Terms control only with respect to the Program.

6 

7## 1. Program Overview

8 

9The Program is designed to support maintainers of important open-source software. Approved applicants may receive one or more of the following benefits, as determined by OpenAI in its sole discretion: (i) a limited-duration ChatGPT Pro benefit that includes Codex access; (ii) API credits for eligible open-source maintainer workflows; and (iii) conditional access to Codex Security for qualified repositories or maintainers. Availability, duration, scope, and timing of any benefit may vary by applicant, repository, or use case.

10 

11## 2. Eligibility and Applications

12 

13To be considered for the Program, applicants must have a valid ChatGPT account and provide accurate and complete information about themselves, their repositories, and their role in maintaining or administering those repositories. OpenAI may consider factors such as repository usage, ecosystem importance, evidence of active maintenance, role or permissions, and Program capacity. Submission of an application does not guarantee selection, funding, or access.

14 

15## 3. Selection and Verification

16 

17OpenAI may approve or deny applications in its sole discretion. OpenAI may request additional information to verify identity, repository affiliation, maintainer status, or repository control, and may condition any benefit on successful verification. OpenAI's decisions are final.

18 

19## 4. Benefits

20 

21Unless OpenAI states otherwise in writing, Program benefits are personal, limited, non-transferable, and have no cash value. Program benefits may not be sold, assigned, sublicensed, exchanged, or shared. If OpenAI provides a redemption code, invitation, or activation flow, the recipient must follow the applicable redemption instructions and any additional redemption terms communicated by OpenAI. Benefits may expire if they are not redeemed or activated within the period specified by OpenAI.

22 

23## 5. Additional Conditions for Codex Security and API Credits

24 

25Codex Security access and API credits are optional, additional Program benefits and may require separate review, additional eligibility checks, and/or additional terms. OpenAI may limit Codex Security access to repositories that the applicant owns, maintains, or is otherwise authorized to administer.

26 

27Applicants may not use the Program, including Codex Security, to scan, probe, test, or review repositories, systems, or codebases that they do not own or lack permission to review. OpenAI may require proof of control or authorization before granting or continuing such access and may limit or revoke access at any time if authorization is unclear or no longer valid.

28 

29## 6. Fraud, Abuse, and Revocation

30 

31OpenAI may reject, suspend, or revoke any Program benefit for any reason in its sole discretion, including without limitation if it reasonably believes that an applicant or recipient: (i) provided false, misleading, or incomplete information; (ii) used multiple identities or accounts to obtain more than one benefit; (iii) transferred, resold, or shared a benefit; (iv) violated OpenAI's terms or policies; (v) used the Program in a harmful, abusive, fraudulent, or unauthorized manner; or (vi) otherwise created legal, security, reputational, or operational risk for OpenAI or others.

32 

33## 7. Submission Similarity; No Exclusivity; No Confidentiality

34 

35The applicant acknowledges that OpenAI may currently or in the future develop, receive, review, fund, support, or work with ideas, projects, repositories, workflows, or proposals that are similar or identical to the applicant's submission. Nothing in these Program Terms prevents OpenAI from independently developing, funding, or supporting any such similar or identical work.

36 

37The applicant further acknowledges that OpenAI assumes no obligation of exclusivity with respect to any submission and that any decision to select, fund, or support a project or maintainer is made in OpenAI's sole discretion.

38 

39Except as described in OpenAI's privacy policy or as required by law, applicants should not submit confidential information in connection with the Program, and OpenAI has no duty to treat application materials as confidential.

40 

41## 8. Program Changes

42 

43OpenAI may modify, pause, limit, or discontinue the Program, its eligibility criteria, or any Program benefit at any time. OpenAI may also update these Program Terms from time to time. Continued participation in the Program after an update constitutes acceptance of the revised Program Terms.

44 

45## 9. Taxes and Local Restrictions

46 

47Recipients are responsible for any taxes, reporting obligations, or local legal requirements that may apply to receipt or use of Program benefits. The Program is void where prohibited or restricted by law.

concepts/customization.md +156 −0 added

Details

1# Customization

2 

3Customization is how you make Codex work the way your team works.

4 

5In Codex, customization comes from a few layers that work together:

6 

7- **Project guidance (`AGENTS.md`)** for persistent instructions

8- **Skills** for reusable workflows and domain expertise

9- **[MCP](https://developers.openai.com/codex/mcp)** for access to external tools and shared systems

10- **[Subagents](https://developers.openai.com/codex/concepts/subagents)** for delegating work to specialized subagents

11 

12These are complementary, not competing. `AGENTS.md` shapes behavior, skills package repeatable processes, and [MCP](https://developers.openai.com/codex/mcp) connects Codex to systems outside the local workspace.

13 

14## AGENTS Guidance

15 

16`AGENTS.md` gives Codex durable project guidance that travels with your repository and applies before the agent starts work. Keep it small.

17 

18Use it for the rules you want Codex to follow every time in a repo, such as:

19 

20- Build and test commands

21- Review expectations

22- repo-specific conventions

23- Directory-specific instructions

24 

25When the agent makes incorrect assumptions about your codebase, correct them in `AGENTS.md` and ask the agent to update `AGENTS.md` so the fix persists. Treat it as a feedback loop.

26 

27**Updating `AGENTS.md`:** Start with only the instructions that matter. Codify recurring review feedback, put guidance in the closest directory where it applies, and tell the agent to update `AGENTS.md` when you correct something so future sessions inherit the fix.

28 

29### When to update `AGENTS.md`

30 

31- **Repeated mistakes**: If the agent makes the same mistake repeatedly, add a rule.

32- **Too much reading**: If it finds the right files but reads too many documents, add routing guidance (which directories/files to prioritize).

33- **Recurring PR feedback**: If you leave the same feedback more than once, codify it.

34- **In GitHub**: In a pull request comment, tag `@codex` with a request (for example, `@codex add this to AGENTS.md`) to delegate the update to a cloud task.

35- **Automate drift checks**: Use [automations](https://developers.openai.com/codex/app/automations) to run recurring checks (for example, daily) that look for guidance gaps and suggest what to add to `AGENTS.md`.

36 

37Pair `AGENTS.md` with infrastructure that enforces those rules: pre-commit hooks, linters, and type checkers catch issues before you see them, so the system gets smarter about preventing recurring mistakes.

38 

39Codex can load guidance from multiple locations: a global file in your Codex home directory (for you as a developer) and repo-specific files that teams can check in. Files closer to the working directory take precedence.

40Use the global file to shape how Codex communicates with you (for example, review style, verbosity, and defaults), and keep repo files focused on team and codebase rules.

41 

42- ~/.codex/

43 

44 - AGENTS.md Global (for you as a developer)

45- repo-root/

46 

47 - AGENTS.md repo-specific (for your team)

48 

49[Custom instructions with AGENTS.md](https://developers.openai.com/codex/guides/agents-md)

50 

51## Skills

52 

53Skills give Codex reusable capabilities for repeatable workflows.

54Skills are often the best fit for reusable workflows because they support richer instructions, scripts, and references while staying reusable across tasks.

55Skills are loaded and visible to the agent (at least their metadata), so Codex can discover and choose them implicitly. This keeps rich workflows available without bloating context up front.

56 

57Use skill folders to author and iterate on workflows locally. If a plugin

58already exists for the workflow, install it first to reuse a proven setup. When

59you want to distribute your own workflow across teams or bundle it with app

60integrations, package it as a [plugin](https://developers.openai.com/codex/plugins/build). Skills remain the

61authoring format; plugins are the installable distribution unit.

62 

63A skill is typically a `SKILL.md` file plus optional scripts, references, and assets.

64 

65- my-skill/

66 

67 - SKILL.md Required: instructions + metadata

68 - scripts/ Optional: executable code

69 - references/ Optional: documentation

70 - assets/ Optional: templates, resources

71 

72The skill directory can include a `scripts/` folder with CLI scripts that Codex invokes as part of the workflow (for example, seed data or run validations). When the workflow needs external systems (issue trackers, design tools, docs servers), pair the skill with [MCP](https://developers.openai.com/codex/mcp).

73 

74Example `SKILL.md`:

75 

76```md

77---

78name: commit

79description: Stage and commit changes in semantic groups. Use when the user wants to commit, organize commits, or clean up a branch before pushing.

80---

81 

821. Do not run `git add .`. Stage files in logical groups by purpose.

832. Group into separate commits: feat → test → docs → refactor → chore.

843. Write concise commit messages that match the change scope.

854. Keep each commit focused and reviewable.

86```

87 

88Use skills for:

89 

90- Repeatable workflows (release steps, review routines, docs updates)

91- Team-specific expertise

92- Procedures that need examples, references, or helper scripts

93 

94Skills can be global (in your user directory, for you as a developer) or repo-specific (checked into `.agents/skills`, for your team). Put repo skills in `.agents/skills` when the workflow applies to that project; use your user directory for skills you want across all repos.

95 

96| Layer | Global | Repo |

97| :----- | :--------------------- | :--------------------------------------------- |

98| AGENTS | `~/.codex/AGENTS.md` | `AGENTS.md` in repo root or nested directories |

99| Skills | `$HOME/.agents/skills` | `.agents/skills` in repo |

100 

101Codex uses progressive disclosure for skills:

102 

103- It starts with metadata (`name`, `description`) for discovery

104- It loads `SKILL.md` only when a skill is chosen

105- It reads references or runs scripts only when needed

106 

107Skills can be invoked explicitly, and Codex can also choose them implicitly when the task matches the skill description. Clear skill descriptions improve triggering reliability.

108 

109[Agent Skills](https://developers.openai.com/codex/skills)

110 

111## MCP

112 

113MCP (Model Context Protocol) is the standard way to connect Codex to external tools and context providers.

114It's especially useful for remotely hosted systems such as Figma, Linear, GitHub, or internal knowledge services your team depends on.

115 

116Use MCP when Codex needs capabilities that live outside the local repo, such as issue trackers, design tools, browsers, or shared documentation systems.

117 

118One way to think about it:

119 

120- **Host**: Codex

121- **Client**: the MCP connection inside Codex

122- **Server**: the external tool or context provider

123 

124MCP servers can expose:

125 

126- **Tools** (actions)

127- **Resources** (readable data)

128- **Prompts** (reusable prompt templates)

129 

130This separation helps you reason about trust and capability boundaries. Some servers mainly provide context, while others expose powerful actions.

131 

132In practice, MCP is often most useful when paired with skills:

133 

134- A skill defines the workflow and names the MCP tools to use

135 

136[Model Context Protocol](https://developers.openai.com/codex/mcp)

137 

138## Subagents

139 

140You can create different agents with different roles and prompt them to use tools differently. For example, one agent might run specific testing commands and configurations, while another has MCP servers that fetch production logs for debugging. Each subagent stays focused and uses the right tools for its job.

141 

142[Subagent concepts](https://developers.openai.com/codex/concepts/subagents)

143 

144## Skills + MCP together

145 

146Skills plus MCP is where it all comes together: skills define repeatable workflows, and MCP connects them to external tools and systems.

147If a skill depends on MCP, declare that dependency in `agents/openai.yaml` so Codex can install and wire it automatically (see [Agent Skills](https://developers.openai.com/codex/skills)).

148 

149## Next step

150 

151Build in this order:

152 

1531. [Custom instructions with AGENTS.md](https://developers.openai.com/codex/guides/agents-md) so Codex follows your repo conventions. Add pre-commit hooks and linters to enforce those rules.

1542. Install a [plugin](https://developers.openai.com/codex/plugins) when a reusable workflow already exists. Otherwise, create a [skill](https://developers.openai.com/codex/skills) and package it as a plugin when you want to share it.

1553. [MCP](https://developers.openai.com/codex/mcp) when workflows need external systems (Linear, GitHub, docs servers, design tools).

1564. [Subagents](https://developers.openai.com/codex/subagents) when you're ready to delegate noisy or specialized tasks to subagents.

concepts/sandboxing.md +102 −0 added

Details

1# Sandboxing – Codex

2 

3Sandboxing is the boundary that lets Codex act autonomously without giving it

4unrestricted access to your machine. When Codex runs local commands in the

5**Codex app**, **IDE extension**, or **CLI**, those commands run inside a

6constrained environment instead of running with full access by default.

7 

8That environment defines what Codex can do on its own, such as which files it

9can modify and whether commands can use the network. When a task stays inside

10those boundaries, Codex can keep moving without stopping for confirmation. When

11it needs to go beyond them, Codex falls back to the approval flow.

12 

13Sandboxing and approvals are different controls that work together. The

14 sandbox defines technical boundaries. The approval policy decides when Codex

15 must stop and ask before crossing them.

16 

17## What the sandbox does

18 

19The sandbox applies to spawned commands, not just to Codex's built-in file

20operations. If Codex runs tools like `git`, package managers, or test runners,

21those commands inherit the same sandbox boundaries.

22 

23Codex uses platform-native enforcement on each OS. The implementation differs

24between macOS, Linux, WSL, and native Windows, but the idea is the same across

25surfaces: give the agent a bounded place to work so routine tasks can run

26autonomously inside clear limits.

27 

28## Why it matters

29 

30Sandboxing reduces approval fatigue. Instead of asking you to confirm every

31low-risk command, Codex can read files, make edits, and run routine project

32commands within the boundary you already approved.

33 

34It also gives you a clearer trust model for agentic work. You are not just

35trusting the agent's intentions; you are trusting that the agent is operating

36inside enforced limits. That makes it easier to let Codex work independently

37while still knowing when it will stop and ask for help.

38 

39## How you control it

40 

41Most people start with the permissions controls in the product.

42 

43In the Codex app and IDE, you choose a mode from the permissions selector under

44the composer or chat input. That selector lets you rely on Codex's default

45permissions, switch to full access, or use your custom configuration.

46 

47![Codex app permissions selector showing Default permissions, Full access, and Custom (config.toml)](/images/codex/app/permissions-selector-light.webp)

48 

49In the CLI, use [`/permissions`](https://developers.openai.com/codex/cli/slash-commands#update-permissions-with-permissions)

50to switch modes during a session.

51 

52## Configure defaults

53 

54If you want Codex to start with the same behavior every time, use a custom

55configuration. Codex stores those defaults in `config.toml`, its local settings

56file. [Config basics](https://developers.openai.com/codex/config-basic) explains how it works, and the

57[Configuration reference](https://developers.openai.com/codex/config-reference) documents the exact keys for

58`sandbox_mode`, `approval_policy`, and

59`sandbox_workspace_write.writable_roots`. Use those settings to decide how much

60autonomy Codex gets by default, which directories it can write to, and when it

61should pause for approval.

62 

63At a high level, the common sandbox modes are:

64 

65- `read-only`: Codex can inspect files, but it cannot edit files or run

66 commands without approval.

67- `workspace-write`: Codex can read files, edit within the workspace, and run

68 routine local commands inside that boundary. This is the default low-friction

69 mode for local work.

70- `danger-full-access`: Codex runs without sandbox restrictions. This removes

71 the filesystem and network boundaries and should be used only when you want

72 Codex to act with full access.

73 

74The common approval policies are:

75 

76- `untrusted`: Codex asks before running commands that are not in its trusted

77 set.

78- `on-request`: Codex works inside the sandbox by default and asks when it

79 needs to go beyond that boundary.

80- `never`: Codex does not stop for approval prompts.

81 

82Full access means using `sandbox_mode = "danger-full-access"` together with

83`approval_policy = "never"`. By contrast, `--full-auto` is the lower-risk local

84automation preset: `sandbox_mode = "workspace-write"` and

85`approval_policy = "on-request"`.

86 

87If you need Codex to work across more than one directory, writable roots let

88you extend the places it can modify without removing the sandbox entirely. If

89you need a broader or narrower trust boundary, adjust the default sandbox mode

90and approval policy instead of relying on ad hoc exceptions.

91 

92When a workflow needs a specific exception, use [rules](https://developers.openai.com/codex/rules). Rules

93let you allow, prompt, or forbid command prefixes outside the sandbox, which is

94often a better fit than broadly expanding access. For a higher-level overview

95of approvals and sandbox behavior in the app, see

96[Codex app features](https://developers.openai.com/codex/app/features#approvals-and-sandboxing), and for the

97IDE-specific settings entry points, see [Codex IDE extension settings](https://developers.openai.com/codex/ide/settings).

98 

99Platform details live in the platform-specific docs. For native Windows setup,

100behavior, and troubleshooting, see [Windows](https://developers.openai.com/codex/windows). For admin

101requirements and organization-level constraints on sandboxing and approvals, see

102[Agent approvals & security](https://developers.openai.com/codex/agent-approvals-security).

concepts/subagents.md +90 −0 added

Details

1# Subagents

2 

3Codex can run subagent workflows by spawning specialized agents in parallel so

4they can explore, tackle, or analyze work concurrently.

5 

6This page explains the core concepts and tradeoffs. For setup, agent configuration, and examples, see [Subagents](https://developers.openai.com/codex/subagents).

7 

8## Why subagent workflows help

9 

10Even with large context windows, models have limits. If you flood the main conversation (where you're defining requirements, constraints, and decisions) with noisy intermediate output such as exploration notes, test logs, stack traces, and command output, the session can become less reliable over time.

11 

12This is often described as:

13 

14- **Context pollution**: useful information gets buried under noisy intermediate output.

15- **Context rot**: performance degrades as the conversation fills up with less relevant details.

16 

17For background, see the Chroma writeup on [context rot](https://research.trychroma.com/context-rot).

18 

19Subagent workflows help by moving noisy work off the main thread:

20 

21- Keep the **main agent** focused on requirements, decisions, and final outputs.

22- Run specialized **subagents** in parallel for exploration, tests, or log analysis.

23- Return **summaries** from subagents instead of raw intermediate output.

24 

25They can also save time when the work can run independently in parallel, and

26they make larger-shaped tasks more tractable by breaking them into bounded

27pieces. For example, Codex can split analysis of a multi-million-token

28document into smaller problems and return distilled takeaways to the main

29thread.

30 

31As a starting point, use parallel agents for read-heavy tasks such as

32exploration, tests, triage, and summarization. Be more careful with parallel

33write-heavy workflows, because agents editing code at once can create

34conflicts and increase coordination overhead.

35 

36## Core terms

37 

38Codex uses a few related terms in subagent workflows:

39 

40- **Subagent workflow**: A workflow where Codex runs parallel agents and combines their results.

41- **Subagent**: A delegated agent that Codex starts to handle a specific task.

42- **Agent thread**: The CLI thread for an agent, which you can inspect and switch between with `/agent`.

43 

44## Triggering subagent workflows

45 

46Codex doesn't spawn subagents automatically, and it should only use subagents when you

47explicitly ask for subagents or parallel agent work.

48 

49In practice, manual triggering means using direct instructions such as

50"spawn two agents," "delegate this work in parallel," or "use one agent per

51point." Subagent workflows consume more tokens than comparable single-agent runs

52because each subagent does its own model and tool work.

53 

54A good subagent prompt should explain how to divide the work, whether Codex

55should wait for all agents before continuing, and what summary or output to

56return.

57 

58```text

59Review this branch with parallel subagents. Spawn one subagent for security risks, one for test gaps, and one for maintainability. Wait for all three, then summarize the findings by category with file references.

60```

61 

62## Choosing models and reasoning

63 

64Different agents need different model and reasoning settings.

65 

66If you don't pin a model or `model_reasoning_effort`, Codex can choose a setup

67that balances intelligence, speed, and price for the task. It may favor

68`gpt-5.4-mini` for fast scans or a higher-effort `gpt-5.4`

69configuration for more demanding reasoning. When you want finer control, steer that

70choice in your prompt or set `model` and `model_reasoning_effort` directly in

71the agent file.

72 

73For most tasks in Codex, start with `gpt-5.4`. Use `gpt-5.4-mini` when you

74want a faster, lower-cost option for lighter subagent work. If you have

75ChatGPT Pro and want near-instant text-only iteration, `gpt-5.3-codex-spark`

76remains available in research preview.

77 

78### Model choice

79 

80- **`gpt-5.4`**: Start here for most agents. It combines strong coding, reasoning, tool use, and broader workflows. The main agent and agents that coordinate ambiguous or multi-step work fit here.

81- **`gpt-5.4-mini`**: Use for agents that favor speed and efficiency over depth, such as exploration, read-heavy scans, large-file review, or processing supporting documents. It works well for parallel workers that return distilled results to the main agent.

82- **`gpt-5.3-codex-spark`**: If you have ChatGPT Pro, use this research preview model for near-instant, text-only iteration when latency matters more than broader capability.

83 

84### Reasoning effort (`model_reasoning_effort`)

85 

86- **`high`**: Use when an agent needs to trace complex logic, check assumptions, or work through edge cases (for example, reviewer or security-focused agents).

87- **`medium`**: A balanced default for most agents.

88- **`low`**: Use when the task is straightforward and speed matters most.

89 

90Higher reasoning effort increases response time and token usage, but it can improve quality for complex work. For details, see [Models](https://developers.openai.com/codex/models), [Config basics](https://developers.openai.com/codex/config-basic), and [Configuration Reference](https://developers.openai.com/codex/config-reference).

config-advanced.md +51 −10

Details

2 2 

3Use these options when you need more control over providers, policies, and integrations. For a quick start, see [Config basics](https://developers.openai.com/codex/config-basic).3Use these options when you need more control over providers, policies, and integrations. For a quick start, see [Config basics](https://developers.openai.com/codex/config-basic).

4 4 

5For background on project guidance, reusable capabilities, custom slash commands, subagent workflows, and integrations, see [Customization](https://developers.openai.com/codex/concepts/customization). For configuration keys, see [Configuration Reference](https://developers.openai.com/codex/config-reference).

6 

5## Profiles7## Profiles

6 8 

7Profiles let you save named sets of configuration values and switch between them from the CLI.9Profiles let you save named sets of configuration values and switch between them from the CLI.


15```toml17```toml

16model = "gpt-5-codex"18model = "gpt-5-codex"

17approval_policy = "on-request"19approval_policy = "on-request"

20model_catalog_json = "/Users/me/.codex/model-catalogs/default.json"

18 21 

19[profiles.deep-review]22[profiles.deep-review]

20model = "gpt-5-pro"23model = "gpt-5-pro"

21model_reasoning_effort = "high"24model_reasoning_effort = "high"

22approval_policy = "never"25approval_policy = "never"

26model_catalog_json = "/Users/me/.codex/model-catalogs/deep-review.json"

23 27 

24[profiles.lightweight]28[profiles.lightweight]

25model = "gpt-4.1"29model = "gpt-4.1"


28 32 

29To make a profile the default, add `profile = "deep-review"` at the top level of `config.toml`. Codex loads that profile unless you override it on the command line.33To make a profile the default, add `profile = "deep-review"` at the top level of `config.toml`. Codex loads that profile unless you override it on the command line.

30 34 

35Profiles can also override `model_catalog_json`. When both the top level and the selected profile set `model_catalog_json`, Codex prefers the profile value.

36 

31## One-off overrides from the CLI37## One-off overrides from the CLI

32 38 

33In addition to editing `~/.codex/config.toml`, you can override configuration for a single run from the CLI:39In addition to editing `~/.codex/config.toml`, you can override configuration for a single run from the CLI:


39 45 

40```shell46```shell

41# Dedicated flag47# Dedicated flag

42codex --model gpt-5.248codex --model gpt-5.4

43 49 

44# Generic key/value override (value is TOML, not JSON)50# Generic key/value override (value is TOML, not JSON)

45codex --config model='"gpt-5.2"'51codex --config model='"gpt-5.4"'

46codex --config sandbox_workspace_write.network_access=true52codex --config sandbox_workspace_write.network_access=true

47codex --config 'shell_environment_policy.include_only=["PATH","HOME"]'53codex --config 'shell_environment_policy.include_only=["PATH","HOME"]'

48```54```


68 74 

69For shared defaults, rules, and skills checked into repos or system paths, see [Team Config](https://developers.openai.com/codex/enterprise/admin-setup#team-config).75For shared defaults, rules, and skills checked into repos or system paths, see [Team Config](https://developers.openai.com/codex/enterprise/admin-setup#team-config).

70 76 

71If you just need to point the built-in OpenAI provider at an LLM proxy, router, or data-residency enabled project, set environment variable `OPENAI_BASE_URL` instead of defining a new provider. This overrides the default OpenAI endpoint without a `config.toml` change.77If you just need to point the built-in OpenAI provider at an LLM proxy, router, or data-residency enabled project, set `openai_base_url` in `config.toml` instead of defining a new provider. This changes the base URL for the built-in `openai` provider without requiring a separate `model_providers.<id>` entry.

72 78 

73```toml79```toml

74export OPENAI_BASE_URL="https://api.openai.com/v1"80openai_base_url = "https://us.api.openai.com/v1"

75codex

76```81```

77 82 

78## Project config files (`.codex/config.toml`)83## Project config files (`.codex/config.toml`)


81 86 

82For security, Codex loads project-scoped config files only when the project is trusted. If the project is untrusted, Codex ignores `.codex/config.toml` files in the project.87For security, Codex loads project-scoped config files only when the project is trusted. If the project is untrusted, Codex ignores `.codex/config.toml` files in the project.

83 88 

84Relative paths inside a project config (for example, `experimental_instructions_file`) are resolved relative to the `.codex/` folder that contains the `config.toml`.89Relative paths inside a project config (for example, `model_instructions_file`) are resolved relative to the `.codex/` folder that contains the `config.toml`.

90 

91## Hooks (experimental)

92 

93Codex can also load lifecycle hooks from `hooks.json` files that sit next to

94active config layers.

95 

96In practice, the two most useful locations are:

97 

98- `~/.codex/hooks.json`

99- `<repo>/.codex/hooks.json`

100 

101Turn hooks on with:

102 

103```toml

104[features]

105codex_hooks = true

106```

107 

108For the current event list, input fields, output behavior, and limitations, see

109[Hooks](https://developers.openai.com/codex/hooks).

85 110 

86## Agent roles (`[agents]` in `config.toml`)111## Agent roles (`[agents]` in `config.toml`)

87 112 

88For multi-agent role configuration (`[agents]` in `config.toml`), see [Multi-agents](https://developers.openai.com/codex/multi-agent).113For subagent role configuration (`[agents]` in `config.toml`), see [Subagents](https://developers.openai.com/codex/subagents).

89 114 

90## Project root detection115## Project root detection

91 116 


182 207 

183## Approval policies and sandbox modes208## Approval policies and sandbox modes

184 209 

185Pick approval strictness (affects when Codex pauses) and sandbox level (affects file/network access). See [Sandbox & approvals](https://developers.openai.com/codex/security) for deeper examples.210Pick approval strictness (affects when Codex pauses) and sandbox level (affects file/network access).

211 

212For operational details to keep in mind while editing `config.toml`, see [Common sandbox and approval combinations](https://developers.openai.com/codex/agent-approvals-security#common-sandbox-and-approval-combinations), [Protected paths in writable roots](https://developers.openai.com/codex/agent-approvals-security#protected-paths-in-writable-roots), and [Network access](https://developers.openai.com/codex/agent-approvals-security#network-access).

213 

214You can also use a granular approval policy (`approval_policy = { granular = { ... } }`) to allow or auto-reject individual prompt categories. This is useful when you want normal interactive approvals for some cases but want others, such as `request_permissions` or skill-script prompts, to fail closed automatically.

186 215 

187```216```

188approval_policy = "untrusted" # Other options: on-request, never217approval_policy = "untrusted" # Other options: on-request, never, or { granular = { ... } }

189sandbox_mode = "workspace-write"218sandbox_mode = "workspace-write"

219allow_login_shell = false # Optional hardening: disallow login shells for shell tools

220 

221# Example granular approval policy:

222# approval_policy = { granular = {

223# sandbox_approval = true,

224# rules = true,

225# mcp_elicitations = true,

226# request_permissions = false,

227# skill_approval = false

228# } }

190 229 

191[sandbox_workspace_write]230[sandbox_workspace_write]

192exclude_tmpdir_env_var = false # Allow $TMPDIR231exclude_tmpdir_env_var = false # Allow $TMPDIR


195network_access = false # Opt in to outbound network234network_access = false # Opt in to outbound network

196```235```

197 236 

237Need the complete key list (including profile-scoped overrides and requirements constraints)? See [Configuration Reference](https://developers.openai.com/codex/config-reference) and [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration).

238 

198In workspace-write mode, some environments keep `.git/` and `.codex/`239In workspace-write mode, some environments keep `.git/` and `.codex/`

199 read-only even when the rest of the workspace is writable. This is why240 read-only even when the rest of the workspace is writable. This is why

200 commands like `git commit` may still require approval to run outside the241 commands like `git commit` may still require approval to run outside the


289| `codex.tool.call` | counter | `tool`, `success` | Tool invocation count by tool name and success/failure. |330| `codex.tool.call` | counter | `tool`, `success` | Tool invocation count by tool name and success/failure. |

290| `codex.tool.call.duration_ms` | histogram | `tool`, `success` | Tool execution duration in milliseconds by tool name and outcome. |331| `codex.tool.call.duration_ms` | histogram | `tool`, `success` | Tool execution duration in milliseconds by tool name and outcome. |

291 332 

292For more security and privacy guidance around telemetry, see [Security](https://developers.openai.com/codex/security#monitoring-and-telemetry).333For more security and privacy guidance around telemetry, see [Security](https://developers.openai.com/codex/agent-approvals-security#monitoring-and-telemetry).

293 334 

294### Metrics335### Metrics

295 336 

config-basic.md +31 −20

Details

11The CLI and IDE extension share the same configuration layers. You can use them to:11The CLI and IDE extension share the same configuration layers. You can use them to:

12 12 

13- Set the default model and provider.13- Set the default model and provider.

14- Configure [approval policies and sandbox settings](https://developers.openai.com/codex/security).14- Configure [approval policies and sandbox settings](https://developers.openai.com/codex/agent-approvals-security#sandbox-and-approvals).

15- Configure [MCP servers](https://developers.openai.com/codex/mcp).15- Configure [MCP servers](https://developers.openai.com/codex/mcp).

16 16 

17## Configuration precedence17## Configuration precedence


33 33 

34On managed machines, your organization may also enforce constraints via34On managed machines, your organization may also enforce constraints via

35 `requirements.toml` (for example, disallowing `approval_policy = "never"` or35 `requirements.toml` (for example, disallowing `approval_policy = "never"` or

36`sandbox_mode = "danger-full-access"`). See [Security](https://developers.openai.com/codex/security).36 `sandbox_mode = "danger-full-access"`). See [Managed

37 configuration](https://developers.openai.com/codex/enterprise/managed-configuration) and [Admin-enforced

38 requirements](https://developers.openai.com/codex/enterprise/managed-configuration#admin-enforced-requirements-requirementstoml).

37 39 

38## Common configuration options40## Common configuration options

39 41 


44Choose the model Codex uses by default in the CLI and IDE.46Choose the model Codex uses by default in the CLI and IDE.

45 47 

46```toml48```toml

47model = "gpt-5.2"49model = "gpt-5.4"

48```50```

49 51 

50#### Approval prompts52#### Approval prompts


55approval_policy = "on-request"57approval_policy = "on-request"

56```58```

57 59 

60For behavior differences between `untrusted`, `on-request`, and `never`, see [Run without approval prompts](https://developers.openai.com/codex/agent-approvals-security#run-without-approval-prompts) and [Common sandbox and approval combinations](https://developers.openai.com/codex/agent-approvals-security#common-sandbox-and-approval-combinations).

61 

58#### Sandbox level62#### Sandbox level

59 63 

60Adjust how much filesystem and network access Codex has while executing commands.64Adjust how much filesystem and network access Codex has while executing commands.


63sandbox_mode = "workspace-write"67sandbox_mode = "workspace-write"

64```68```

65 69 

70For mode-by-mode behavior (including protected `.git`/`.codex` paths and network defaults), see [Sandbox and approvals](https://developers.openai.com/codex/agent-approvals-security#sandbox-and-approvals), [Protected paths in writable roots](https://developers.openai.com/codex/agent-approvals-security#protected-paths-in-writable-roots), and [Network access](https://developers.openai.com/codex/agent-approvals-security#network-access).

71 

72#### Windows sandbox mode

73 

74When running Codex natively on Windows, set the native sandbox mode to `elevated` in the `windows` table. Use `unelevated` only if you don't have administrator permissions or if elevated setup fails.

75 

76```toml

77[windows]

78sandbox = "elevated" # Recommended

79# sandbox = "unelevated" # Fallback if admin permissions/setup are unavailable

80```

81 

66#### Web search mode82#### Web search mode

67 83 

68Codex enables web search by default for local tasks and serves results from a web search cache. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you are using `--yolo` or another [full access sandbox setting](https://developers.openai.com/codex/security), web search defaults to live results. Choose a mode with `web_search`:84Codex enables web search by default for local tasks and serves results from a web search cache. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you are using `--yolo` or another [full access sandbox setting](https://developers.openai.com/codex/agent-approvals-security#common-sandbox-and-approval-combinations), web search defaults to live results. Choose a mode with `web_search`:

69 85 

70- `"cached"` (default) serves results from the web search cache.86- `"cached"` (default) serves results from the web search cache.

71- `"live"` fetches the most recent data from the web (same as `--search`).87- `"live"` fetches the most recent data from the web (same as `--search`).


131 147 

132| Key | Default | Maturity | Description |148| Key | Default | Maturity | Description |

133| -------------------- | :-------------------: | ------------ | ---------------------------------------------------------------------------------------- |149| -------------------- | :-------------------: | ------------ | ---------------------------------------------------------------------------------------- |

134| `apply_patch_freeform` | false | Experimental | Include the freeform `apply_patch` tool |

135| `apps` | false | Experimental | Enable ChatGPT Apps/connectors support |150| `apps` | false | Experimental | Enable ChatGPT Apps/connectors support |

136| `apps_mcp_gateway` | false | Experimental | Route Apps MCP calls through `https://api.openai.com/v1/connectors/mcp/` instead of legacy routing |151| `codex_hooks` | false | Under development | Enable lifecycle hooks from `hooks.json`. See [Hooks](https://developers.openai.com/codex/hooks). |

137| `elevated_windows_sandbox` | false | Experimental | Use the elevated Windows sandbox pipeline |152| `fast_mode` | true | Stable | Enable Fast mode selection and the `service_tier = "fast"` path |

138| `collaboration_modes` | true | Stable | Enable collaboration modes such as plan mode |153| `multi_agent` | true | Stable | Enable subagent collaboration tools |

139| `experimental_windows_sandbox` | false | Experimental | Use the Windows restricted-token sandbox |

140| `multi_agent` | false | Experimental | Enable multi-agent collaboration tools |

141| `personality` | true | Stable | Enable personality selection controls |154| `personality` | true | Stable | Enable personality selection controls |

142| `remote_models` | false | Experimental | Refresh remote model list before showing readiness |155| `shell_snapshot` | true | Stable | Snapshot your shell environment to speed up repeated commands |

143| `runtime_metrics` | false | Experimental | Show runtime metrics summaries in TUI turn separators |

144| `request_rule` | true | Stable | Enable Smart approvals (`prefix_rule` suggestions) |

145| `search_tool` | false | Experimental | Enable `search_tool_bm25` so Codex discovers Apps MCP tools via search before tool calls |

146| `shell_snapshot` | false | Beta | Snapshot your shell environment to speed up repeated commands |

147| `shell_tool` | true | Stable | Enable the default `shell` tool |156| `shell_tool` | true | Stable | Enable the default `shell` tool |

148| `use_linux_sandbox_bwrap` | false | Experimental | Use the bubblewrap-based Linux sandbox pipeline |157| `smart_approvals` | false | Experimental | Route eligible approval requests through the guardian reviewer subagent |

149| `unified_exec` | false | Beta | Use the unified PTY-backed exec tool |158| `unified_exec` | `true` except Windows | Stable | Use the unified PTY-backed exec tool |

150| `undo` | true | Stable | Enable undo via per-turn git ghost snapshots |159| `undo` | false | Stable | Enable undo via per-turn git ghost snapshots |

151| `web_search` | true | Deprecated | Legacy toggle; prefer the top-level `web_search` setting |160| `web_search` | true | Deprecated | Legacy toggle; prefer the top-level `web_search` setting |

152| `web_search_cached` | true | Deprecated | Legacy toggle that maps to `web_search = "cached"` when unset |161| `web_search_cached` | false | Deprecated | Legacy toggle that maps to `web_search = "cached"` when unset |

153| `web_search_request` | true | Deprecated | Legacy toggle that maps to `web_search = "live"` when unset |162| `web_search_request` | false | Deprecated | Legacy toggle that maps to `web_search = "live"` when unset |

154 163 

155The Maturity column uses feature maturity labels such as Experimental, Beta,164The Maturity column uses feature maturity labels such as Experimental, Beta,

156 and Stable. See [Feature Maturity](https://developers.openai.com/codex/feature-maturity) for how to165 and Stable. See [Feature Maturity](https://developers.openai.com/codex/feature-maturity) for how to


158 167 

159Omit feature keys to keep their defaults.168Omit feature keys to keep their defaults.

160 169 

170For the current lifecycle hooks MVP, see [Hooks](https://developers.openai.com/codex/hooks).

171 

161### Enabling features172### Enabling features

162 173 

163- In `config.toml`, add `feature_name = true` under `[features]`.174- In `config.toml`, add `feature_name = true` under `[features]`.

config-reference.md +800 −119

Details

6 6 

7User-level configuration lives in `~/.codex/config.toml`. You can also add project-scoped overrides in `.codex/config.toml` files. Codex loads project-scoped config files only when you trust the project.7User-level configuration lives in `~/.codex/config.toml`. You can also add project-scoped overrides in `.codex/config.toml` files. Codex loads project-scoped config files only when you trust the project.

8 8 

9For sandbox and approval keys (`approval_policy`, `sandbox_mode`, and `sandbox_workspace_write.*`), pair this reference with [Sandbox and approvals](https://developers.openai.com/codex/agent-approvals-security#sandbox-and-approvals), [Protected paths in writable roots](https://developers.openai.com/codex/agent-approvals-security#protected-paths-in-writable-roots), and [Network access](https://developers.openai.com/codex/agent-approvals-security#network-access).

10 

9| Key | Type / Values | Details |11| Key | Type / Values | Details |

10| --- | --- | --- |12| --- | --- | --- |

11| `agents.<name>.config_file` | `string (path)` | Path to a TOML config layer for that role; relative paths resolve from the config file that declares the role. |13| `agents.<name>.config_file` | `string (path)` | Path to a TOML config layer for that role; relative paths resolve from the config file that declares the role. |

12| `agents.<name>.description` | `string` | Role guidance shown to Codex when choosing and spawning that agent type. |14| `agents.<name>.description` | `string` | Role guidance shown to Codex when choosing and spawning that agent type. |

13| `agents.max_threads` | `number` | Maximum number of agent threads that can be open concurrently. |15| `agents.<name>.nickname_candidates` | `array<string>` | Optional pool of display nicknames for spawned agents in that role. |

14| `approval_policy` | `untrusted | on-request | never` | Controls when Codex pauses for approval before executing commands. `on-failure` is deprecated; use `on-request` for interactive runs or `never` for non-interactive runs. |16| `agents.job_max_runtime_seconds` | `number` | Default per-worker timeout for `spawn_agents_on_csv` jobs. When unset, the tool falls back to 1800 seconds per worker. |

15| `apps.<id>.disabled_reason` | `unknown | user` | Optional reason attached when an app/connector is disabled. |17| `agents.max_depth` | `number` | Maximum nesting depth allowed for spawned agent threads (root sessions start at depth 0; default: 1). |

18| `agents.max_threads` | `number` | Maximum number of agent threads that can be open concurrently. Defaults to `6` when unset. |

19| `allow_login_shell` | `boolean` | Allow shell-based tools to use login-shell semantics. Defaults to `true`; when `false`, `login = true` requests are rejected and omitted `login` defaults to non-login shells. |

20| `analytics.enabled` | `boolean` | Enable or disable analytics for this machine/profile. When unset, the client default applies. |

21| `approval_policy` | `untrusted | on-request | never | { granular = { sandbox_approval = bool, rules = bool, mcp_elicitations = bool, request_permissions = bool, skill_approval = bool } }` | Controls when Codex pauses for approval before executing commands. You can also use `approval_policy = { granular = { ... } }` to allow or auto-reject specific prompt categories while keeping other prompts interactive. `on-failure` is deprecated; use `on-request` for interactive runs or `never` for non-interactive runs. |

22| `approval_policy.granular.mcp_elicitations` | `boolean` | When `true`, MCP elicitation prompts are allowed to surface instead of being auto-rejected. |

23| `approval_policy.granular.request_permissions` | `boolean` | When `true`, prompts from the `request_permissions` tool are allowed to surface. |

24| `approval_policy.granular.rules` | `boolean` | When `true`, approvals triggered by execpolicy `prompt` rules are allowed to surface. |

25| `approval_policy.granular.sandbox_approval` | `boolean` | When `true`, sandbox escalation approval prompts are allowed to surface. |

26| `approval_policy.granular.skill_approval` | `boolean` | When `true`, skill-script approval prompts are allowed to surface. |

27| `apps._default.destructive_enabled` | `boolean` | Default allow/deny for app tools with `destructive_hint = true`. |

28| `apps._default.enabled` | `boolean` | Default app enabled state for all apps unless overridden per app. |

29| `apps._default.open_world_enabled` | `boolean` | Default allow/deny for app tools with `open_world_hint = true`. |

30| `apps.<id>.default_tools_approval_mode` | `auto | prompt | approve` | Default approval behavior for tools in this app unless a per-tool override exists. |

31| `apps.<id>.default_tools_enabled` | `boolean` | Default enabled state for tools in this app unless a per-tool override exists. |

32| `apps.<id>.destructive_enabled` | `boolean` | Allow or block tools in this app that advertise `destructive_hint = true`. |

16| `apps.<id>.enabled` | `boolean` | Enable or disable a specific app/connector by id (default: true). |33| `apps.<id>.enabled` | `boolean` | Enable or disable a specific app/connector by id (default: true). |

34| `apps.<id>.open_world_enabled` | `boolean` | Allow or block tools in this app that advertise `open_world_hint = true`. |

35| `apps.<id>.tools.<tool>.approval_mode` | `auto | prompt | approve` | Per-tool approval behavior override for a single app tool. |

36| `apps.<id>.tools.<tool>.enabled` | `boolean` | Per-tool enabled override for an app tool (for example `repos/list`). |

37| `background_terminal_max_timeout` | `number` | Maximum poll window in milliseconds for empty `write_stdin` polls (background terminal polling). Default: `300000` (5 minutes). Replaces the older `background_terminal_timeout` key. |

17| `chatgpt_base_url` | `string` | Override the base URL used during the ChatGPT login flow. |38| `chatgpt_base_url` | `string` | Override the base URL used during the ChatGPT login flow. |

18| `check_for_update_on_startup` | `boolean` | Check for Codex updates on startup (set to false only when updates are centrally managed). |39| `check_for_update_on_startup` | `boolean` | Check for Codex updates on startup (set to false only when updates are centrally managed). |

19| `cli_auth_credentials_store` | `file | keyring | auto` | Control where the CLI stores cached credentials (file-based auth.json vs OS keychain). |40| `cli_auth_credentials_store` | `file | keyring | auto` | Control where the CLI stores cached credentials (file-based auth.json vs OS keychain). |

41| `commit_attribution` | `string` | Override the commit co-author trailer text. Set an empty string to disable automatic attribution. |

20| `compact_prompt` | `string` | Inline override for the history compaction prompt. |42| `compact_prompt` | `string` | Inline override for the history compaction prompt. |

43| `default_permissions` | `string` | Name of the default permissions profile to apply to sandboxed tool calls. |

21| `developer_instructions` | `string` | Additional developer instructions injected into the session (optional). |44| `developer_instructions` | `string` | Additional developer instructions injected into the session (optional). |

22| `disable_paste_burst` | `boolean` | Disable burst-paste detection in the TUI. |45| `disable_paste_burst` | `boolean` | Disable burst-paste detection in the TUI. |

23| `experimental_compact_prompt_file` | `string (path)` | Load the compaction prompt override from a file (experimental). |46| `experimental_compact_prompt_file` | `string (path)` | Load the compaction prompt override from a file (experimental). |

24| `experimental_use_freeform_apply_patch` | `boolean` | Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform` or `codex --enable apply_patch_freeform`. |

25| `experimental_use_unified_exec_tool` | `boolean` | Legacy name for enabling unified exec; prefer `[features].unified_exec` or `codex --enable unified_exec`. |47| `experimental_use_unified_exec_tool` | `boolean` | Legacy name for enabling unified exec; prefer `[features].unified_exec` or `codex --enable unified_exec`. |

26| `features.apply_patch_freeform` | `boolean` | Expose the freeform `apply_patch` tool (experimental). |

27| `features.apps` | `boolean` | Enable ChatGPT Apps/connectors support (experimental). |48| `features.apps` | `boolean` | Enable ChatGPT Apps/connectors support (experimental). |

28| `features.apps_mcp_gateway` | `boolean` | Route Apps MCP calls through the OpenAI connectors MCP gateway (`https://api.openai.com/v1/connectors/mcp/`) instead of legacy routing (experimental). |49| `features.codex_hooks` | `boolean` | Enable lifecycle hooks loaded from `hooks.json` (under development; off by default). |

29| `features.child_agents_md` | `boolean` | Append AGENTS.md scope/precedence guidance even when no AGENTS.md is present (experimental). |50| `features.enable_request_compression` | `boolean` | Compress streaming request bodies with zstd when supported (stable; on by default). |

30| `features.collaboration_modes` | `boolean` | Enable collaboration modes such as plan mode (stable; on by default). |51| `features.fast_mode` | `boolean` | Enable Fast mode selection and the `service_tier = "fast"` path (stable; on by default). |

31| `features.elevated_windows_sandbox` | `boolean` | Enable the elevated Windows sandbox pipeline (experimental). |52| `features.multi_agent` | `boolean` | Enable multi-agent collaboration tools (`spawn_agent`, `send_input`, `resume_agent`, `wait_agent`, and `close_agent`) (stable; on by default). |

32| `features.experimental_windows_sandbox` | `boolean` | Run the Windows restricted-token sandbox (experimental). |

33| `features.multi_agent` | `boolean` | Enable multi-agent collaboration tools (`spawn\_agent`, `send\_input`, `resume\_agent`, `wait`, and `close\_agent`) (experimental; off by default). |

34| `features.personality` | `boolean` | Enable personality selection controls (stable; on by default). |53| `features.personality` | `boolean` | Enable personality selection controls (stable; on by default). |

35| `features.powershell_utf8` | `boolean` | Force PowerShell UTF-8 output (defaults to true). |54| `features.prevent_idle_sleep` | `boolean` | Prevent the machine from sleeping while a turn is actively running (experimental; off by default). |

36| `features.remote_models` | `boolean` | Refresh remote model list before showing readiness (experimental). |55| `features.shell_snapshot` | `boolean` | Snapshot shell environment to speed up repeated commands (stable; on by default). |

37| `features.request_rule` | `boolean` | Enable Smart approvals (`prefix_rule` suggestions on escalation requests; stable; on by default). |

38| `features.runtime_metrics` | `boolean` | Show runtime metrics summary in TUI turn separators (experimental). |

39| `features.search_tool` | `boolean` | Enable `search_tool_bm25` for Apps tool discovery before invoking app MCP tools (experimental). |

40| `features.shell_snapshot` | `boolean` | Snapshot shell environment to speed up repeated commands (beta). |

41| `features.shell_tool` | `boolean` | Enable the default `shell` tool for running commands (stable; on by default). |56| `features.shell_tool` | `boolean` | Enable the default `shell` tool for running commands (stable; on by default). |

42| `features.unified_exec` | `boolean` | Use the unified PTY-backed exec tool (beta). |57| `features.skill_mcp_dependency_install` | `boolean` | Allow prompting and installing missing MCP dependencies for skills (stable; on by default). |

43| `features.use_linux_sandbox_bwrap` | `boolean` | Use the bubblewrap-based Linux sandbox pipeline (experimental; off by default). |58| `features.smart_approvals` | `boolean` | Route eligible approval requests through the guardian reviewer subagent (experimental; off by default). |

59| `features.undo` | `boolean` | Enable undo support (stable; off by default). |

60| `features.unified_exec` | `boolean` | Use the unified PTY-backed exec tool (stable; enabled by default except on Windows). |

44| `features.web_search` | `boolean` | Deprecated legacy toggle; prefer the top-level `web_search` setting. |61| `features.web_search` | `boolean` | Deprecated legacy toggle; prefer the top-level `web_search` setting. |

45| `features.web_search_cached` | `boolean` | Deprecated legacy toggle. When `web_search` is unset, true maps to `web_search = "cached"`. |62| `features.web_search_cached` | `boolean` | Deprecated legacy toggle. When `web_search` is unset, true maps to `web_search = "cached"`. |

46| `features.web_search_request` | `boolean` | Deprecated legacy toggle. When `web_search` is unset, true maps to `web_search = "live"`. |63| `features.web_search_request` | `boolean` | Deprecated legacy toggle. When `web_search` is unset, true maps to `web_search = "live"`. |


51| `hide_agent_reasoning` | `boolean` | Suppress reasoning events in both the TUI and `codex exec` output. |68| `hide_agent_reasoning` | `boolean` | Suppress reasoning events in both the TUI and `codex exec` output. |

52| `history.max_bytes` | `number` | If set, caps the history file size in bytes by dropping oldest entries. |69| `history.max_bytes` | `number` | If set, caps the history file size in bytes by dropping oldest entries. |

53| `history.persistence` | `save-all | none` | Control whether Codex saves session transcripts to history.jsonl. |70| `history.persistence` | `save-all | none` | Control whether Codex saves session transcripts to history.jsonl. |

54| `include_apply_patch_tool` | `boolean` | Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform`. |

55| `instructions` | `string` | Reserved for future use; prefer `model_instructions_file` or `AGENTS.md`. |71| `instructions` | `string` | Reserved for future use; prefer `model_instructions_file` or `AGENTS.md`. |

56| `log_dir` | `string (path)` | Directory where Codex writes log files (for example `codex-tui.log`); defaults to `$CODEX_HOME/log`. |72| `log_dir` | `string (path)` | Directory where Codex writes log files (for example `codex-tui.log`); defaults to `$CODEX_HOME/log`. |

57| `mcp_oauth_callback_port` | `integer` | Optional fixed port for the local HTTP callback server used during MCP OAuth login. When unset, Codex binds to an ephemeral port chosen by the OS. |73| `mcp_oauth_callback_port` | `integer` | Optional fixed port for the local HTTP callback server used during MCP OAuth login. When unset, Codex binds to an ephemeral port chosen by the OS. |

74| `mcp_oauth_callback_url` | `string` | Optional redirect URI override for MCP OAuth login (for example, a devbox ingress URL). `mcp_oauth_callback_port` still controls the callback listener port. |

58| `mcp_oauth_credentials_store` | `auto | file | keyring` | Preferred store for MCP OAuth credentials. |75| `mcp_oauth_credentials_store` | `auto | file | keyring` | Preferred store for MCP OAuth credentials. |

59| `mcp_servers.<id>.args` | `array<string>` | Arguments passed to the MCP stdio server command. |76| `mcp_servers.<id>.args` | `array<string>` | Arguments passed to the MCP stdio server command. |

60| `mcp_servers.<id>.bearer_token_env_var` | `string` | Environment variable sourcing the bearer token for an MCP HTTP server. |77| `mcp_servers.<id>.bearer_token_env_var` | `string` | Environment variable sourcing the bearer token for an MCP HTTP server. |


67| `mcp_servers.<id>.env_http_headers` | `map<string,string>` | HTTP headers populated from environment variables for an MCP HTTP server. |84| `mcp_servers.<id>.env_http_headers` | `map<string,string>` | HTTP headers populated from environment variables for an MCP HTTP server. |

68| `mcp_servers.<id>.env_vars` | `array<string>` | Additional environment variables to whitelist for an MCP stdio server. |85| `mcp_servers.<id>.env_vars` | `array<string>` | Additional environment variables to whitelist for an MCP stdio server. |

69| `mcp_servers.<id>.http_headers` | `map<string,string>` | Static HTTP headers included with each MCP HTTP request. |86| `mcp_servers.<id>.http_headers` | `map<string,string>` | Static HTTP headers included with each MCP HTTP request. |

87| `mcp_servers.<id>.oauth_resource` | `string` | Optional RFC 8707 OAuth resource parameter to include during MCP login. |

70| `mcp_servers.<id>.required` | `boolean` | When true, fail startup/resume if this enabled MCP server cannot initialize. |88| `mcp_servers.<id>.required` | `boolean` | When true, fail startup/resume if this enabled MCP server cannot initialize. |

89| `mcp_servers.<id>.scopes` | `array<string>` | OAuth scopes to request when authenticating to that MCP server. |

71| `mcp_servers.<id>.startup_timeout_ms` | `number` | Alias for `startup_timeout_sec` in milliseconds. |90| `mcp_servers.<id>.startup_timeout_ms` | `number` | Alias for `startup_timeout_sec` in milliseconds. |

72| `mcp_servers.<id>.startup_timeout_sec` | `number` | Override the default 10s startup timeout for an MCP server. |91| `mcp_servers.<id>.startup_timeout_sec` | `number` | Override the default 10s startup timeout for an MCP server. |

73| `mcp_servers.<id>.tool_timeout_sec` | `number` | Override the default 60s per-tool timeout for an MCP server. |92| `mcp_servers.<id>.tool_timeout_sec` | `number` | Override the default 60s per-tool timeout for an MCP server. |

74| `mcp_servers.<id>.url` | `string` | Endpoint for an MCP streamable HTTP server. |93| `mcp_servers.<id>.url` | `string` | Endpoint for an MCP streamable HTTP server. |

75| `model` | `string` | Model to use (e.g., `gpt-5-codex`). |94| `model` | `string` | Model to use (e.g., `gpt-5-codex`). |

76| `model_auto_compact_token_limit` | `number` | Token threshold that triggers automatic history compaction (unset uses model defaults). |95| `model_auto_compact_token_limit` | `number` | Token threshold that triggers automatic history compaction (unset uses model defaults). |

96| `model_catalog_json` | `string (path)` | Optional path to a JSON model catalog loaded on startup. Profile-level `profiles.<name>.model_catalog_json` can override this per profile. |

77| `model_context_window` | `number` | Context window tokens available to the active model. |97| `model_context_window` | `number` | Context window tokens available to the active model. |

78| `model_instructions_file` | `string (path)` | Replacement for built-in instructions instead of `AGENTS.md`. |98| `model_instructions_file` | `string (path)` | Replacement for built-in instructions instead of `AGENTS.md`. |

79| `model_provider` | `string` | Provider id from `model_providers` (default: `openai`). |99| `model_provider` | `string` | Provider id from `model_providers` (default: `openai`). |


89| `model_providers.<id>.requires_openai_auth` | `boolean` | The provider uses OpenAI authentication (defaults to false). |109| `model_providers.<id>.requires_openai_auth` | `boolean` | The provider uses OpenAI authentication (defaults to false). |

90| `model_providers.<id>.stream_idle_timeout_ms` | `number` | Idle timeout for SSE streams in milliseconds (default: 300000). |110| `model_providers.<id>.stream_idle_timeout_ms` | `number` | Idle timeout for SSE streams in milliseconds (default: 300000). |

91| `model_providers.<id>.stream_max_retries` | `number` | Retry count for SSE streaming interruptions (default: 5). |111| `model_providers.<id>.stream_max_retries` | `number` | Retry count for SSE streaming interruptions (default: 5). |

92| `model_providers.<id>.wire_api` | `chat | responses` | Protocol used by the provider (defaults to `chat` if omitted). |112| `model_providers.<id>.supports_websockets` | `boolean` | Whether that provider supports the Responses API WebSocket transport. |

113| `model_providers.<id>.wire_api` | `responses` | Protocol used by the provider. `responses` is the only supported value, and it is the default when omitted. |

93| `model_reasoning_effort` | `minimal | low | medium | high | xhigh` | Adjust reasoning effort for supported models (Responses API only; `xhigh` is model-dependent). |114| `model_reasoning_effort` | `minimal | low | medium | high | xhigh` | Adjust reasoning effort for supported models (Responses API only; `xhigh` is model-dependent). |

94| `model_reasoning_summary` | `auto | concise | detailed | none` | Select reasoning summary detail or disable summaries entirely. |115| `model_reasoning_summary` | `auto | concise | detailed | none` | Select reasoning summary detail or disable summaries entirely. |

95| `model_supports_reasoning_summaries` | `boolean` | Force Codex to send or not send reasoning metadata. |116| `model_supports_reasoning_summaries` | `boolean` | Force Codex to send or not send reasoning metadata. |

96| `model_verbosity` | `low | medium | high` | Control GPT-5 Responses API verbosity (defaults to `medium`). |117| `model_verbosity` | `low | medium | high` | Optional GPT-5 Responses API verbosity override; when unset, the selected model/preset default is used. |

97| `notice.hide_full_access_warning` | `boolean` | Track acknowledgement of the full access warning prompt. |118| `notice.hide_full_access_warning` | `boolean` | Track acknowledgement of the full access warning prompt. |

98| `notice.hide_gpt-5.1-codex-max_migration_prompt` | `boolean` | Track acknowledgement of the gpt-5.1-codex-max migration prompt. |119| `notice.hide_gpt-5.1-codex-max_migration_prompt` | `boolean` | Track acknowledgement of the gpt-5.1-codex-max migration prompt. |

99| `notice.hide_gpt5_1_migration_prompt` | `boolean` | Track acknowledgement of the GPT-5.1 migration prompt. |120| `notice.hide_gpt5_1_migration_prompt` | `boolean` | Track acknowledgement of the GPT-5.1 migration prompt. |


101| `notice.hide_world_writable_warning` | `boolean` | Track acknowledgement of the Windows world-writable directories warning. |122| `notice.hide_world_writable_warning` | `boolean` | Track acknowledgement of the Windows world-writable directories warning. |

102| `notice.model_migrations` | `map<string,string>` | Track acknowledged model migrations as old->new mappings. |123| `notice.model_migrations` | `map<string,string>` | Track acknowledged model migrations as old->new mappings. |

103| `notify` | `array<string>` | Command invoked for notifications; receives a JSON payload from Codex. |124| `notify` | `array<string>` | Command invoked for notifications; receives a JSON payload from Codex. |

125| `openai_base_url` | `string` | Base URL override for the built-in `openai` model provider. |

104| `oss_provider` | `lmstudio | ollama` | Default local provider used when running with `--oss` (defaults to prompting if unset). |126| `oss_provider` | `lmstudio | ollama` | Default local provider used when running with `--oss` (defaults to prompting if unset). |

105| `otel.environment` | `string` | Environment tag applied to emitted OpenTelemetry events (default: `dev`). |127| `otel.environment` | `string` | Environment tag applied to emitted OpenTelemetry events (default: `dev`). |

106| `otel.exporter` | `none | otlp-http | otlp-grpc` | Select the OpenTelemetry exporter and provide any endpoint metadata. |128| `otel.exporter` | `none | otlp-http | otlp-grpc` | Select the OpenTelemetry exporter and provide any endpoint metadata. |


111| `otel.exporter.<id>.tls.client-certificate` | `string` | Client certificate path for OTEL exporter TLS. |133| `otel.exporter.<id>.tls.client-certificate` | `string` | Client certificate path for OTEL exporter TLS. |

112| `otel.exporter.<id>.tls.client-private-key` | `string` | Client private key path for OTEL exporter TLS. |134| `otel.exporter.<id>.tls.client-private-key` | `string` | Client private key path for OTEL exporter TLS. |

113| `otel.log_user_prompt` | `boolean` | Opt in to exporting raw user prompts with OpenTelemetry logs. |135| `otel.log_user_prompt` | `boolean` | Opt in to exporting raw user prompts with OpenTelemetry logs. |

136| `otel.metrics_exporter` | `none | statsig | otlp-http | otlp-grpc` | Select the OpenTelemetry metrics exporter (defaults to `statsig`). |

114| `otel.trace_exporter` | `none | otlp-http | otlp-grpc` | Select the OpenTelemetry trace exporter and provide any endpoint metadata. |137| `otel.trace_exporter` | `none | otlp-http | otlp-grpc` | Select the OpenTelemetry trace exporter and provide any endpoint metadata. |

115| `otel.trace_exporter.<id>.endpoint` | `string` | Trace exporter endpoint for OTEL logs. |138| `otel.trace_exporter.<id>.endpoint` | `string` | Trace exporter endpoint for OTEL logs. |

116| `otel.trace_exporter.<id>.headers` | `map<string,string>` | Static headers included with OTEL trace exporter requests. |139| `otel.trace_exporter.<id>.headers` | `map<string,string>` | Static headers included with OTEL trace exporter requests. |


118| `otel.trace_exporter.<id>.tls.ca-certificate` | `string` | CA certificate path for OTEL trace exporter TLS. |141| `otel.trace_exporter.<id>.tls.ca-certificate` | `string` | CA certificate path for OTEL trace exporter TLS. |

119| `otel.trace_exporter.<id>.tls.client-certificate` | `string` | Client certificate path for OTEL trace exporter TLS. |142| `otel.trace_exporter.<id>.tls.client-certificate` | `string` | Client certificate path for OTEL trace exporter TLS. |

120| `otel.trace_exporter.<id>.tls.client-private-key` | `string` | Client private key path for OTEL trace exporter TLS. |143| `otel.trace_exporter.<id>.tls.client-private-key` | `string` | Client private key path for OTEL trace exporter TLS. |

144| `permissions.<name>.filesystem` | `table` | Named filesystem permission profile. Each key is an absolute path or special token such as `:minimal` or `:project_roots`. |

145| `permissions.<name>.filesystem.":project_roots".<subpath>` | `"read" | "write" | "none"` | Scoped filesystem access relative to the detected project roots. Use `"."` for the root itself. |

146| `permissions.<name>.filesystem.<path>` | `"read" | "write" | "none" | table` | Grant direct access for a path or special token, or scope nested entries under that root. |

147| `permissions.<name>.network.allow_local_binding` | `boolean` | Permit local bind/listen operations through the managed proxy. |

148| `permissions.<name>.network.allow_unix_sockets` | `array<string>` | Allowlist of Unix socket paths permitted through the managed proxy. |

149| `permissions.<name>.network.allow_upstream_proxy` | `boolean` | Allow the managed proxy to chain to another upstream proxy. |

150| `permissions.<name>.network.allowed_domains` | `array<string>` | Allowlist of domains permitted through the managed proxy. |

151| `permissions.<name>.network.dangerously_allow_all_unix_sockets` | `boolean` | Allow the proxy to use arbitrary Unix sockets instead of the default restricted set. |

152| `permissions.<name>.network.dangerously_allow_non_loopback_proxy` | `boolean` | Permit non-loopback bind addresses for the managed proxy listener. |

153| `permissions.<name>.network.denied_domains` | `array<string>` | Denylist of domains blocked by the managed proxy. |

154| `permissions.<name>.network.enable_socks5` | `boolean` | Expose a SOCKS5 listener when this permissions profile enables the managed network proxy. |

155| `permissions.<name>.network.enable_socks5_udp` | `boolean` | Allow UDP over the SOCKS5 listener when enabled. |

156| `permissions.<name>.network.enabled` | `boolean` | Enable network access for this named permissions profile. |

157| `permissions.<name>.network.mode` | `limited | full` | Network proxy mode used for subprocess traffic. |

158| `permissions.<name>.network.proxy_url` | `string` | HTTP proxy endpoint used when this permissions profile enables the managed network proxy. |

159| `permissions.<name>.network.socks_url` | `string` | SOCKS5 proxy endpoint used by this permissions profile. |

121| `personality` | `none | friendly | pragmatic` | Default communication style for models that advertise `supportsPersonality`; can be overridden per thread/turn or via `/personality`. |160| `personality` | `none | friendly | pragmatic` | Default communication style for models that advertise `supportsPersonality`; can be overridden per thread/turn or via `/personality`. |

161| `plan_mode_reasoning_effort` | `none | minimal | low | medium | high | xhigh` | Plan-mode-specific reasoning override. When unset, Plan mode uses its built-in preset default. |

122| `profile` | `string` | Default profile applied at startup (equivalent to `--profile`). |162| `profile` | `string` | Default profile applied at startup (equivalent to `--profile`). |

123| `profiles.<name>.*` | `various` | Profile-scoped overrides for any of the supported configuration keys. |163| `profiles.<name>.*` | `various` | Profile-scoped overrides for any of the supported configuration keys. |

124| `profiles.<name>.experimental_use_freeform_apply_patch` | `boolean` | Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform`. |164| `profiles.<name>.analytics.enabled` | `boolean` | Profile-scoped analytics enablement override. |

125| `profiles.<name>.experimental_use_unified_exec_tool` | `boolean` | Legacy name for enabling unified exec; prefer `[features].unified_exec`. |165| `profiles.<name>.experimental_use_unified_exec_tool` | `boolean` | Legacy name for enabling unified exec; prefer `[features].unified_exec`. |

126| `profiles.<name>.include_apply_patch_tool` | `boolean` | Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform`. |166| `profiles.<name>.model_catalog_json` | `string (path)` | Profile-scoped model catalog JSON path override (applied on startup only; overrides the top-level `model_catalog_json` for that profile). |

167| `profiles.<name>.model_instructions_file` | `string (path)` | Profile-scoped replacement for the built-in instruction file. |

127| `profiles.<name>.oss_provider` | `lmstudio | ollama` | Profile-scoped OSS provider for `--oss` sessions. |168| `profiles.<name>.oss_provider` | `lmstudio | ollama` | Profile-scoped OSS provider for `--oss` sessions. |

128| `profiles.<name>.personality` | `none | friendly | pragmatic` | Profile-scoped communication style override for supported models. |169| `profiles.<name>.personality` | `none | friendly | pragmatic` | Profile-scoped communication style override for supported models. |

170| `profiles.<name>.plan_mode_reasoning_effort` | `none | minimal | low | medium | high | xhigh` | Profile-scoped Plan-mode reasoning override. |

171| `profiles.<name>.service_tier` | `flex | fast` | Profile-scoped service tier preference for new turns. |

172| `profiles.<name>.tools_view_image` | `boolean` | Enable or disable the `view_image` tool in that profile. |

129| `profiles.<name>.web_search` | `disabled | cached | live` | Profile-scoped web search mode override (default: `"cached"`). |173| `profiles.<name>.web_search` | `disabled | cached | live` | Profile-scoped web search mode override (default: `"cached"`). |

174| `profiles.<name>.windows.sandbox` | `unelevated | elevated` | Profile-scoped Windows sandbox mode override. |

130| `project_doc_fallback_filenames` | `array<string>` | Additional filenames to try when `AGENTS.md` is missing. |175| `project_doc_fallback_filenames` | `array<string>` | Additional filenames to try when `AGENTS.md` is missing. |

131| `project_doc_max_bytes` | `number` | Maximum bytes read from `AGENTS.md` when building project instructions. |176| `project_doc_max_bytes` | `number` | Maximum bytes read from `AGENTS.md` when building project instructions. |

132| `project_root_markers` | `array<string>` | List of project root marker filenames; used when searching parent directories for the project root. |177| `project_root_markers` | `array<string>` | List of project root marker filenames; used when searching parent directories for the project root. |


137| `sandbox_workspace_write.exclude_tmpdir_env_var` | `boolean` | Exclude `$TMPDIR` from writable roots in workspace-write mode. |182| `sandbox_workspace_write.exclude_tmpdir_env_var` | `boolean` | Exclude `$TMPDIR` from writable roots in workspace-write mode. |

138| `sandbox_workspace_write.network_access` | `boolean` | Allow outbound network access inside the workspace-write sandbox. |183| `sandbox_workspace_write.network_access` | `boolean` | Allow outbound network access inside the workspace-write sandbox. |

139| `sandbox_workspace_write.writable_roots` | `array<string>` | Additional writable roots when `sandbox_mode = "workspace-write"`. |184| `sandbox_workspace_write.writable_roots` | `array<string>` | Additional writable roots when `sandbox_mode = "workspace-write"`. |

185| `service_tier` | `flex | fast` | Preferred service tier for new turns. |

140| `shell_environment_policy.exclude` | `array<string>` | Glob patterns for removing environment variables after the defaults. |186| `shell_environment_policy.exclude` | `array<string>` | Glob patterns for removing environment variables after the defaults. |

141| `shell_environment_policy.experimental_use_profile` | `boolean` | Use the user shell profile when spawning subprocesses. |187| `shell_environment_policy.experimental_use_profile` | `boolean` | Use the user shell profile when spawning subprocesses. |

142| `shell_environment_policy.ignore_default_excludes` | `boolean` | Keep variables containing KEY/SECRET/TOKEN before other filters run. |188| `shell_environment_policy.ignore_default_excludes` | `boolean` | Keep variables containing KEY/SECRET/TOKEN before other filters run. |


147| `skills.config` | `array<object>` | Per-skill enablement overrides stored in config.toml. |193| `skills.config` | `array<object>` | Per-skill enablement overrides stored in config.toml. |

148| `skills.config.<index>.enabled` | `boolean` | Enable or disable the referenced skill. |194| `skills.config.<index>.enabled` | `boolean` | Enable or disable the referenced skill. |

149| `skills.config.<index>.path` | `string (path)` | Path to a skill folder containing `SKILL.md`. |195| `skills.config.<index>.path` | `string (path)` | Path to a skill folder containing `SKILL.md`. |

196| `sqlite_home` | `string (path)` | Directory where Codex stores the SQLite-backed state DB used by agent jobs and other resumable runtime state. |

150| `suppress_unstable_features_warning` | `boolean` | Suppress the warning that appears when under-development feature flags are enabled. |197| `suppress_unstable_features_warning` | `boolean` | Suppress the warning that appears when under-development feature flags are enabled. |

151| `tool_output_token_limit` | `number` | Token budget for storing individual tool/function outputs in history. |198| `tool_output_token_limit` | `number` | Token budget for storing individual tool/function outputs in history. |

152| `tools.web_search` | `boolean` | Deprecated legacy toggle for web search; prefer the top-level `web_search` setting. |199| `tools.view_image` | `boolean` | Enable the local-image attachment tool `view_image`. |

200| `tools.web_search` | `boolean | { context_size = "low|medium|high", allowed_domains = [string], location = { country, region, city, timezone } }` | Optional web search tool configuration. The legacy boolean form is still accepted, but the object form lets you set search context size, allowed domains, and approximate user location. |

153| `tui` | `table` | TUI-specific options such as enabling inline desktop notifications. |201| `tui` | `table` | TUI-specific options such as enabling inline desktop notifications. |

154| `tui.alternate_screen` | `auto | always | never` | Control alternate screen usage for the TUI (default: auto; auto skips it in Zellij to preserve scrollback). |202| `tui.alternate_screen` | `auto | always | never` | Control alternate screen usage for the TUI (default: auto; auto skips it in Zellij to preserve scrollback). |

155| `tui.animations` | `boolean` | Enable terminal animations (welcome screen, shimmer, spinner) (default: true). |203| `tui.animations` | `boolean` | Enable terminal animations (welcome screen, shimmer, spinner) (default: true). |

204| `tui.model_availability_nux.<model>` | `integer` | Internal startup-tooltip state keyed by model slug. |

156| `tui.notification_method` | `auto | osc9 | bel` | Notification method for unfocused terminal notifications (default: auto). |205| `tui.notification_method` | `auto | osc9 | bel` | Notification method for unfocused terminal notifications (default: auto). |

157| `tui.notifications` | `boolean | array<string>` | Enable TUI notifications; optionally restrict to specific event types. |206| `tui.notifications` | `boolean | array<string>` | Enable TUI notifications; optionally restrict to specific event types. |

158| `tui.show_tooltips` | `boolean` | Show onboarding tooltips in the TUI welcome screen (default: true). |207| `tui.show_tooltips` | `boolean` | Show onboarding tooltips in the TUI welcome screen (default: true). |

159| `tui.status_line` | `array<string> | null` | Ordered list of TUI footer status-line item identifiers. `null` disables the status line. |208| `tui.status_line` | `array<string> | null` | Ordered list of TUI footer status-line item identifiers. `null` disables the status line. |

209| `tui.theme` | `string` | Syntax-highlighting theme override (kebab-case theme name). |

160| `web_search` | `disabled | cached | live` | Web search mode (default: `"cached"`; cached uses an OpenAI-maintained index and does not fetch live pages; if you use `--yolo` or another full access sandbox setting, it defaults to `"live"`). Use `"live"` to fetch the most recent data from the web, or `"disabled"` to remove the tool. |210| `web_search` | `disabled | cached | live` | Web search mode (default: `"cached"`; cached uses an OpenAI-maintained index and does not fetch live pages; if you use `--yolo` or another full access sandbox setting, it defaults to `"live"`). Use `"live"` to fetch the most recent data from the web, or `"disabled"` to remove the tool. |

161| `windows_wsl_setup_acknowledged` | `boolean` | Track Windows onboarding acknowledgement (Windows only). |211| `windows_wsl_setup_acknowledged` | `boolean` | Track Windows onboarding acknowledgement (Windows only). |

212| `windows.sandbox` | `unelevated | elevated` | Windows-only native sandbox mode when running Codex natively on Windows. |

213| `windows.sandbox_private_desktop` | `boolean` | Run the final sandboxed child process on a private desktop by default on native Windows. Set `false` only for compatibility with the older `Winsta0\\Default` behavior. |

162 214 

163Key215Key

164 216 


186 238 

187Key239Key

188 240 

241`agents.<name>.nickname_candidates`

242 

243Type / Values

244 

245`array<string>`

246 

247Details

248 

249Optional pool of display nicknames for spawned agents in that role.

250 

251Key

252 

253`agents.job_max_runtime_seconds`

254 

255Type / Values

256 

257`number`

258 

259Details

260 

261Default per-worker timeout for `spawn_agents_on_csv` jobs. When unset, the tool falls back to 1800 seconds per worker.

262 

263Key

264 

265`agents.max_depth`

266 

267Type / Values

268 

269`number`

270 

271Details

272 

273Maximum nesting depth allowed for spawned agent threads (root sessions start at depth 0; default: 1).

274 

275Key

276 

189`agents.max_threads`277`agents.max_threads`

190 278 

191Type / Values279Type / Values


194 282 

195Details283Details

196 284 

197Maximum number of agent threads that can be open concurrently.285Maximum number of agent threads that can be open concurrently. Defaults to `6` when unset.

286 

287Key

288 

289`allow_login_shell`

290 

291Type / Values

292 

293`boolean`

294 

295Details

296 

297Allow shell-based tools to use login-shell semantics. Defaults to `true`; when `false`, `login = true` requests are rejected and omitted `login` defaults to non-login shells.

298 

299Key

300 

301`analytics.enabled`

302 

303Type / Values

304 

305`boolean`

306 

307Details

308 

309Enable or disable analytics for this machine/profile. When unset, the client default applies.

198 310 

199Key311Key

200 312 


202 314 

203Type / Values315Type / Values

204 316 

205`untrusted | on-request | never`317`untrusted | on-request | never | { granular = { sandbox_approval = bool, rules = bool, mcp_elicitations = bool, request_permissions = bool, skill_approval = bool } }`

206 318 

207Details319Details

208 320 

209Controls when Codex pauses for approval before executing commands. `on-failure` is deprecated; use `on-request` for interactive runs or `never` for non-interactive runs.321Controls when Codex pauses for approval before executing commands. You can also use `approval_policy = { granular = { ... } }` to allow or auto-reject specific prompt categories while keeping other prompts interactive. `on-failure` is deprecated; use `on-request` for interactive runs or `never` for non-interactive runs.

210 322 

211Key323Key

212 324 

213`apps.<id>.disabled_reason`325`approval_policy.granular.mcp_elicitations`

214 326 

215Type / Values327Type / Values

216 328 

217`unknown | user`329`boolean`

218 330 

219Details331Details

220 332 

221Optional reason attached when an app/connector is disabled.333When `true`, MCP elicitation prompts are allowed to surface instead of being auto-rejected.

222 334 

223Key335Key

224 336 

225`apps.<id>.enabled`337`approval_policy.granular.request_permissions`

226 338 

227Type / Values339Type / Values

228 340 


230 342 

231Details343Details

232 344 

233Enable or disable a specific app/connector by id (default: true).345When `true`, prompts from the `request_permissions` tool are allowed to surface.

234 346 

235Key347Key

236 348 

237`chatgpt_base_url`349`approval_policy.granular.rules`

238 350 

239Type / Values351Type / Values

240 352 

241`string`353`boolean`

242 354 

243Details355Details

244 356 

245Override the base URL used during the ChatGPT login flow.357When `true`, approvals triggered by execpolicy `prompt` rules are allowed to surface.

246 358 

247Key359Key

248 360 

249`check_for_update_on_startup`361`approval_policy.granular.sandbox_approval`

250 362 

251Type / Values363Type / Values

252 364 


254 366 

255Details367Details

256 368 

257Check for Codex updates on startup (set to false only when updates are centrally managed).369When `true`, sandbox escalation approval prompts are allowed to surface.

258 370 

259Key371Key

260 372 

261`cli_auth_credentials_store`373`approval_policy.granular.skill_approval`

262 374 

263Type / Values375Type / Values

264 376 

265`file | keyring | auto`377`boolean`

266 378 

267Details379Details

268 380 

269Control where the CLI stores cached credentials (file-based auth.json vs OS keychain).381When `true`, skill-script approval prompts are allowed to surface.

270 382 

271Key383Key

272 384 

273`compact_prompt`385`apps._default.destructive_enabled`

274 386 

275Type / Values387Type / Values

276 388 

277`string`389`boolean`

278 390 

279Details391Details

280 392 

281Inline override for the history compaction prompt.393Default allow/deny for app tools with `destructive_hint = true`.

282 394 

283Key395Key

284 396 

285`developer_instructions`397`apps._default.enabled`

286 398 

287Type / Values399Type / Values

288 400 

289`string`401`boolean`

290 402 

291Details403Details

292 404 

293Additional developer instructions injected into the session (optional).405Default app enabled state for all apps unless overridden per app.

294 406 

295Key407Key

296 408 

297`disable_paste_burst`409`apps._default.open_world_enabled`

298 410 

299Type / Values411Type / Values

300 412 


302 414 

303Details415Details

304 416 

305Disable burst-paste detection in the TUI.417Default allow/deny for app tools with `open_world_hint = true`.

306 418 

307Key419Key

308 420 

309`experimental_compact_prompt_file`421`apps.<id>.default_tools_approval_mode`

310 422 

311Type / Values423Type / Values

312 424 

313`string (path)`425`auto | prompt | approve`

314 426 

315Details427Details

316 428 

317Load the compaction prompt override from a file (experimental).429Default approval behavior for tools in this app unless a per-tool override exists.

318 430 

319Key431Key

320 432 

321`experimental_use_freeform_apply_patch`433`apps.<id>.default_tools_enabled`

322 434 

323Type / Values435Type / Values

324 436 


326 438 

327Details439Details

328 440 

329Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform` or `codex --enable apply_patch_freeform`.441Default enabled state for tools in this app unless a per-tool override exists.

330 442 

331Key443Key

332 444 

333`experimental_use_unified_exec_tool`445`apps.<id>.destructive_enabled`

334 446 

335Type / Values447Type / Values

336 448 


338 450 

339Details451Details

340 452 

341Legacy name for enabling unified exec; prefer `[features].unified_exec` or `codex --enable unified_exec`.453Allow or block tools in this app that advertise `destructive_hint = true`.

342 454 

343Key455Key

344 456 

345`features.apply_patch_freeform`457`apps.<id>.enabled`

346 458 

347Type / Values459Type / Values

348 460 


350 462 

351Details463Details

352 464 

353Expose the freeform `apply_patch` tool (experimental).465Enable or disable a specific app/connector by id (default: true).

354 466 

355Key467Key

356 468 

357`features.apps`469`apps.<id>.open_world_enabled`

358 470 

359Type / Values471Type / Values

360 472 


362 474 

363Details475Details

364 476 

365Enable ChatGPT Apps/connectors support (experimental).477Allow or block tools in this app that advertise `open_world_hint = true`.

366 478 

367Key479Key

368 480 

369`features.apps_mcp_gateway`481`apps.<id>.tools.<tool>.approval_mode`

370 482 

371Type / Values483Type / Values

372 484 

373`boolean`485`auto | prompt | approve`

374 486 

375Details487Details

376 488 

377Route Apps MCP calls through the OpenAI connectors MCP gateway (`https://api.openai.com/v1/connectors/mcp/`) instead of legacy routing (experimental).489Per-tool approval behavior override for a single app tool.

378 490 

379Key491Key

380 492 

381`features.child_agents_md`493`apps.<id>.tools.<tool>.enabled`

382 494 

383Type / Values495Type / Values

384 496 


386 498 

387Details499Details

388 500 

389Append AGENTS.md scope/precedence guidance even when no AGENTS.md is present (experimental).501Per-tool enabled override for an app tool (for example `repos/list`).

502 

503Key

504 

505`background_terminal_max_timeout`

506 

507Type / Values

508 

509`number`

510 

511Details

512 

513Maximum poll window in milliseconds for empty `write_stdin` polls (background terminal polling). Default: `300000` (5 minutes). Replaces the older `background_terminal_timeout` key.

514 

515Key

516 

517`chatgpt_base_url`

518 

519Type / Values

520 

521`string`

522 

523Details

524 

525Override the base URL used during the ChatGPT login flow.

390 526 

391Key527Key

392 528 

393`features.collaboration_modes`529`check_for_update_on_startup`

394 530 

395Type / Values531Type / Values

396 532 


398 534 

399Details535Details

400 536 

401Enable collaboration modes such as plan mode (stable; on by default).537Check for Codex updates on startup (set to false only when updates are centrally managed).

538 

539Key

540 

541`cli_auth_credentials_store`

542 

543Type / Values

544 

545`file | keyring | auto`

546 

547Details

548 

549Control where the CLI stores cached credentials (file-based auth.json vs OS keychain).

550 

551Key

552 

553`commit_attribution`

554 

555Type / Values

556 

557`string`

558 

559Details

560 

561Override the commit co-author trailer text. Set an empty string to disable automatic attribution.

562 

563Key

564 

565`compact_prompt`

566 

567Type / Values

568 

569`string`

570 

571Details

572 

573Inline override for the history compaction prompt.

574 

575Key

576 

577`default_permissions`

578 

579Type / Values

580 

581`string`

582 

583Details

584 

585Name of the default permissions profile to apply to sandboxed tool calls.

586 

587Key

588 

589`developer_instructions`

590 

591Type / Values

592 

593`string`

594 

595Details

596 

597Additional developer instructions injected into the session (optional).

402 598 

403Key599Key

404 600 

405`features.elevated_windows_sandbox`601`disable_paste_burst`

406 602 

407Type / Values603Type / Values

408 604 


410 606 

411Details607Details

412 608 

413Enable the elevated Windows sandbox pipeline (experimental).609Disable burst-paste detection in the TUI.

610 

611Key

612 

613`experimental_compact_prompt_file`

614 

615Type / Values

616 

617`string (path)`

618 

619Details

620 

621Load the compaction prompt override from a file (experimental).

414 622 

415Key623Key

416 624 

417`features.experimental_windows_sandbox`625`experimental_use_unified_exec_tool`

418 626 

419Type / Values627Type / Values

420 628 


422 630 

423Details631Details

424 632 

425Run the Windows restricted-token sandbox (experimental).633Legacy name for enabling unified exec; prefer `[features].unified_exec` or `codex --enable unified_exec`.

426 634 

427Key635Key

428 636 

429`features.multi_agent`637`features.apps`

430 638 

431Type / Values639Type / Values

432 640 


434 642 

435Details643Details

436 644 

437Enable multi-agent collaboration tools (`spawn\_agent`, `send\_input`, `resume\_agent`, `wait`, and `close\_agent`) (experimental; off by default).645Enable ChatGPT Apps/connectors support (experimental).

438 646 

439Key647Key

440 648 

441`features.personality`649`features.codex_hooks`

442 650 

443Type / Values651Type / Values

444 652 


446 654 

447Details655Details

448 656 

449Enable personality selection controls (stable; on by default).657Enable lifecycle hooks loaded from `hooks.json` (under development; off by default).

450 658 

451Key659Key

452 660 

453`features.powershell_utf8`661`features.enable_request_compression`

454 662 

455Type / Values663Type / Values

456 664 


458 666 

459Details667Details

460 668 

461Force PowerShell UTF-8 output (defaults to true).669Compress streaming request bodies with zstd when supported (stable; on by default).

462 670 

463Key671Key

464 672 

465`features.remote_models`673`features.fast_mode`

466 674 

467Type / Values675Type / Values

468 676 


470 678 

471Details679Details

472 680 

473Refresh remote model list before showing readiness (experimental).681Enable Fast mode selection and the `service_tier = "fast"` path (stable; on by default).

474 682 

475Key683Key

476 684 

477`features.request_rule`685`features.multi_agent`

478 686 

479Type / Values687Type / Values

480 688 


482 690 

483Details691Details

484 692 

485Enable Smart approvals (`prefix_rule` suggestions on escalation requests; stable; on by default).693Enable multi-agent collaboration tools (`spawn_agent`, `send_input`, `resume_agent`, `wait_agent`, and `close_agent`) (stable; on by default).

486 694 

487Key695Key

488 696 

489`features.runtime_metrics`697`features.personality`

490 698 

491Type / Values699Type / Values

492 700 


494 702 

495Details703Details

496 704 

497Show runtime metrics summary in TUI turn separators (experimental).705Enable personality selection controls (stable; on by default).

498 706 

499Key707Key

500 708 

501`features.search_tool`709`features.prevent_idle_sleep`

502 710 

503Type / Values711Type / Values

504 712 


506 714 

507Details715Details

508 716 

509Enable `search_tool_bm25` for Apps tool discovery before invoking app MCP tools (experimental).717Prevent the machine from sleeping while a turn is actively running (experimental; off by default).

510 718 

511Key719Key

512 720 


518 726 

519Details727Details

520 728 

521Snapshot shell environment to speed up repeated commands (beta).729Snapshot shell environment to speed up repeated commands (stable; on by default).

522 730 

523Key731Key

524 732 


534 742 

535Key743Key

536 744 

537`features.unified_exec`745`features.skill_mcp_dependency_install`

746 

747Type / Values

748 

749`boolean`

750 

751Details

752 

753Allow prompting and installing missing MCP dependencies for skills (stable; on by default).

754 

755Key

756 

757`features.smart_approvals`

758 

759Type / Values

760 

761`boolean`

762 

763Details

764 

765Route eligible approval requests through the guardian reviewer subagent (experimental; off by default).

766 

767Key

768 

769`features.undo`

538 770 

539Type / Values771Type / Values

540 772 


542 774 

543Details775Details

544 776 

545Use the unified PTY-backed exec tool (beta).777Enable undo support (stable; off by default).

546 778 

547Key779Key

548 780 

549`features.use_linux_sandbox_bwrap`781`features.unified_exec`

550 782 

551Type / Values783Type / Values

552 784 


554 786 

555Details787Details

556 788 

557Use the bubblewrap-based Linux sandbox pipeline (experimental; off by default).789Use the unified PTY-backed exec tool (stable; enabled by default except on Windows).

558 790 

559Key791Key

560 792 


678 910 

679Key911Key

680 912 

681`include_apply_patch_tool`

682 

683Type / Values

684 

685`boolean`

686 

687Details

688 

689Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform`.

690 

691Key

692 

693`instructions`913`instructions`

694 914 

695Type / Values915Type / Values


726 946 

727Key947Key

728 948 

949`mcp_oauth_callback_url`

950 

951Type / Values

952 

953`string`

954 

955Details

956 

957Optional redirect URI override for MCP OAuth login (for example, a devbox ingress URL). `mcp_oauth_callback_port` still controls the callback listener port.

958 

959Key

960 

729`mcp_oauth_credentials_store`961`mcp_oauth_credentials_store`

730 962 

731Type / Values963Type / Values


870 1102 

871Key1103Key

872 1104 

1105`mcp_servers.<id>.oauth_resource`

1106 

1107Type / Values

1108 

1109`string`

1110 

1111Details

1112 

1113Optional RFC 8707 OAuth resource parameter to include during MCP login.

1114 

1115Key

1116 

873`mcp_servers.<id>.required`1117`mcp_servers.<id>.required`

874 1118 

875Type / Values1119Type / Values


882 1126 

883Key1127Key

884 1128 

1129`mcp_servers.<id>.scopes`

1130 

1131Type / Values

1132 

1133`array<string>`

1134 

1135Details

1136 

1137OAuth scopes to request when authenticating to that MCP server.

1138 

1139Key

1140 

885`mcp_servers.<id>.startup_timeout_ms`1141`mcp_servers.<id>.startup_timeout_ms`

886 1142 

887Type / Values1143Type / Values


954 1210 

955Key1211Key

956 1212 

957`model_context_window`1213`model_catalog_json`

958 1214 

959Type / Values1215Type / Values

960 1216 

961`number`1217`string (path)`

962 1218 

963Details1219Details

964 1220 

965Context window tokens available to the active model.1221Optional path to a JSON model catalog loaded on startup. Profile-level `profiles.<name>.model_catalog_json` can override this per profile.

966 1222 

967Key1223Key

968 1224 

969`model_instructions_file`1225`model_context_window`

1226 

1227Type / Values

1228 

1229`number`

1230 

1231Details

1232 

1233Context window tokens available to the active model.

1234 

1235Key

1236 

1237`model_instructions_file`

970 1238 

971Type / Values1239Type / Values

972 1240 


1134 1402 

1135Key1403Key

1136 1404 

1405`model_providers.<id>.supports_websockets`

1406 

1407Type / Values

1408 

1409`boolean`

1410 

1411Details

1412 

1413Whether that provider supports the Responses API WebSocket transport.

1414 

1415Key

1416 

1137`model_providers.<id>.wire_api`1417`model_providers.<id>.wire_api`

1138 1418 

1139Type / Values1419Type / Values

1140 1420 

1141`chat | responses`1421`responses`

1142 1422 

1143Details1423Details

1144 1424 

1145Protocol used by the provider (defaults to `chat` if omitted).1425Protocol used by the provider. `responses` is the only supported value, and it is the default when omitted.

1146 1426 

1147Key1427Key

1148 1428 


1190 1470 

1191Details1471Details

1192 1472 

1193Control GPT-5 Responses API verbosity (defaults to `medium`).1473Optional GPT-5 Responses API verbosity override; when unset, the selected model/preset default is used.

1194 1474 

1195Key1475Key

1196 1476 


1278 1558 

1279Key1559Key

1280 1560 

1561`openai_base_url`

1562 

1563Type / Values

1564 

1565`string`

1566 

1567Details

1568 

1569Base URL override for the built-in `openai` model provider.

1570 

1571Key

1572 

1281`oss_provider`1573`oss_provider`

1282 1574 

1283Type / Values1575Type / Values


1398 1690 

1399Key1691Key

1400 1692 

1693`otel.metrics_exporter`

1694 

1695Type / Values

1696 

1697`none | statsig | otlp-http | otlp-grpc`

1698 

1699Details

1700 

1701Select the OpenTelemetry metrics exporter (defaults to `statsig`).

1702 

1703Key

1704 

1401`otel.trace_exporter`1705`otel.trace_exporter`

1402 1706 

1403Type / Values1707Type / Values


1482 1786 

1483Key1787Key

1484 1788 

1789`permissions.<name>.filesystem`

1790 

1791Type / Values

1792 

1793`table`

1794 

1795Details

1796 

1797Named filesystem permission profile. Each key is an absolute path or special token such as `:minimal` or `:project_roots`.

1798 

1799Key

1800 

1801`permissions.<name>.filesystem.":project_roots".<subpath>`

1802 

1803Type / Values

1804 

1805`"read" | "write" | "none"`

1806 

1807Details

1808 

1809Scoped filesystem access relative to the detected project roots. Use `"."` for the root itself.

1810 

1811Key

1812 

1813`permissions.<name>.filesystem.<path>`

1814 

1815Type / Values

1816 

1817`"read" | "write" | "none" | table`

1818 

1819Details

1820 

1821Grant direct access for a path or special token, or scope nested entries under that root.

1822 

1823Key

1824 

1825`permissions.<name>.network.allow_local_binding`

1826 

1827Type / Values

1828 

1829`boolean`

1830 

1831Details

1832 

1833Permit local bind/listen operations through the managed proxy.

1834 

1835Key

1836 

1837`permissions.<name>.network.allow_unix_sockets`

1838 

1839Type / Values

1840 

1841`array<string>`

1842 

1843Details

1844 

1845Allowlist of Unix socket paths permitted through the managed proxy.

1846 

1847Key

1848 

1849`permissions.<name>.network.allow_upstream_proxy`

1850 

1851Type / Values

1852 

1853`boolean`

1854 

1855Details

1856 

1857Allow the managed proxy to chain to another upstream proxy.

1858 

1859Key

1860 

1861`permissions.<name>.network.allowed_domains`

1862 

1863Type / Values

1864 

1865`array<string>`

1866 

1867Details

1868 

1869Allowlist of domains permitted through the managed proxy.

1870 

1871Key

1872 

1873`permissions.<name>.network.dangerously_allow_all_unix_sockets`

1874 

1875Type / Values

1876 

1877`boolean`

1878 

1879Details

1880 

1881Allow the proxy to use arbitrary Unix sockets instead of the default restricted set.

1882 

1883Key

1884 

1885`permissions.<name>.network.dangerously_allow_non_loopback_proxy`

1886 

1887Type / Values

1888 

1889`boolean`

1890 

1891Details

1892 

1893Permit non-loopback bind addresses for the managed proxy listener.

1894 

1895Key

1896 

1897`permissions.<name>.network.denied_domains`

1898 

1899Type / Values

1900 

1901`array<string>`

1902 

1903Details

1904 

1905Denylist of domains blocked by the managed proxy.

1906 

1907Key

1908 

1909`permissions.<name>.network.enable_socks5`

1910 

1911Type / Values

1912 

1913`boolean`

1914 

1915Details

1916 

1917Expose a SOCKS5 listener when this permissions profile enables the managed network proxy.

1918 

1919Key

1920 

1921`permissions.<name>.network.enable_socks5_udp`

1922 

1923Type / Values

1924 

1925`boolean`

1926 

1927Details

1928 

1929Allow UDP over the SOCKS5 listener when enabled.

1930 

1931Key

1932 

1933`permissions.<name>.network.enabled`

1934 

1935Type / Values

1936 

1937`boolean`

1938 

1939Details

1940 

1941Enable network access for this named permissions profile.

1942 

1943Key

1944 

1945`permissions.<name>.network.mode`

1946 

1947Type / Values

1948 

1949`limited | full`

1950 

1951Details

1952 

1953Network proxy mode used for subprocess traffic.

1954 

1955Key

1956 

1957`permissions.<name>.network.proxy_url`

1958 

1959Type / Values

1960 

1961`string`

1962 

1963Details

1964 

1965HTTP proxy endpoint used when this permissions profile enables the managed network proxy.

1966 

1967Key

1968 

1969`permissions.<name>.network.socks_url`

1970 

1971Type / Values

1972 

1973`string`

1974 

1975Details

1976 

1977SOCKS5 proxy endpoint used by this permissions profile.

1978 

1979Key

1980 

1485`personality`1981`personality`

1486 1982 

1487Type / Values1983Type / Values


1494 1990 

1495Key1991Key

1496 1992 

1993`plan_mode_reasoning_effort`

1994 

1995Type / Values

1996 

1997`none | minimal | low | medium | high | xhigh`

1998 

1999Details

2000 

2001Plan-mode-specific reasoning override. When unset, Plan mode uses its built-in preset default.

2002 

2003Key

2004 

1497`profile`2005`profile`

1498 2006 

1499Type / Values2007Type / Values


1518 2026 

1519Key2027Key

1520 2028 

1521`profiles.<name>.experimental_use_freeform_apply_patch`2029`profiles.<name>.analytics.enabled`

1522 2030 

1523Type / Values2031Type / Values

1524 2032 


1526 2034 

1527Details2035Details

1528 2036 

1529Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform`.2037Profile-scoped analytics enablement override.

1530 2038 

1531Key2039Key

1532 2040 


1542 2050 

1543Key2051Key

1544 2052 

1545`profiles.<name>.include_apply_patch_tool`2053`profiles.<name>.model_catalog_json`

1546 2054 

1547Type / Values2055Type / Values

1548 2056 

1549`boolean`2057`string (path)`

1550 2058 

1551Details2059Details

1552 2060 

1553Legacy name for enabling freeform apply\_patch; prefer `[features].apply_patch_freeform`.2061Profile-scoped model catalog JSON path override (applied on startup only; overrides the top-level `model_catalog_json` for that profile).

2062 

2063Key

2064 

2065`profiles.<name>.model_instructions_file`

2066 

2067Type / Values

2068 

2069`string (path)`

2070 

2071Details

2072 

2073Profile-scoped replacement for the built-in instruction file.

1554 2074 

1555Key2075Key

1556 2076 


1578 2098 

1579Key2099Key

1580 2100 

2101`profiles.<name>.plan_mode_reasoning_effort`

2102 

2103Type / Values

2104 

2105`none | minimal | low | medium | high | xhigh`

2106 

2107Details

2108 

2109Profile-scoped Plan-mode reasoning override.

2110 

2111Key

2112 

2113`profiles.<name>.service_tier`

2114 

2115Type / Values

2116 

2117`flex | fast`

2118 

2119Details

2120 

2121Profile-scoped service tier preference for new turns.

2122 

2123Key

2124 

2125`profiles.<name>.tools_view_image`

2126 

2127Type / Values

2128 

2129`boolean`

2130 

2131Details

2132 

2133Enable or disable the `view_image` tool in that profile.

2134 

2135Key

2136 

1581`profiles.<name>.web_search`2137`profiles.<name>.web_search`

1582 2138 

1583Type / Values2139Type / Values


1590 2146 

1591Key2147Key

1592 2148 

2149`profiles.<name>.windows.sandbox`

2150 

2151Type / Values

2152 

2153`unelevated | elevated`

2154 

2155Details

2156 

2157Profile-scoped Windows sandbox mode override.

2158 

2159Key

2160 

1593`project_doc_fallback_filenames`2161`project_doc_fallback_filenames`

1594 2162 

1595Type / Values2163Type / Values


1710 2278 

1711Key2279Key

1712 2280 

2281`service_tier`

2282 

2283Type / Values

2284 

2285`flex | fast`

2286 

2287Details

2288 

2289Preferred service tier for new turns.

2290 

2291Key

2292 

1713`shell_environment_policy.exclude`2293`shell_environment_policy.exclude`

1714 2294 

1715Type / Values2295Type / Values


1830 2410 

1831Key2411Key

1832 2412 

2413`sqlite_home`

2414 

2415Type / Values

2416 

2417`string (path)`

2418 

2419Details

2420 

2421Directory where Codex stores the SQLite-backed state DB used by agent jobs and other resumable runtime state.

2422 

2423Key

2424 

1833`suppress_unstable_features_warning`2425`suppress_unstable_features_warning`

1834 2426 

1835Type / Values2427Type / Values


1854 2446 

1855Key2447Key

1856 2448 

1857`tools.web_search`2449`tools.view_image`

1858 2450 

1859Type / Values2451Type / Values

1860 2452 


1862 2454 

1863Details2455Details

1864 2456 

1865Deprecated legacy toggle for web search; prefer the top-level `web_search` setting.2457Enable the local-image attachment tool `view_image`.

2458 

2459Key

2460 

2461`tools.web_search`

2462 

2463Type / Values

2464 

2465`boolean | { context_size = "low|medium|high", allowed_domains = [string], location = { country, region, city, timezone } }`

2466 

2467Details

2468 

2469Optional web search tool configuration. The legacy boolean form is still accepted, but the object form lets you set search context size, allowed domains, and approximate user location.

1866 2470 

1867Key2471Key

1868 2472 


1902 2506 

1903Key2507Key

1904 2508 

2509`tui.model_availability_nux.<model>`

2510 

2511Type / Values

2512 

2513`integer`

2514 

2515Details

2516 

2517Internal startup-tooltip state keyed by model slug.

2518 

2519Key

2520 

1905`tui.notification_method`2521`tui.notification_method`

1906 2522 

1907Type / Values2523Type / Values


1950 2566 

1951Key2567Key

1952 2568 

2569`tui.theme`

2570 

2571Type / Values

2572 

2573`string`

2574 

2575Details

2576 

2577Syntax-highlighting theme override (kebab-case theme name).

2578 

2579Key

2580 

1953`web_search`2581`web_search`

1954 2582 

1955Type / Values2583Type / Values


1972 2600 

1973Track Windows onboarding acknowledgement (Windows only).2601Track Windows onboarding acknowledgement (Windows only).

1974 2602 

2603Key

2604 

2605`windows.sandbox`

2606 

2607Type / Values

2608 

2609`unelevated | elevated`

2610 

2611Details

2612 

2613Windows-only native sandbox mode when running Codex natively on Windows.

2614 

2615Key

2616 

2617`windows.sandbox_private_desktop`

2618 

2619Type / Values

2620 

2621`boolean`

2622 

2623Details

2624 

2625Run the final sandboxed child process on a private desktop by default on native Windows. Set `false` only for compatibility with the older `Winsta0\\Default` behavior.

2626 

1975Expand to view all2627Expand to view all

1976 2628 

1977You can find the latest JSON schema for `config.toml` [here](https://developers.openai.com/codex/config-schema.json).2629You can find the latest JSON schema for `config.toml` [here](https://developers.openai.com/codex/config-schema.json).


1986 2638 

1987## `requirements.toml`2639## `requirements.toml`

1988 2640 

1989`requirements.toml` is an admin-enforced configuration file that constrains security-sensitive settings users cant override. For details, locations, and examples, see [Admin-enforced requirements](https://developers.openai.com/codex/security#admin-enforced-requirements-requirementstoml).2641`requirements.toml` is an admin-enforced configuration file that constrains security-sensitive settings users can't override. For details, locations, and examples, see [Admin-enforced requirements](https://developers.openai.com/codex/enterprise/managed-configuration#admin-enforced-requirements-requirementstoml).

1990 2642 

1991For ChatGPT Business and Enterprise users, Codex can also apply cloud-fetched2643For ChatGPT Business and Enterprise users, Codex can also apply cloud-fetched

1992requirements. See the security page for precedence details.2644requirements. See the security page for precedence details.

1993 2645 

2646Use `[features]` in `requirements.toml` to pin feature flags by the same

2647canonical keys that `config.toml` uses. Omitted keys remain unconstrained.

2648 

1994| Key | Type / Values | Details |2649| Key | Type / Values | Details |

1995| --- | --- | --- |2650| --- | --- | --- |

1996| `allowed_approval_policies` | `array<string>` | Allowed values for `approval\_policy`. |2651| `allowed_approval_policies` | `array<string>` | Allowed values for `approval_policy` (for example `untrusted`, `on-request`, `never`, and `granular`). |

1997| `allowed_sandbox_modes` | `array<string>` | Allowed values for `sandbox_mode`. |2652| `allowed_sandbox_modes` | `array<string>` | Allowed values for `sandbox_mode`. |

1998| `allowed_web_search_modes` | `array<string>` | Allowed values for `web_search` (`disabled`, `cached`, `live`). `disabled` is always allowed; an empty list effectively allows only `disabled`. |2653| `allowed_web_search_modes` | `array<string>` | Allowed values for `web_search` (`disabled`, `cached`, `live`). `disabled` is always allowed; an empty list effectively allows only `disabled`. |

2654| `features` | `table` | Pinned feature values keyed by the canonical names from `config.toml`'s `[features]` table. |

2655| `features.<name>` | `boolean` | Require a specific canonical feature key to stay enabled or disabled. |

1999| `mcp_servers` | `table` | Allowlist of MCP servers that may be enabled. Both the server name (`<id>`) and its identity must match for the MCP server to be enabled. Any configured MCP server not in the allowlist (or with a mismatched identity) is disabled. |2656| `mcp_servers` | `table` | Allowlist of MCP servers that may be enabled. Both the server name (`<id>`) and its identity must match for the MCP server to be enabled. Any configured MCP server not in the allowlist (or with a mismatched identity) is disabled. |

2000| `mcp_servers.<id>.identity` | `table` | Identity rule for a single MCP server. Set either `command` (stdio) or `url` (streamable HTTP). |2657| `mcp_servers.<id>.identity` | `table` | Identity rule for a single MCP server. Set either `command` (stdio) or `url` (streamable HTTP). |

2001| `mcp_servers.<id>.identity.command` | `string` | Allow an MCP stdio server when its `mcp_servers.<id>.command` matches this command. |2658| `mcp_servers.<id>.identity.command` | `string` | Allow an MCP stdio server when its `mcp_servers.<id>.command` matches this command. |


2018 2675 

2019Details2676Details

2020 2677 

2021Allowed values for `approval\_policy`.2678Allowed values for `approval_policy` (for example `untrusted`, `on-request`, `never`, and `granular`).

2022 2679 

2023Key2680Key

2024 2681 


2046 2703 

2047Key2704Key

2048 2705 

2706`features`

2707 

2708Type / Values

2709 

2710`table`

2711 

2712Details

2713 

2714Pinned feature values keyed by the canonical names from `config.toml`'s `[features]` table.

2715 

2716Key

2717 

2718`features.<name>`

2719 

2720Type / Values

2721 

2722`boolean`

2723 

2724Details

2725 

2726Require a specific canonical feature key to stay enabled or disabled.

2727 

2728Key

2729 

2049`mcp_servers`2730`mcp_servers`

2050 2731 

2051Type / Values2732Type / Values

config-sample.md +187 −108

Details

1# Sample Configuration1# Sample Configuration

2 2 

3Use this example configuration as a starting point. It includes most keys Codex reads from `config.toml`, along with defaults and short notes.3Use this example configuration as a starting point. It includes most keys Codex reads from `config.toml`, along with default behaviors, recommended values where helpful, and short notes.

4 4 

5For explanations and guidance, see:5For explanations and guidance, see:

6 6 

7- [Config basics](https://developers.openai.com/codex/config-basic)7- [Config basics](https://developers.openai.com/codex/config-basic)

8- [Advanced Config](https://developers.openai.com/codex/config-advanced)8- [Advanced Config](https://developers.openai.com/codex/config-advanced)

9- [Config Reference](https://developers.openai.com/codex/config-reference)9- [Config Reference](https://developers.openai.com/codex/config-reference)

10- [Sandbox and approvals](https://developers.openai.com/codex/agent-approvals-security#sandbox-and-approvals)

11- [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration)

10 12 

11Use the snippet below as a reference. Copy only the keys and sections you need into `~/.codex/config.toml` (or into a project-scoped `.codex/config.toml`), then adjust values for your setup.13Use the snippet below as a reference. Copy only the keys and sections you need into `~/.codex/config.toml` (or into a project-scoped `.codex/config.toml`), then adjust values for your setup.

12 14 

13```toml15```toml

14# Codex example configuration (config.toml)16# Codex example configuration (config.toml)

15#17#

16# This file lists all keys Codex reads from config.toml, their default values,18# This file lists the main keys Codex reads from config.toml, along with default

17# and concise explanations. Values here mirror the effective defaults compiled19# behaviors, recommended examples, and concise explanations. Adjust as needed.

18# into the CLI. Adjust as needed.

19#20#

20# Notes21# Notes

21# - Root keys must appear before tables in TOML.22# - Root keys must appear before tables in TOML.


26# Core Model Selection27# Core Model Selection

27################################################################################28################################################################################

28 29 

29# Primary model used by Codex. Default: "gpt-5.2-codex" on all platforms.30# Primary model used by Codex. Recommended example for most users: "gpt-5.4".

30model = "gpt-5.2-codex"31model = "gpt-5.4"

31 32 

32# Default communication style for supported models. Default: "friendly".33# Communication style for supported models. Allowed values: none | friendly | pragmatic

33# Allowed values: none | friendly | pragmatic34# personality = "pragmatic"

34# personality = "friendly"

35 35 

36# Optional model override for /review. Default: unset (uses current session model).36# Optional model override for /review. Default: unset (uses current session model).

37# review_model = "gpt-5.2-codex"37# review_model = "gpt-5.4"

38 38 

39# Provider id selected from [model_providers]. Default: "openai".39# Provider id selected from [model_providers]. Default: "openai".

40model_provider = "openai"40model_provider = "openai"


42# Default OSS provider for --oss sessions. When unset, Codex prompts. Default: unset.42# Default OSS provider for --oss sessions. When unset, Codex prompts. Default: unset.

43# oss_provider = "ollama"43# oss_provider = "ollama"

44 44 

45# Optional manual model metadata. When unset, Codex auto-detects from model.45# Preferred service tier. `fast` is honored only when enabled in [features].

46# Uncomment to force values.46# service_tier = "flex" # fast | flex

47 

48# Optional manual model metadata. When unset, Codex uses model or preset defaults.

47# model_context_window = 128000 # tokens; default: auto for model49# model_context_window = 128000 # tokens; default: auto for model

48# model_auto_compact_token_limit = 0 # tokens; unset uses model defaults50# model_auto_compact_token_limit = 64000 # tokens; unset uses model defaults

49# tool_output_token_limit = 10000 # tokens stored per tool output; default: 10000 for gpt-5.2-codex51# tool_output_token_limit = 12000 # tokens stored per tool output

52# model_catalog_json = "/absolute/path/to/models.json" # optional startup-only model catalog override

53# background_terminal_max_timeout = 300000 # ms; max empty write_stdin poll window (default 5m)

50# log_dir = "/absolute/path/to/codex-logs" # directory for Codex logs; default: "$CODEX_HOME/log"54# log_dir = "/absolute/path/to/codex-logs" # directory for Codex logs; default: "$CODEX_HOME/log"

55# sqlite_home = "/absolute/path/to/codex-state" # optional SQLite-backed runtime state directory

51 56 

52################################################################################57################################################################################

53# Reasoning & Verbosity (Responses API capable models)58# Reasoning & Verbosity (Responses API capable models)

54################################################################################59################################################################################

55 60 

56# Reasoning effort: minimal | low | medium | high | xhigh (default: medium; xhigh on gpt-5.2-codex and gpt-5.2)61# Reasoning effort: minimal | low | medium | high | xhigh

57model_reasoning_effort = "medium"62# model_reasoning_effort = "medium"

63 

64# Optional override used when Codex runs in plan mode: none | minimal | low | medium | high | xhigh

65# plan_mode_reasoning_effort = "high"

58 66 

59# Reasoning summary: auto | concise | detailed | none (default: auto)67# Reasoning summary: auto | concise | detailed | none

60# model_reasoning_summary = "auto"68# model_reasoning_summary = "auto"

61 69 

62# Text verbosity for GPT-5 family (Responses API): low | medium | high (default: medium)70# Text verbosity for GPT-5 family (Responses API): low | medium | high

63# model_verbosity = "medium"71# model_verbosity = "medium"

64 72 

65# Force enable or disable reasoning summaries for current model73# Force enable or disable reasoning summaries for current model.

66# model_supports_reasoning_summaries = true74# model_supports_reasoning_summaries = true

67 75 

68################################################################################76################################################################################


72# Additional user instructions are injected before AGENTS.md. Default: unset.80# Additional user instructions are injected before AGENTS.md. Default: unset.

73# developer_instructions = ""81# developer_instructions = ""

74 82 

75# (Ignored) Optional legacy base instructions override (prefer AGENTS.md). Default: unset.

76# instructions = ""

77 

78# Inline override for the history compaction prompt. Default: unset.83# Inline override for the history compaction prompt. Default: unset.

79# compact_prompt = ""84# compact_prompt = ""

80 85 

86# Override the default commit co-author trailer. Set to "" to disable it.

87# commit_attribution = "Jane Doe <jane@example.com>"

88 

81# Override built-in base instructions with a file path. Default: unset.89# Override built-in base instructions with a file path. Default: unset.

82# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"90# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"

83 91 

84# Migration note: experimental_instructions_file was renamed to model_instructions_file (deprecated).

85 

86# Load the compact prompt override from a file. Default: unset.92# Load the compact prompt override from a file. Default: unset.

87# experimental_compact_prompt_file = "/absolute/or/relative/path/to/compact_prompt.txt"93# experimental_compact_prompt_file = "/absolute/or/relative/path/to/compact_prompt.txt"

88 94 

89# Legacy name for apply_patch_freeform. Default: false

90include_apply_patch_tool = false

91 

92################################################################################95################################################################################

93# Notifications96# Notifications

94################################################################################97################################################################################

95 98 

96# External notifier program (argv array). When unset: disabled.99# External notifier program (argv array). When unset: disabled.

97# Example: notify = ["notify-send", "Codex"]100# notify = ["notify-send", "Codex"]

98notify = [ ]

99 101 

100################################################################################102################################################################################

101# Approval & Sandbox103# Approval & Sandbox


105# - untrusted: only known-safe read-only commands auto-run; others prompt107# - untrusted: only known-safe read-only commands auto-run; others prompt

106# - on-request: model decides when to ask (default)108# - on-request: model decides when to ask (default)

107# - never: never prompt (risky)109# - never: never prompt (risky)

110# - { granular = { ... } }: allow or auto-reject selected prompt categories

108approval_policy = "on-request"111approval_policy = "on-request"

112# Example granular policy:

113# approval_policy = { granular = {

114# sandbox_approval = true,

115# rules = true,

116# mcp_elicitations = true,

117# request_permissions = false,

118# skill_approval = false

119# } }

120 

121# Allow login-shell semantics for shell-based tools when they request `login = true`.

122# Default: true. Set false to force non-login shells and reject explicit login-shell requests.

123allow_login_shell = true

109 124 

110# Filesystem/network sandbox policy for tool calls:125# Filesystem/network sandbox policy for tool calls:

111# - read-only (default)126# - read-only (default)


120# Where to persist CLI login credentials: file (default) | keyring | auto135# Where to persist CLI login credentials: file (default) | keyring | auto

121cli_auth_credentials_store = "file"136cli_auth_credentials_store = "file"

122 137 

123# Base URL for ChatGPT auth flow (not OpenAI API). Default:138# Base URL for ChatGPT auth flow (not OpenAI API).

124chatgpt_base_url = "https://chatgpt.com/backend-api/"139chatgpt_base_url = "https://chatgpt.com/backend-api/"

125 140 

141# Optional base URL override for the built-in OpenAI provider.

142# openai_base_url = "https://us.api.openai.com/v1"

143 

126# Restrict ChatGPT login to a specific workspace id. Default: unset.144# Restrict ChatGPT login to a specific workspace id. Default: unset.

127# forced_chatgpt_workspace_id = ""145# forced_chatgpt_workspace_id = "00000000-0000-0000-0000-000000000000"

128 146 

129# Force login mechanism when Codex would normally auto-select. Default: unset.147# Force login mechanism when Codex would normally auto-select. Default: unset.

130# Allowed values: chatgpt | api148# Allowed values: chatgpt | api


132 150 

133# Preferred store for MCP OAuth credentials: auto (default) | file | keyring151# Preferred store for MCP OAuth credentials: auto (default) | file | keyring

134mcp_oauth_credentials_store = "auto"152mcp_oauth_credentials_store = "auto"

135 

136# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.153# Optional fixed port for MCP OAuth callback: 1-65535. Default: unset.

137# mcp_oauth_callback_port = 4321154# mcp_oauth_callback_port = 4321

155# Optional redirect URI override for MCP OAuth login (for example, remote devbox ingress).

156# Custom callback paths are supported. `mcp_oauth_callback_port` still controls the listener port.

157# mcp_oauth_callback_url = "https://devbox.example.internal/callback"

138 158 

139################################################################################159################################################################################

140# Project Documentation Controls160# Project Documentation Controls


185# If you use --yolo or another full access sandbox setting, web search defaults to live.205# If you use --yolo or another full access sandbox setting, web search defaults to live.

186web_search = "cached"206web_search = "cached"

187 207 

208# Active profile name. When unset, no profile is applied.

209# profile = "default"

210 

211# Suppress the warning shown when under-development feature flags are enabled.

212# suppress_unstable_features_warning = true

213 

188################################################################################214################################################################################

189# Profiles (named presets)215# Agents (multi-agent roles and limits)

190################################################################################216################################################################################

191 217 

192# Active profile name. When unset, no profile is applied.218[agents]

193# profile = "default"219# Maximum concurrently open agent threads. Default: 6

220# max_threads = 6

221# Maximum nested spawn depth. Root session starts at depth 0. Default: 1

222# max_depth = 1

223# Default timeout per worker for spawn_agents_on_csv jobs. When unset, the tool defaults to 1800 seconds.

224# job_max_runtime_seconds = 1800

225 

226# [agents.reviewer]

227# description = "Find correctness, security, and test risks in code."

228# config_file = "./agents/reviewer.toml" # relative to the config.toml that defines it

229# nickname_candidates = ["Athena", "Ada"]

194 230 

195################################################################################231################################################################################

196# Skills (per-skill overrides)232# Skills (per-skill overrides)


198 234 

199# Disable or re-enable a specific skill without deleting it.235# Disable or re-enable a specific skill without deleting it.

200[[skills.config]]236[[skills.config]]

201# path = "/path/to/skill"237# path = "/path/to/skill/SKILL.md"

202# enabled = false238# enabled = false

203 239 

204################################################################################

205# Experimental toggles (legacy; prefer [features])

206################################################################################

207 

208experimental_use_unified_exec_tool = false

209 

210# Include apply_patch via freeform editing path (affects default tool set). Default: false

211experimental_use_freeform_apply_patch = false

212 

213################################################################################240################################################################################

214# Sandbox settings (tables)241# Sandbox settings (tables)

215################################################################################242################################################################################


232[shell_environment_policy]259[shell_environment_policy]

233# inherit: all (default) | core | none260# inherit: all (default) | core | none

234inherit = "all"261inherit = "all"

235# Skip default excludes for names containing KEY/SECRET/TOKEN (case-insensitive). Default: true262# Skip default excludes for names containing KEY/SECRET/TOKEN (case-insensitive). Default: false

236ignore_default_excludes = true263ignore_default_excludes = false

237# Case-insensitive glob patterns to remove (e.g., "AWS_*", "AZURE_*"). Default: []264# Case-insensitive glob patterns to remove (e.g., "AWS_*", "AZURE_*"). Default: []

238exclude = []265exclude = []

239# Explicit key/value overrides (always win). Default: {}266# Explicit key/value overrides (always win). Default: {}


243# Experimental: run via user shell profile. Default: false270# Experimental: run via user shell profile. Default: false

244experimental_use_profile = false271experimental_use_profile = false

245 272 

273################################################################################

274# Managed network proxy settings

275################################################################################

276 

277[permissions.network]

278# enabled = true

279# proxy_url = "http://127.0.0.1:43128"

280# admin_url = "http://127.0.0.1:43129"

281# enable_socks5 = false

282# socks_url = "http://127.0.0.1:43130"

283# enable_socks5_udp = false

284# allow_upstream_proxy = false

285# dangerously_allow_non_loopback_proxy = false

286# dangerously_allow_non_loopback_admin = false

287# dangerously_allow_all_unix_sockets = false

288# mode = "limited" # limited | full

289# allowed_domains = ["api.openai.com"]

290# denied_domains = ["example.com"]

291# allow_unix_sockets = ["/var/run/docker.sock"]

292# allow_local_binding = false

293 

246################################################################################294################################################################################

247# History (table)295# History (table)

248################################################################################296################################################################################


251# save-all (default) | none299# save-all (default) | none

252persistence = "save-all"300persistence = "save-all"

253# Maximum bytes for history file; oldest entries are trimmed when exceeded. Example: 5242880301# Maximum bytes for history file; oldest entries are trimmed when exceeded. Example: 5242880

254# max_bytes = 0302# max_bytes = 5242880

255 303 

256################################################################################304################################################################################

257# UI, Notifications, and Misc (tables)305# UI, Notifications, and Misc (tables)


274# Control alternate screen usage (auto skips it in Zellij to preserve scrollback).322# Control alternate screen usage (auto skips it in Zellij to preserve scrollback).

275# alternate_screen = "auto"323# alternate_screen = "auto"

276 324 

277# Ordered list of footer status-line item IDs. Default: null (disabled).325# Ordered list of footer status-line item IDs. When unset, Codex uses:

326# ["model-with-reasoning", "context-remaining", "current-dir"].

327# Set to [] to hide the footer.

278# status_line = ["model", "context-remaining", "git-branch"]328# status_line = ["model", "context-remaining", "git-branch"]

279 329 

330# Syntax-highlighting theme (kebab-case). Use /theme in the TUI to preview and save.

331# You can also add custom .tmTheme files under $CODEX_HOME/themes.

332# theme = "catppuccin-mocha"

333 

334# Internal tooltip state keyed by model slug. Usually managed by Codex.

335# [tui.model_availability_nux]

336# "gpt-5.4" = 1

337 

338# Enable or disable analytics for this machine. When unset, Codex uses its default behavior.

339[analytics]

340enabled = true

341 

280# Control whether users can submit feedback from `/feedback`. Default: true342# Control whether users can submit feedback from `/feedback`. Default: true

281[feedback]343[feedback]

282enabled = true344enabled = true


290# "hide_gpt-5.1-codex-max_migration_prompt" = true352# "hide_gpt-5.1-codex-max_migration_prompt" = true

291# model_migrations = { "gpt-4.1" = "gpt-5.1" }353# model_migrations = { "gpt-4.1" = "gpt-5.1" }

292 354 

293# Suppress the warning shown when under-development feature flags are enabled.

294# suppress_unstable_features_warning = true

295 

296################################################################################355################################################################################

297# Centralized Feature Flags (preferred)356# Centralized Feature Flags (preferred)

298################################################################################357################################################################################

299 358 

300[features]359[features]

301# Leave this table empty to accept defaults. Set explicit booleans to opt in/out.360# Leave this table empty to accept defaults. Set explicit booleans to opt in/out.

302shell_tool = true361# shell_tool = true

303# apps = false362# apps = false

304# apps_mcp_gateway = false363# codex_hooks = false

305# Deprecated legacy toggles; prefer the top-level `web_search` setting.364# unified_exec = true

306# web_search = false365# shell_snapshot = true

307# web_search_cached = false366# multi_agent = true

308# web_search_request = false

309unified_exec = false

310shell_snapshot = false

311apply_patch_freeform = false

312# search_tool = false

313# personality = true367# personality = true

314request_rule = true368# fast_mode = true

315collaboration_modes = true369# smart_approvals = false

316use_linux_sandbox_bwrap = false370# enable_request_compression = true

317experimental_windows_sandbox = false371# skill_mcp_dependency_install = true

318elevated_windows_sandbox = false372# prevent_idle_sleep = false

319remote_models = false

320runtime_metrics = false

321powershell_utf8 = true

322child_agents_md = false

323 373 

324################################################################################374################################################################################

325# Define MCP servers under this table. Leave empty to disable.375# Define MCP servers under this table. Leave empty to disable.


341# tool_timeout_sec = 60.0 # optional; default 60.0 seconds391# tool_timeout_sec = 60.0 # optional; default 60.0 seconds

342# enabled_tools = ["search", "summarize"] # optional allow-list392# enabled_tools = ["search", "summarize"] # optional allow-list

343# disabled_tools = ["slow-tool"] # optional deny-list (applied after allow-list)393# disabled_tools = ["slow-tool"] # optional deny-list (applied after allow-list)

394# scopes = ["read:docs"] # optional OAuth scopes

395# oauth_resource = "https://docs.example.com/" # optional OAuth resource

344 396 

345# --- Example: Streamable HTTP transport ---397# --- Example: Streamable HTTP transport ---

346# [mcp_servers.github]398# [mcp_servers.github]


353# startup_timeout_sec = 10.0 # optional405# startup_timeout_sec = 10.0 # optional

354# tool_timeout_sec = 60.0 # optional406# tool_timeout_sec = 60.0 # optional

355# enabled_tools = ["list_issues"] # optional allow-list407# enabled_tools = ["list_issues"] # optional allow-list

408# disabled_tools = ["delete_issue"] # optional deny-list

409# scopes = ["repo"] # optional OAuth scopes

356 410 

357################################################################################411################################################################################

358# Model Providers412# Model Providers

359################################################################################413################################################################################

360 414 

361# Built-ins include:415# Built-ins include:

362# - openai (Responses API; requires login or OPENAI_API_KEY via auth flow)416# - openai

363# - oss (Chat Completions API; defaults to http://localhost:11434/v1)417# - ollama

418# - lmstudio

364 419 

365[model_providers]420[model_providers]

366 421 


368# [model_providers.openaidr]423# [model_providers.openaidr]

369# name = "OpenAI Data Residency"424# name = "OpenAI Data Residency"

370# base_url = "https://us.api.openai.com/v1" # example with 'us' domain prefix425# base_url = "https://us.api.openai.com/v1" # example with 'us' domain prefix

371# wire_api = "responses" # "responses" | "chat" (default varies)426# wire_api = "responses" # only supported value

372# # requires_openai_auth = true # built-in OpenAI defaults to true427# # requires_openai_auth = true # built-in OpenAI defaults to true

373# # request_max_retries = 4 # default 4; max 100428# # request_max_retries = 4 # default 4; max 100

374# # stream_max_retries = 5 # default 5; max 100429# # stream_max_retries = 5 # default 5; max 100

375# # stream_idle_timeout_ms = 300000 # default 300_000 (5m)430# # stream_idle_timeout_ms = 300000 # default 300_000 (5m)

431# # supports_websockets = true # optional

376# # experimental_bearer_token = "sk-example" # optional dev-only direct bearer token432# # experimental_bearer_token = "sk-example" # optional dev-only direct bearer token

377# # http_headers = { "X-Example" = "value" }433# # http_headers = { "X-Example" = "value" }

378# # env_http_headers = { "OpenAI-Organization" = "OPENAI_ORGANIZATION", "OpenAI-Project" = "OPENAI_PROJECT" }434# # env_http_headers = { "OpenAI-Organization" = "OPENAI_ORGANIZATION", "OpenAI-Project" = "OPENAI_PROJECT" }

379 435 

380# --- Example: Azure (Chat/Responses depending on endpoint) ---436# --- Example: Azure/OpenAI-compatible provider ---

381# [model_providers.azure]437# [model_providers.azure]

382# name = "Azure"438# name = "Azure"

383# base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"439# base_url = "https://YOUR_PROJECT_NAME.openai.azure.com/openai"

384# wire_api = "responses" # or "chat" per endpoint440# wire_api = "responses"

385# query_params = { api-version = "2025-04-01-preview" }441# query_params = { api-version = "2025-04-01-preview" }

386# env_key = "AZURE_OPENAI_API_KEY"442# env_key = "AZURE_OPENAI_API_KEY"

387# # env_key_instructions = "Set AZURE_OPENAI_API_KEY in your environment"443# env_key_instructions = "Set AZURE_OPENAI_API_KEY in your environment"

444# # supports_websockets = false

388 445 

389# --- Example: Local OSS (e.g., Ollama-compatible) ---446# --- Example: Local OSS (e.g., Ollama-compatible) ---

390# [model_providers.ollama]447# [model_providers.ollama]

391# name = "Ollama"448# name = "Ollama"

392# base_url = "http://localhost:11434/v1"449# base_url = "http://localhost:11434/v1"

393# wire_api = "chat"450# wire_api = "responses"

451 

452################################################################################

453# Apps / Connectors

454################################################################################

455 

456# Optional per-app controls.

457[apps]

458# [_default] applies to all apps unless overridden per app.

459# [apps._default]

460# enabled = true

461# destructive_enabled = true

462# open_world_enabled = true

463#

464# [apps.google_drive]

465# enabled = false

466# destructive_enabled = false # block destructive-hint tools for this app

467# default_tools_enabled = true

468# default_tools_approval_mode = "prompt" # auto | prompt | approve

469#

470# [apps.google_drive.tools."files/delete"]

471# enabled = false

472# approval_mode = "approve"

394 473 

395################################################################################474################################################################################

396# Profiles (named presets)475# Profiles (named presets)


399[profiles]478[profiles]

400 479 

401# [profiles.default]480# [profiles.default]

402# model = "gpt-5.2-codex"481# model = "gpt-5.4"

403# model_provider = "openai"482# model_provider = "openai"

404# approval_policy = "on-request"483# approval_policy = "on-request"

405# sandbox_mode = "read-only"484# sandbox_mode = "read-only"

485# service_tier = "flex"

406# oss_provider = "ollama"486# oss_provider = "ollama"

407# model_reasoning_effort = "medium"487# model_reasoning_effort = "medium"

488# plan_mode_reasoning_effort = "high"

408# model_reasoning_summary = "auto"489# model_reasoning_summary = "auto"

409# model_verbosity = "medium"490# model_verbosity = "medium"

410# personality = "friendly" # or "pragmatic" or "none"491# personality = "pragmatic" # or "friendly" or "none"

411# chatgpt_base_url = "https://chatgpt.com/backend-api/"492# chatgpt_base_url = "https://chatgpt.com/backend-api/"

493# model_catalog_json = "./models.json"

494# model_instructions_file = "/absolute/or/relative/path/to/instructions.txt"

412# experimental_compact_prompt_file = "./compact_prompt.txt"495# experimental_compact_prompt_file = "./compact_prompt.txt"

413# include_apply_patch_tool = false496# tools_view_image = true

414# experimental_use_unified_exec_tool = false

415# experimental_use_freeform_apply_patch = false

416# tools.web_search = false # deprecated legacy alias; prefer top-level `web_search`

417# features = { unified_exec = false }497# features = { unified_exec = false }

418 498 

419################################################################################

420# Apps / Connectors

421################################################################################

422 

423# Optional per-app controls.

424[apps]

425# [apps.google_drive]

426# enabled = false

427# disabled_reason = "user" # or "unknown"

428 

429################################################################################499################################################################################

430# Projects (trust levels)500# Projects (trust levels)

431################################################################################501################################################################################

432 502 

433# Mark specific worktrees as trusted or untrusted.

434[projects]503[projects]

504# Mark specific worktrees as trusted or untrusted.

435# [projects."/absolute/path/to/project"]505# [projects."/absolute/path/to/project"]

436# trust_level = "trusted" # or "untrusted"506# trust_level = "trusted" # or "untrusted"

437 507 

508################################################################################

509# Tools

510################################################################################

511 

512[tools]

513# view_image = true

514 

438################################################################################515################################################################################

439# OpenTelemetry (OTEL) - disabled by default516# OpenTelemetry (OTEL) - disabled by default

440################################################################################517################################################################################


448exporter = "none"525exporter = "none"

449# Trace exporter: none (default) | otlp-http | otlp-grpc526# Trace exporter: none (default) | otlp-http | otlp-grpc

450trace_exporter = "none"527trace_exporter = "none"

528# Metrics exporter: none | statsig | otlp-http | otlp-grpc

529metrics_exporter = "statsig"

451 530 

452# Example OTLP/HTTP exporter configuration531# Example OTLP/HTTP exporter configuration

453# [otel.exporter."otlp-http"]532# [otel.exporter."otlp-http"]


457# [otel.exporter."otlp-http".headers]536# [otel.exporter."otlp-http".headers]

458# "x-otlp-api-key" = "${OTLP_TOKEN}"537# "x-otlp-api-key" = "${OTLP_TOKEN}"

459 538 

460# Example OTLP/gRPC exporter configuration

461# [otel.exporter."otlp-grpc"]

462# endpoint = "https://otel.example.com:4317",

463# headers = { "x-otlp-meta" = "abc123" }

464 

465# Example OTLP exporter with mutual TLS

466# [otel.exporter."otlp-http"]

467# endpoint = "https://otel.example.com/v1/logs"

468# protocol = "binary"

469 

470# [otel.exporter."otlp-http".headers]

471# "x-otlp-api-key" = "${OTLP_TOKEN}"

472 

473# [otel.exporter."otlp-http".tls]539# [otel.exporter."otlp-http".tls]

474# ca-certificate = "certs/otel-ca.pem"540# ca-certificate = "certs/otel-ca.pem"

475# client-certificate = "/etc/codex/certs/client.pem"541# client-certificate = "/etc/codex/certs/client.pem"

476# client-private-key = "/etc/codex/certs/client-key.pem"542# client-private-key = "/etc/codex/certs/client-key.pem"

543 

544# Example OTLP/gRPC trace exporter configuration

545# [otel.trace_exporter."otlp-grpc"]

546# endpoint = "https://otel.example.com:4317"

547# headers = { "x-otlp-meta" = "abc123" }

548 

549################################################################################

550# Windows

551################################################################################

552 

553[windows]

554# Native Windows sandbox mode (Windows only): unelevated | elevated

555sandbox = "unelevated"

477```556```

Details

1# Admin Setup1# Admin Setup

2 2 

3![Codex enterprise admin toggle](/images/codex/codex_enterprise_admin.png)

4 

3This guide is for ChatGPT Enterprise admins who want to set up Codex for their workspace.5This guide is for ChatGPT Enterprise admins who want to set up Codex for their workspace.

4 6 

7Use this page as the step-by-step rollout guide. For detailed policy, configuration, and monitoring details, use the linked pages: [Authentication](https://developers.openai.com/codex/auth), [Agent approvals & security](https://developers.openai.com/codex/agent-approvals-security), [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration), and [Governance](https://developers.openai.com/codex/enterprise/governance).

8 

5## Enterprise-grade security and privacy9## Enterprise-grade security and privacy

6 10 

7Codex supports ChatGPT Enterprise security features, including:11Codex supports ChatGPT Enterprise security features, including:

8 12 

9- No training on enterprise data13- No training on enterprise data

10- Zero data retention for the CLI and IDE14- Zero data retention for the App, CLI, and IDE (code stays in the developer environment)

11- Residency and retention follow ChatGPT Enterprise policies15- Residency and retention that follow ChatGPT Enterprise policies

12- Granular user access controls16- Granular user access controls

13- Data encryption at rest (AES 256) and in transit (TLS 1.2+)17- Data encryption at rest (AES-256) and in transit (TLS 1.2+)

18- Audit logging via the ChatGPT Compliance API

14 19 

15For more, see [Security](https://developers.openai.com/codex/security).20For security controls and runtime protections, see [Agent approvals & security](https://developers.openai.com/codex/agent-approvals-security). Refer to [Zero Data Retention (ZDR)](https://platform.openai.com/docs/guides/your-data#zero-data-retention) for more details.

21For a broader enterprise security overview, see the [Codex security white paper](https://trust.openai.com/?itemUid=382f924d-54f3-43a8-a9df-c39e6c959958&source=click).

16 22 

17## Local vs. cloud setup23## Pre-requisites: Determine owners and rollout strategy

18 24 

19Codex operates in two environments: local and cloud.25During your rollout, team members may support different aspects of integrating Codex into your organization. Ensure you have the following owners:

20 26 

211. Local use includes the Codex app, CLI, and IDE extension. The agent runs on the developer’s computer in a sandbox.27- **ChatGPT Enterprise workspace owner:** required to configure Codex settings in your workspace.

222. Use in the cloud includes Codex cloud, iOS, Code Review, and tasks created by the [Slack integration](https://developers.openai.com/codex/integrations/slack). The agent runs remotely in a hosted container with your codebase.28- **Security owner:** determines agent permissions settings for Codex.

29- **Analytics owner:** integrates analytics and compliance APIs into your data pipelines.

23 30 

24Use separate permissions and role-based access control (RBAC) to control access to local and cloud features. You can enable local, cloud, or both for all users or for specific groups.31Decide which Codex surfaces you will use:

25 32 

26## Codex local setup33- **Codex local:** includes the Codex app, CLI, and IDE extension. The agent runs on the developer's computer in a sandbox.

34- **Codex cloud:** includes hosted Codex features (including Codex cloud, iOS, Code Review, and tasks created by the [Slack integration](https://developers.openai.com/codex/integrations/slack) or [Linear integration](https://developers.openai.com/codex/integrations/linear)). The agent runs remotely in a hosted container with your codebase.

35- **Both:** use local + cloud together.

27 36 

28### Enable Codex app, CLI, and IDE extension in workspace settings37You can enable local, cloud, or both, and control access with workspace settings and role-based access control (RBAC).

29 38 

30To enable Codex locally for workspace members, go to [Workspace Settings > Settings and Permissions](https://chatgpt.com/admin/settings). Turn on **Allow members to use Codex Local**. This setting doesn’t require the GitHub connector.39## Step 1: Enable Codex in your workspace

31 40 

32After you turn this on, users can sign in to use the Codex app, CLI, and IDE extension with their ChatGPT account. If you turn off this setting, users who attempt to use the Codex app, CLI, or IDE will see the following error: “403 - Unauthorized. Contact your ChatGPT administrator for access.41You configure access to Codex in ChatGPT Enterprise workspace settings.

33 42 

34## Team Config43Go to [Workspace Settings > Settings and Permissions](https://chatgpt.com/admin/settings).

35 44 

36Teams who want to standardize Codex across an organization can use Team Config to share defaults, rules, and skills without duplicating setup on every local configuration.45### Codex local

37 46 

38| Type | Path | Use it to |47Codex local is enabled by default for new ChatGPT Enterprise workspaces. If

39| ------------------------------------ | ------------- | ---------------------------------------------------------------------------- |48 you are not a ChatGPT workspace owner, you can test whether you have access by

40| [Config basics](https://developers.openai.com/codex/config-basic) | `config.toml` | Set defaults for sandbox mode, approvals, model, reasoning effort, and more. |49 [installing Codex](https://developers.openai.com/codex/quickstart) and logging in with your work email.

41| [Rules](https://developers.openai.com/codex/rules) | `rules/` | Control which commands Codex can run outside the sandbox. |

42| [Skills](https://developers.openai.com/codex/skills) | `skills/` | Make shared skills available to your team. |

43 50 

44For locations and precedence, see [Config basics](https://developers.openai.com/codex/config-basic#configuration-precedence).51Turn on **Allow members to use Codex Local**.

52 

53This enables use of the Codex app, CLI, and IDE extension for allowed users.

54 

55If this toggle is off, users who attempt to use the Codex app, CLI, or IDE will see the following error: “403 - Unauthorized. Contact your ChatGPT administrator for access.”

56 

57#### Enable device code authentication for Codex CLI

45 58 

46## Codex cloud setup59Allow developers to sign in with a device code when using Codex CLI in a non-interactive environment (for example, a remote development box). More details are in [authentication](https://developers.openai.com/codex/auth/).

60 

61![Codex local toggle](/images/codex/enterprise/local-toggle-config.png)

62 

63### Codex cloud

47 64 

48### Prerequisites65### Prerequisites

49 66 


57 74 

58Start by turning on the ChatGPT GitHub Connector in the Codex section of [Workspace Settings > Settings and Permissions](https://chatgpt.com/admin/settings).75Start by turning on the ChatGPT GitHub Connector in the Codex section of [Workspace Settings > Settings and Permissions](https://chatgpt.com/admin/settings).

59 76 

60To enable Codex cloud for your workspace, turn on **Allow members to use Codex cloud**.77To enable Codex cloud for your workspace, turn on **Allow members to use Codex cloud**. Once enabled, users can access Codex directly from the left-hand navigation panel in ChatGPT.

78 

79Note that it may take up to 10 minutes for Codex to appear in ChatGPT.

80 

81#### Enable Codex Slack app to post answers on task completion

82 

83Codex posts its full answer back to Slack when the task completes. Otherwise, Codex posts only a link to the task.

84 

85To learn more, see [Codex in Slack](https://developers.openai.com/codex/integrations/slack).

86 

87#### Enable Codex agent to access the internet

88 

89By default, Codex cloud agents have no internet access during runtime to help protect against security and safety risks like prompt injection.

90 

91This setting lets users use an allowlist for common software dependency domains, add domains and trusted sites, and specify allowed HTTP methods.

61 92 

62Once enabled, users can access Codex directly from the left-hand navigation panel in ChatGPT.93For security implications of internet access and runtime controls, see [Agent approvals & security](https://developers.openai.com/codex/agent-approvals-security).

63 94 

64![Codex cloud toggle](/images/codex/enterprise/cloud-toggle-config.png)95![Codex cloud toggle](/images/codex/enterprise/cloud-toggle-config.png)

65 96 

66After you turn on Codex in your Enterprise workspace settings, it may take up97## Step 2: Set up custom roles (RBAC)

67to 10 minutes for Codex to appear in ChatGPT.

68 98 

69### Configure the GitHub Connector IP allow list99Use RBAC to control granular permissions for access Codex local and Codex cloud.

70 100 

71To control which IP addresses can connect to your ChatGPT GitHub connector, configure these IP ranges:101![Codex cloud toggle](/images/codex/enterprise/rbac_custom_roles.png)

72 102 

73- [ChatGPT egress IP ranges](https://openai.com/chatgpt-actions.json)103### What RBAC lets you do

74- [Codex container egress IP ranges](https://openai.com/chatgpt-agents.json)

75 104 

76These IP ranges can change. Consider checking them automatically and updating your allow list based on the latest values.105Workspace Owners can use RBAC in ChatGPT admin settings to:

77 106 

78### Allow members to administer Codex107- Set a default role for users who aren't assigned any custom role

108- Create custom roles with granular permissions

109- Assign one or more custom roles to Groups

110- Automatically sync users into Groups via SCIM

111- Manage roles centrally from the Custom Roles tab

79 112 

80This toggle allows users to view Codex workspace analytics and manage environments (edit and delete).113Users can inherit more than one role, and permissions resolve to the most permissive (least restrictive) access across those roles.

81 114 

82Codex supports role-based access (see [Role-based access (RBAC)](#role-based-access-rbac)), so you can turn on this toggle for a specific subset of users.115### Create a Codex Admin group

83 116 

84### Enable Codex Slack app to post answers on task completion117Set up a dedicated "Codex Admin" group rather than granting Codex administration to a broad audience.

85 118 

86Codex integrates with Slack. When a user mentions `@Codex` in Slack, Codex starts a cloud task, gets context from the Slack thread, and responds with a link to a PR to review in the thread.119The **Allow members to administer Codex** toggle grants the Codex Admin role. Codex Admins can:

87 120 

88To allow the Slack app to post answers on task completion, turn on **Allow Codex Slack app to post answers on task completion**. When enabled, Codex posts its full answer back to Slack when the task completes. Otherwise, Codex posts only a link to the task.121- View Codex [workspace analytics](https://chatgpt.com/codex/settings/analytics)

122- Open the Codex [Policies page](https://chatgpt.com/codex/settings/policies) to manage cloud-managed `requirements.toml` policies

123- Assign those managed policies to user groups or configure a default fallback policy

124- Manage Codex cloud environments, including editing and deleting environments

89 125 

90To learn more, see [Codex in Slack](https://developers.openai.com/codex/integrations/slack).126Use this role for the small set of admins who own Codex rollout, policy management, and governance. It's not required for general Codex users. You don't need Codex cloud to enable this toggle.

91 127 

92### Enable Codex agent to access the internet128Recommended rollout pattern:

93 129 

94By default, Codex cloud agents have no internet access during runtime to help protect against security and safety risks like prompt injection.130- Create a "Codex Users" group for people who should use Codex

131- Create a separate "Codex Admin" group for the smaller set of people who should manage Codex settings and policies

132- Assign the custom role with **Allow members to administer Codex** enabled only to the "Codex Admin" group

133- Keep membership in the "Codex Admin" group limited to workspace owners or designated platform, IT, and governance operators

134- If you use SCIM, back the "Codex Admin" group with your identity provider so membership changes are auditable and centrally managed

135 

136This separation makes it easier to roll out Codex while keeping analytics, environment management, and policy deployment limited to trusted admins. For RBAC setup details and the full permission model, see the [OpenAI RBAC Help Center article](https://help.openai.com/en/articles/11750701-rbac).

137 

138## Step 3: Configure Codex local requirements

139 

140Codex Admins can deploy admin-enforced `requirements.toml` policies from the Codex [Policies page](https://chatgpt.com/codex/settings/policies).

141 

142Use this page when you want to apply different local Codex constraints to different groups without distributing device-level files first. The managed policy uses the same `requirements.toml` format described in [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration), so you can define allowed approval policies, sandbox modes, web search behavior, MCP server allowlists, feature pins, and restrictive command rules.

143 

144![Codex policies and configurations page](/images/codex/enterprise/policies_and_configurations_page.png)

145 

146Recommended setup:

147 

1481. Create a baseline policy for most users, then create stricter or more permissive variants only where needed.

1492. Assign each managed policy to a specific user group, and configure a default fallback policy for everyone else.

1503. Order group rules with care. If a user matches more than one group-specific rule, the first matching rule applies.

1514. Treat each policy as a complete profile for that group. Codex doesn't fill missing fields from later matching group rules.

152 

153These cloud-managed policies apply across Codex local surfaces when users sign in with ChatGPT, including the Codex app, CLI, and IDE extension.

154 

155### Example requirements.toml policies

156 

157Use cloud-managed `requirements.toml` policies to enforce the guardrails you want for each group. The snippets below are examples you can adapt, not required settings.

95 158 

96As an admin, you can allow users to enable agent internet access in their environments. To enable it, turn on **Allow Codex agent to access the internet**.159![Example managed requirements policy](/images/codex/enterprise/example_policy.png)

160 

161Example: limit web search, sandbox mode, and approvals for a standard local rollout:

162 

163```toml

164allowed_web_search_modes = ["disabled", "cached"]

165allowed_sandbox_modes = ["workspace-write"]

166allowed_approval_policies = ["on-request"]

167```

168 

169Example: add a restrictive command rule when you want admins to block or gate specific commands:

170 

171```toml

172[rules]

173prefix_rules = [

174 { pattern = [{ token = "git" }, { any_of = ["push", "commit"] }], decision = "prompt", justification = "Require review before mutating remote history." },

175]

176```

177 

178You can use either example on its own or combine them in a single managed policy for a group. For exact keys, precedence, and more examples, see [Managed configuration](https://developers.openai.com/codex/enterprise/managed-configuration) and [Agent approvals & security](https://developers.openai.com/codex/agent-approvals-security).

179 

180### Checking user policies

181 

182Use the policy lookup tools at the end of the workflow to confirm which managed policy applies to a user. You can check policy assignment by group or by entering a user email.

183 

184![Policy lookup by group or user email](/images/codex/enterprise/policy_lookup.png)

185 

186If you plan to restrict login method or workspace for local clients, see the admin-managed authentication restrictions in [Authentication](https://developers.openai.com/codex/auth).

187 

188## Step 4: Standardize local configuration with Team Config

189 

190Teams who want to standardize Codex across an organization can use Team Config to share defaults, rules, and skills without duplicating setup on every local configuration.

97 191 

98When this setting is on, users can use an allow list for common software dependency domains, add more domains and trusted sites, and specify allowed HTTP methods.192You can check Team Config settings into the repository under the `.codex` directory. Codex automatically picks up Team Config settings when a user opens that repository.

193 

194Start with Team Config for your highest-traffic repositories so teams get consistent behavior in the places they use Codex most.

195 

196| Type | Path | Use it to |

197| ------------------------------------ | ------------- | ---------------------------------------------------------------------------- |

198| [Config basics](https://developers.openai.com/codex/config-basic) | `config.toml` | Set defaults for sandbox mode, approvals, model, reasoning effort, and more. |

199| [Rules](https://developers.openai.com/codex/rules) | `rules/` | Control which commands Codex can run outside the sandbox. |

200| [Skills](https://developers.openai.com/codex/skills) | `skills/` | Make shared skills available to your team. |

201 

202For locations and precedence, see [Config basics](https://developers.openai.com/codex/config-basic#configuration-precedence).

203 

204## Step 5: Configure Codex cloud usage (if enabled)

205 

206This step covers repository and environment setup after you enable the Codex cloud workspace toggle.

207 

208### Connect Codex cloud to repositories

209 

2101. Navigate to [Codex](https://chatgpt.com/codex) and select **Get started**

2112. Select **Connect to GitHub** to install the ChatGPT GitHub Connector if you haven't already connected GitHub to ChatGPT

2123. Install or connect the ChatGPT GitHub Connector

2134. Choose an installation target for the ChatGPT Connector (typically your main organization)

2145. Allow the repositories you want to connect to Codex

215 

216For GitHub Enterprise Managed Users (EMU), an organization owner must install

217 the Codex GitHub App for the organization before users can connect

218 repositories in Codex cloud.

219 

220For more, see [Cloud environments](https://developers.openai.com/codex/cloud/environments).

221 

222Codex uses short-lived, least-privilege GitHub App installation tokens for each operation and respects the user's existing GitHub repository permissions and branch protection rules.

223 

224### Configure IP addresses

225 

226If your GitHub organization controls the IP addresses that apps use to connect, make sure to include these [egress IP ranges](https://openai.com/chatgpt-agents.json).

227 

228These IP ranges can change. Consider checking them automatically and updating your allow list based on the latest values.

99 229 

100### Enable code review with Codex cloud230### Enable code review with Codex cloud

101 231 

102To allow Codex to do code reviews, go to [Settings → Code review](https://chatgpt.com/codex/settings/code-review).232To allow Codex to perform code reviews on GitHub, go to [Settings → Code review](https://chatgpt.com/codex/settings/code-review).

233 

234You can configure code review at the repository level. Users can also enable auto review for their PRs and choose when Codex automatically triggers a review. More details are on the [GitHub integration page](https://developers.openai.com/codex/integrations/github).

235 

236Use the overview page to confirm your workspace has code review turned on and to see the available review controls.

237 

238![Code review settings overview](/images/codex/enterprise/code_review_settings_overview.png)

239 

240 Use the auto review settings to decide whether Codex should review pull

241 requests automatically for connected repositories.

242 

243![Automatic code review settings](/images/codex/enterprise/auto_code_review_settings.png)

244 

245 Use review triggers to control which pull request events should start a

246 Codex review.

247 

248![Code review trigger settings](/images/codex/enterprise/review_triggers.png)

249 

250### Configure Codex security

251 

252Codex Security helps engineering and security teams find, confirm, and remediate likely vulnerabilities in connected GitHub repositories.

253 

254At a high level, Codex Security:

255 

256- scans connected repositories commit by commit

257- ranks likely findings and confirms them when possible

258- shows structured findings with evidence, criticality, and suggested remediation

259- lets teams refine a repository threat model to improve prioritization and review quality

260 

261For setup, scan creation, findings review, and threat model guidance, see [Codex Security setup](https://developers.openai.com/codex/security/setup). For a product overview, see [Codex Security](https://developers.openai.com/codex/security).

262 

263Integration docs are also available for [Slack](https://developers.openai.com/codex/integrations/slack), [GitHub](https://developers.openai.com/codex/integrations/github), and [Linear](https://developers.openai.com/codex/integrations/linear).

264 

265## Step 6: Set up governance and observability

266 

267Codex gives enterprise teams options for visibility into adoption and impact. Set up governance early so your team can track adoption, investigate issues, and support compliance workflows.

268 

269### Codex governance typically uses

270 

271- Analytics Dashboard for quick, self-serve visibility

272- Analytics API for programmatic reporting and business intelligence integration

273- Compliance API for audit and investigation workflows

274 

275### Recommended baseline setup

276 

277- Assign an owner for adoption reporting

278- Assign an owner for audit and compliance review

279- Define a review cadence

280- Decide what success looks like

281 

282### Analytics API setup steps

283 

284To set up the Analytics API key:

285 

2861. Sign in to the [OpenAI API Platform Portal](https://platform.openai.com) as an owner or admin, and select the correct organization.

2872. Go to the [API keys page](https://platform.openai.com/settings/organization/api-keys).

2883. Create a new secret key dedicated to Codex Analytics, and give it a descriptive name such as Codex Analytics API.

2894. Select the appropriate project for your organization. If you only have one project, the default project is fine.

2905. Set the key permissions to Read only, since this API only retrieves analytics data.

2916. Copy the key value and store it securely, because you can only view it once.

2927. Email [support@openai.com](mailto:support@openai.com) to have that key scoped to `codex.enterprise.analytics.read` only. Wait for OpenAI to confirm your API key has Codex Analytics API access.

293 

294![Codex analytics key creation](/images/codex/codex_analytics_key.png)

295 

296To use the Analytics API key:

297 

2981. Find your `workspace_id` in the [ChatGPT Admin console](https://chatgpt.com/admin) under Workspace details.

2992. Call the Analytics API at `https://api.chatgpt.com/v1/analytics/codex` using your Platform API key, and include your `workspace_id` in the path.

3003. Choose the endpoint you want to query:

301 

302- /workspaces/`{workspace_id}`/usage

303- /workspaces/`{workspace_id}`/code_reviews

304- /workspaces/`{workspace_id}`/code_review_responses

305 

3064. Set a reporting date range with `start_time` and `end_time` if needed.

3075. Retrieve the next page of results with `next_page` if the response spans more than one page.

103 308 

104Users can specify whether they want Codex to review their pull requests. Users can also configure whether code review runs for all contributors to a repository.309Example curl command to retrieve workspace usage:

105 310 

106Codex supports two types of code reviews:311```bash

312curl -H "Authorization: Bearer YOUR_PLATFORM_API_KEY" \

313 "https://api.chatgpt.com/v1/analytics/codex/workspaces/WORKSPACE_ID/usage"

314```

107 315 

1081. Automatically triggered code reviews when a user opens a PR for review.316For more details on the Analytics API, see [Analytics API](https://developers.openai.com/codex/enterprise/governance#analytics-api).

1092. Reactive code reviews when a user mentions @Codex to look at issues. For example, “@Codex fix this CI error” or “@Codex address that feedback.”

110 317 

111## Role-based access (RBAC)318### Compliance API setup steps

112 319 

113Codex supports role-based access. RBAC is a security and permissions model used to control access to systems or resources based on a user’s role assignments.320To set up the Compliance API key:

114 321 

115To enable RBAC for Codex, navigate to Settings & Permissions → Custom Roles in [ChatGPT’s admin page](https://chatgpt.com/admin/settings) and assign roles to groups created in the Groups tab.3221. Sign in to the [OpenAI API Platform Portal](https://platform.openai.com) as an owner or admin, and select the correct organization.

3232. Go to the [API keys page](https://platform.openai.com/settings/organization/api-keys).

3243. Create a new secret key dedicated to Compliance API and select the appropriate project for your organization. If you only have one project, the default project is fine.

3254. Choose All permissions.

3265. Copy the key value and store it securely, because you can only view it once.

3276. Send an email to [support@openai.com](mailto:support@openai.com) with:

116 328 

117This simplifies permission management for Codex and improves security in your ChatGPT workspace. To learn more, see the [Help Center article](https://help.openai.com/en/articles/11750701-rbac).329- the last 4 digits of the API key

330- the key name

331- the created-by name

332- the scope needed: `read`, `delete`, or both

118 333 

119## Set up your first Codex cloud environment3347. Wait for OpenAI to confirm your API key has Compliance API access.

120 335 

1211. Go to Codex cloud and select **Get started**.336To use the Compliance API key:

1222. Select **Connect to GitHub** to install the ChatGPT GitHub Connector if you haven’t already connected GitHub to ChatGPT.

123 - Allow the ChatGPT Connector for your account.

124 - Choose an installation target for the ChatGPT Connector (typically your main organization).

125 - Allow the repositories you want to connect to Codex (a GitHub admin may need to approve this).

1263. Create your first environment by selecting the repository most relevant to your developers, then select **Create environment**.

127 - Add the email addresses of any environment collaborators to give them edit access.

1284. Start a few starter tasks (for example, writing tests, fixing bugs, or exploring code).

129 337 

130You have now created your first environment. Users who connect to GitHub can create tasks using this environment. Users who have access to the repository can also push pull requests generated from their tasks.3381. Find your `workspace_id` in the [ChatGPT Admin console](https://chatgpt.com/admin) under Workspace details.

3392. Use the Compliance API at `https://api.chatgpt.com/v1/`

3403. Pass your Compliance API key in the Authorization header as a Bearer token.

3414. For Codex-related compliance data, use these endpoints:

131 342 

132### Environment management343- /compliance/workspaces/`{workspace_id}`/logs

344- /compliance/workspaces/`{workspace_id}`/logs/`{log_file_id}`

345- /compliance/workspaces/`{workspace_id}`/codex_tasks

346- /compliance/workspaces/`{workspace_id}`/codex_environments

133 347 

134As a ChatGPT workspace administrator, you can edit and delete Codex environments in your workspace.3485. For most Codex compliance integrations, start with the logs endpoint and request Codex event types such as CODEX_LOG or CODEX_SECURITY_LOG.

3496. Use /logs to list available Codex compliance log files, then /logs/`{log_file_id}` to download a specific file.

135 350 

136### Connect more GitHub repositories with Codex cloud351Example curl command to list compliance log files:

137 352 

1381. Select **Environments**, or open the environment selector and select **Manage Environments**.353```bash

1392. Select **Create Environment**.354curl -L -H "Authorization: Bearer YOUR_COMPLIANCE_API_KEY" \

1403. Select the repository you want to connect.355 "https://api.chatgpt.com/v1/compliance/workspaces/WORKSPACE_ID/logs?event_type=CODEX_LOG&after=2026-03-01T00:00:00Z"

1414. Enter a name and description.356```

1425. Select the environment visibility.

1436. Select **Create Environment**.

144 357 

145Codex automatically optimizes your environment setup by reviewing your codebase. Avoid advanced environment configuration until you observe specific performance issues. For more, see [Codex cloud](https://developers.openai.com/codex/cloud).358Example curl command to list Codex tasks:

146 359 

147### Share setup instructions with users360```bash

361curl -H "Authorization: Bearer YOUR_COMPLIANCE_API_KEY" \

362 "https://api.chatgpt.com/v1/compliance/workspaces/WORKSPACE_ID/codex_tasks"

363```

148 364 

149You can share these steps with end users:365For more details on the Compliance API, see [Compliance API](https://developers.openai.com/codex/enterprise/governance#compliance-api).

150 366 

1511. Go to [Codex](https://chatgpt.com/codex) in the left-hand panel of ChatGPT.367## Step 7: Confirm and verify setup

1522. Select **Connect to GitHub** in the prompt composer if you’re not already connected.

153 - Sign in to GitHub.

1543. You can now use shared environments with your workspace or create your own environment.

1554. Try a task in both Ask and Code mode. For example:

156 - Ask: Find bugs in this codebase.

157 - Write code: Improve test coverage following the existing test patterns.

158 368 

159## Track Codex usage369### What to verify

160 370 

161- For workspaces with rate limits, use [Settings Usage](https://chatgpt.com/codex/settings/usage) to view workspace metrics for Codex.371- Users can sign in to Codex local (ChatGPT or API key)

162- For more detail on enterprise governance, refer to the [Governance](https://developers.openai.com/codex/enterprise/governance) page.372- (If enabled) Users can sign in to Codex cloud (ChatGPT sign-in required)

163- For enterprise workspaces with flexible pricing, you can see credit usage in the ChatGPT workspace billing console.373- MFA and SSO requirements match your enterprise security policy

374- RBAC and workspace toggles produce the expected access behavior

375- Managed configuration applies for users

376- Governance data is visible for admins

164 377 

165## Zero data retention (ZDR)378For authentication options and enterprise login restrictions, see [Authentication](https://developers.openai.com/codex/auth).

166 379 

167Codex supports OpenAI organizations with [Zero Data Retention (ZDR)](https://platform.openai.com/docs/guides/your-data#zero-data-retention) enabled.380Once your team is confident with setup, you can roll Codex out to more teams and organizations.

Details

88 88 

89The Compliance API gives enterprises a way to export logs and metadata for Codex activity so you can connect that data to your existing audit, monitoring, and security workflows. It is designed for use with tools like eDiscovery, DLP, SIEM, or other compliance systems.89The Compliance API gives enterprises a way to export logs and metadata for Codex activity so you can connect that data to your existing audit, monitoring, and security workflows. It is designed for use with tools like eDiscovery, DLP, SIEM, or other compliance systems.

90 90 

91For Codex usage authenticated through ChatGPT, Compliance API exports provide audit records for Codex activity and can be used in investigations and compliance workflows. These audit logs are retained for up to 30 days. API-key-authenticated Codex usage follows your API organization settings and is not included in Compliance API exports.

92 

91### What you can export93### What you can export

92 94 

93#### Activity logs95#### Activity logs

Details

1# Managed configuration

2 

3Enterprise admins can control local Codex behavior in two ways:

4 

5- **Requirements**: admin-enforced constraints that users can't override.

6- **Managed defaults**: starting values applied when Codex launches. Users can still change settings during a session; Codex reapplies managed defaults the next time it starts.

7 

8## Admin-enforced requirements (requirements.toml)

9 

10Requirements constrain security-sensitive settings (approval policy, sandbox mode, web search mode, and optionally which MCP servers users can enable). When resolving configuration (for example from `config.toml`, profiles, or CLI config overrides), if a value conflicts with an enforced rule, Codex falls back to a compatible value and notifies the user. If you configure an `mcp_servers` allowlist, Codex enables an MCP server only when both its name and identity match an approved entry; otherwise, Codex disables it.

11 

12Requirements can also constrain [feature flags](https://developers.openai.com/codex/config-basic/#feature-flags) via the `[features]` table in `requirements.toml`. Note that features aren't always security-sensitive, but enterprises can pin values if desired. Omitted keys remain unconstrained.

13 

14For the exact key list, see the [`requirements.toml` section in Configuration Reference](https://developers.openai.com/codex/config-reference#requirementstoml).

15 

16### Locations and precedence

17 

18Codex applies requirements layers in this order (earlier wins per field):

19 

201. Cloud-managed requirements (ChatGPT Business or Enterprise)

212. macOS managed preferences (MDM) via `com.openai.codex:requirements_toml_base64`

223. System `requirements.toml` (`/etc/codex/requirements.toml` on Unix systems, including Linux/macOS)

23 

24Across layers, Codex merges requirements per field: if an earlier layer sets a field (including an empty list), later layers don't override that field, but lower layers can still fill fields that remain unset.

25 

26For backwards compatibility, Codex also interprets legacy `managed_config.toml` fields `approval_policy` and `sandbox_mode` as requirements (allowing only that single value).

27 

28### Cloud-managed requirements

29 

30When you sign in with ChatGPT on a Business or Enterprise plan, Codex can also fetch admin-enforced requirements from the Codex service. This is another source of `requirements.toml`-compatible requirements. This applies across Codex surfaces, including the CLI, App, and IDE Extension.

31 

32#### Configure cloud-managed requirements

33 

34Go to the [Codex managed-config page](https://chatgpt.com/codex/settings/managed-configs).

35 

36Create a new managed requirements file using the same format and keys as `requirements.toml`.

37 

38```toml

39enforce_residency = "us"

40allowed_approval_policies = ["on-request"]

41allowed_sandbox_modes = ["read-only", "workspace-write"]

42 

43[rules]

44prefix_rules = [

45 { pattern = [{ any_of = ["bash", "sh", "zsh"] }], decision = "prompt", justification = "Require explicit approval for shell entrypoints" },

46]

47```

48 

49Save the configuration. Once saved, the updated managed requirements apply immediately for matching users.

50For more examples, see [Example requirements.toml](#example-requirementstoml).

51 

52#### Assign requirements to groups

53 

54Admins can configure different managed requirements for different user groups, and also set a default fallback requirements policy.

55 

56If a user matches more than one group-specific rule, the first matching rule applies. Codex doesn't fill unset fields from later matching group rules.

57 

58For example, if the first matching group rule sets only `allowed_sandbox_modes = ["read-only"]` and a later matching group rule sets `allowed_approval_policies = ["on-request"]`, Codex applies only the first matching group rule and doesn't fill `allowed_approval_policies` from the later rule.

59 

60#### How Codex applies cloud-managed requirements locally

61 

62When a user starts Codex and signs in with ChatGPT on a Business or Enterprise plan, Codex applies managed requirements on a best-effort basis. Codex first checks for a valid, unexpired local managed requirements cache entry and uses it if available. If the cache is missing, expired, corrupted, or doesn't match the current auth identity, Codex attempts to fetch managed requirements from the service (with retries) and writes a new signed cache entry on success. If no valid cached entry is available and the fetch fails or times out, Codex continues without the managed requirements layer.

63 

64After cache resolution, Codex enforces managed requirements as part of the normal requirements layering described above.

65 

66### Example requirements.toml

67 

68This example blocks `--ask-for-approval never` and `--sandbox danger-full-access` (including `--yolo`):

69 

70```toml

71allowed_approval_policies = ["untrusted", "on-request"]

72allowed_sandbox_modes = ["read-only", "workspace-write"]

73```

74 

75You can also constrain web search mode:

76 

77```toml

78allowed_web_search_modes = ["cached"] # "disabled" remains implicitly allowed

79```

80 

81`allowed_web_search_modes = []` allows only `"disabled"`.

82For example, `allowed_web_search_modes = ["cached"]` prevents live web search even in `danger-full-access` sessions.

83 

84You can also pin [feature flags](https://developers.openai.com/codex/config-basic/#feature-flags):

85 

86```

87[features]

88personality = true

89unified_exec = false

90```

91 

92Use the canonical feature keys from `config.toml`'s `[features]` table. Codex normalizes the resulting feature set to meet these pins and rejects conflicting writes to `config.toml` or profile-scoped feature settings.

93 

94### Enforce command rules from requirements

95 

96Admins can also enforce restrictive command rules from `requirements.toml`

97using a `[rules]` table. These rules merge with regular `.rules` files, and the

98most restrictive decision still wins.

99 

100Unlike `.rules`, requirements rules must specify `decision`, and that decision

101must be `"prompt"` or `"forbidden"` (not `"allow"`).

102 

103```toml

104[rules]

105prefix_rules = [

106 { pattern = [{ token = "rm" }], decision = "forbidden", justification = "Use git clean -fd instead." },

107 { pattern = [{ token = "git" }, { any_of = ["push", "commit"] }], decision = "prompt", justification = "Require review before mutating history." },

108]

109```

110 

111To restrict which MCP servers Codex can enable, add an `mcp_servers` approved list. For stdio servers, match on `command`; for streamable HTTP servers, match on `url`:

112 

113```toml

114[mcp_servers.docs]

115identity = { command = "codex-mcp" }

116 

117[mcp_servers.remote]

118identity = { url = "https://example.com/mcp" }

119```

120 

121If `mcp_servers` is present but empty, Codex disables all MCP servers.

122 

123## Managed defaults (`managed_config.toml`)

124 

125Managed defaults merge on top of a user's local `config.toml` and take precedence over any CLI `--config` overrides, setting the starting values when Codex launches. Users can still change those settings during a session; Codex reapplies managed defaults the next time it starts.

126 

127Make sure your managed defaults meet your requirements; Codex rejects disallowed values.

128 

129### Precedence and layering

130 

131Codex assembles the effective configuration in this order (top overrides bottom):

132 

133- Managed preferences (macOS MDM; highest precedence)

134- `managed_config.toml` (system/managed file)

135- `config.toml` (user's base configuration)

136 

137CLI `--config key=value` overrides apply to the base, but managed layers override them. This means each run starts from the managed defaults even if you provide local flags.

138 

139Cloud-managed requirements affect the requirements layer (not managed defaults). See the Admin-enforced requirements section above for precedence.

140 

141### Locations

142 

143- Linux/macOS (Unix): `/etc/codex/managed_config.toml`

144- Windows/non-Unix: `~/.codex/managed_config.toml`

145 

146If the file is missing, Codex skips the managed layer.

147 

148### macOS managed preferences (MDM)

149 

150On macOS, admins can push a device profile that provides base64-encoded TOML payloads at:

151 

152- Preference domain: `com.openai.codex`

153- Keys:

154 - `config_toml_base64` (managed defaults)

155 - `requirements_toml_base64` (requirements)

156 

157Codex parses these "managed preferences" payloads as TOML. For managed defaults (`config_toml_base64`), managed preferences have the highest precedence. For requirements (`requirements_toml_base64`), precedence follows the cloud-managed requirements order described above. The same requirements-side `[features]` table works in `requirements_toml_base64`; use canonical feature keys there as well.

158 

159### MDM setup workflow

160 

161Codex honors standard macOS MDM payloads, so you can distribute settings with tooling like `Jamf Pro`, `Fleet`, or `Kandji`. A lightweight deployment looks like:

162 

1631. Build the managed payload TOML and encode it with `base64` (no wrapping).

1642. Drop the string into your MDM profile under the `com.openai.codex` domain at `config_toml_base64` (managed defaults) or `requirements_toml_base64` (requirements).

1653. Push the profile, then ask users to restart Codex and confirm the startup config summary reflects the managed values.

1664. When revoking or changing policy, update the managed payload; the CLI reads the refreshed preference the next time it launches.

167 

168Avoid embedding secrets or high-churn dynamic values in the payload. Treat the managed TOML like any other MDM setting under change control.

169 

170### Example managed_config.toml

171 

172```toml

173# Set conservative defaults

174approval_policy = "on-request"

175sandbox_mode = "workspace-write"

176 

177[sandbox_workspace_write]

178network_access = false # keep network disabled unless explicitly allowed

179 

180[otel]

181environment = "prod"

182exporter = "otlp-http" # point at your collector

183log_user_prompt = false # keep prompts redacted

184# exporter details live under exporter tables; see Monitoring and telemetry above

185```

186 

187### Recommended guardrails

188 

189- Prefer `workspace-write` with approvals for most users; reserve full access for controlled containers.

190- Keep `network_access = false` unless your security review allows a collector or domains required by your workflows.

191- Use managed configuration to pin OTel settings (exporter, environment), but keep `log_user_prompt = false` unless your policy explicitly allows storing prompt contents.

192- Periodically audit diffs between local `config.toml` and managed policy to catch drift; managed layers should win over local flags and files.

hooks.md +398 −0 added

Details

1# Hooks

2 

3Experimental. Hooks are under active development. Windows support temporarily

4disabled.

5 

6Hooks are an extensibility framework for Codex. They allow

7you to inject your own scripts into the agentic loop, enabling features such as:

8 

9- Send the conversation to a custom logging/analytics engine

10- Scan your team's prompts to block accidentally pasting API keys

11- Summarize conversations to create persistent memories automatically

12- Run a custom validator when a conversation turn stops, enforcing standards

13- Customize prompting when in a certain directory

14 

15Hooks are behind a feature flag in `config.toml`:

16 

17```toml

18[features]

19codex_hooks = true

20```

21 

22Runtime behavior to keep in mind:

23 

24- Matching hooks from multiple files all run.

25- Multiple matching command hooks for the same event are launched concurrently,

26 so one hook cannot prevent another matching hook from starting.

27- `PreToolUse`, `PostToolUse`, `UserPromptSubmit`, and `Stop` run at turn

28 scope.

29- Hooks are currently disabled on Windows.

30 

31## Where Codex looks for hooks

32 

33Codex discovers `hooks.json` next to active config layers.

34 

35In practice, the two most useful locations are:

36 

37- `~/.codex/hooks.json`

38- `<repo>/.codex/hooks.json`

39 

40If more than one `hooks.json` file exists, Codex loads all matching hooks.

41Higher-precedence config layers do not replace lower-precedence hooks.

42 

43## Config shape

44 

45Hooks are organized in three levels:

46 

47- A hook event such as `PreToolUse`, `PostToolUse`, or `Stop`

48- A matcher group that decides when that event matches

49- One or more hook handlers that run when the matcher group matches

50 

51```json

52{

53 "hooks": {

54 "SessionStart": [

55 {

56 "matcher": "startup|resume",

57 "hooks": [

58 {

59 "type": "command",

60 "command": "python3 ~/.codex/hooks/session_start.py",

61 "statusMessage": "Loading session notes"

62 }

63 ]

64 }

65 ],

66 "PreToolUse": [

67 {

68 "matcher": "Bash",

69 "hooks": [

70 {

71 "type": "command",

72 "command": "/usr/bin/python3 \"$(git rev-parse --show-toplevel)/.codex/hooks/pre_tool_use_policy.py\"",

73 "statusMessage": "Checking Bash command"

74 }

75 ]

76 }

77 ],

78 "PostToolUse": [

79 {

80 "matcher": "Bash",

81 "hooks": [

82 {

83 "type": "command",

84 "command": "/usr/bin/python3 \"$(git rev-parse --show-toplevel)/.codex/hooks/post_tool_use_review.py\"",

85 "statusMessage": "Reviewing Bash output"

86 }

87 ]

88 }

89 ],

90 "UserPromptSubmit": [

91 {

92 "hooks": [

93 {

94 "type": "command",

95 "command": "/usr/bin/python3 \"$(git rev-parse --show-toplevel)/.codex/hooks/user_prompt_submit_data_flywheel.py\""

96 }

97 ]

98 }

99 ],

100 "Stop": [

101 {

102 "hooks": [

103 {

104 "type": "command",

105 "command": "/usr/bin/python3 \"$(git rev-parse --show-toplevel)/.codex/hooks/stop_continue.py\"",

106 "timeout": 30

107 }

108 ]

109 }

110 ]

111 }

112}

113```

114 

115Notes:

116 

117- `timeout` is in seconds.

118- `timeoutSec` is also accepted as an alias.

119- If `timeout` is omitted, Codex uses `600` seconds.

120- `statusMessage` is optional.

121- Commands run with the session `cwd` as their working directory.

122- For repo-local hooks, prefer resolving from the git root instead of using a

123 relative path such as `.codex/hooks/...`. Codex may be started from a

124 subdirectory, and a git-root-based path keeps the hook location stable.

125 

126## Matcher patterns

127 

128The `matcher` field is a regex string that filters when hooks fire. Use `"*"`,

129`""`, or omit `matcher` entirely to match every occurrence of a supported

130event.

131 

132Only some current Codex events honor `matcher`:

133 

134| Event | What `matcher` filters | Notes |

135| --- | --- | --- |

136| `PostToolUse` | tool name | Current Codex runtime only emits `Bash`. |

137| `PreToolUse` | tool name | Current Codex runtime only emits `Bash`. |

138| `SessionStart` | start source | Current runtime values are `startup` and `resume`. |

139| `UserPromptSubmit` | not supported | Any configured `matcher` is ignored for this event. |

140| `Stop` | not supported | Any configured `matcher` is ignored for this event. |

141 

142Examples:

143 

144- `Bash`

145- `startup|resume`

146- `Edit|Write`

147 

148That last example is still a valid regex, but current Codex `PreToolUse` and

149`PostToolUse` events only emit `Bash`, so it will not match anything today.

150 

151## Common input fields

152 

153Every command hook receives one JSON object on `stdin`.

154 

155These are the shared fields you will usually use:

156 

157| Field | Type | Meaning |

158| --- | --- | --- |

159| `session_id` | `string` | Current session or thread id. |

160| `transcript_path` | `string | null` | Path to the session transcript file, if any |

161| `cwd` | `string` | Working directory for the session |

162| `hook_event_name` | `string` | Current hook event name |

163| `model` | `string` | Active model slug |

164 

165Turn-scoped hooks list `turn_id` in their event-specific tables.

166 

167If you need the full wire format, see [Schemas](#schemas).

168 

169## Common output fields

170 

171`SessionStart`, `UserPromptSubmit`, and `Stop` support these shared JSON

172fields:

173 

174```json

175{

176 "continue": true,

177 "stopReason": "optional",

178 "systemMessage": "optional",

179 "suppressOutput": false

180}

181```

182 

183| Field | Effect |

184| ---------------- | ----------------------------------------------- |

185| `continue` | If `false`, marks that hook run as stopped |

186| `stopReason` | Recorded as the reason for stopping |

187| `systemMessage` | Surfaced as a warning in the UI or event stream |

188| `suppressOutput` | Parsed today but not yet implemented |

189 

190Exit `0` with no output is treated as success and Codex continues.

191 

192`PreToolUse` supports `systemMessage`, but `continue`, `stopReason`, and

193`suppressOutput` are not currently supported for that event.

194 

195`PostToolUse` supports `systemMessage`, `continue: false`, and `stopReason`.

196`suppressOutput` is parsed but not currently supported for that event.

197 

198## Hooks

199 

200### SessionStart

201 

202`matcher` is applied to `source` for this event.

203 

204Fields in addition to [Common input fields](#common-input-fields):

205 

206| Field | Type | Meaning |

207| --- | --- | --- |

208| `source` | `string` | How the session started: `startup` or `resume` |

209 

210Plain text on `stdout` is added as extra developer context.

211 

212JSON on `stdout` supports [Common output fields](#common-output-fields) and this

213hook-specific shape:

214 

215```json

216{

217 "hookSpecificOutput": {

218 "hookEventName": "SessionStart",

219 "additionalContext": "Load the workspace conventions before editing."

220 }

221}

222```

223 

224That `additionalContext` text is added as extra developer context.

225 

226### PreToolUse

227 

228Currently `PreToolUse` only supports Bash tool interception. The model can

229still work around this by writing its own script to disk and then running that

230script with Bash, so treat this as a useful guardrail rather than a complete

231enforcement boundary.

232 

233`matcher` is applied to `tool_name`, which currently always equals `Bash`.

234 

235Fields in addition to [Common input fields](#common-input-fields):

236 

237| Field | Type | Meaning |

238| --- | --- | --- |

239| `turn_id` | `string` | Codex-specific extension. Active Codex turn id |

240| `tool_name` | `string` | Currently always `Bash` |

241| `tool_use_id` | `string` | Tool-call id for this invocation |

242| `tool_input.command` | `string` | Shell command Codex is about to run |

243 

244Plain text on `stdout` is ignored.

245 

246JSON on `stdout` can use `systemMessage` and can block a Bash command with this

247hook-specific shape:

248 

249```json

250{

251 "hookSpecificOutput": {

252 "hookEventName": "PreToolUse",

253 "permissionDecision": "deny",

254 "permissionDecisionReason": "Destructive command blocked by hook."

255 }

256}

257```

258 

259Codex also accepts this older block shape:

260 

261```json

262{

263 "decision": "block",

264 "reason": "Destructive command blocked by hook."

265}

266```

267 

268You can also use exit code `2` and write the blocking reason to `stderr`.

269 

270`permissionDecision: "allow"` and `"ask"`, legacy `decision: "approve"`,

271`updatedInput`, `additionalContext`, `continue: false`, `stopReason`, and

272`suppressOutput` are parsed but not supported yet, so they fail open.

273 

274### PostToolUse

275 

276Currently `PostToolUse` only supports Bash tool results. It is not limited to

277commands that exit successfully: non-interactive `exec_command` calls can still

278trigger `PostToolUse` when Codex emits a Bash post-tool payload. It cannot undo

279side effects from the command that already ran.

280 

281`matcher` is applied to `tool_name`, which currently always equals `Bash`.

282 

283Fields in addition to [Common input fields](#common-input-fields):

284 

285| Field | Type | Meaning |

286| --- | --- | --- |

287| `turn_id` | `string` | Codex-specific extension. Active Codex turn id |

288| `tool_name` | `string` | Currently always `Bash` |

289| `tool_use_id` | `string` | Tool-call id for this invocation |

290| `tool_input.command` | `string` | Shell command Codex just ran |

291| `tool_response` | `JSON value` | Bash tool output payload. Today this is usually a JSON string |

292 

293Plain text on `stdout` is ignored.

294 

295JSON on `stdout` can use `systemMessage` and this hook-specific shape:

296 

297```json

298{

299 "decision": "block",

300 "reason": "The Bash output needs review before continuing.",

301 "hookSpecificOutput": {

302 "hookEventName": "PostToolUse",

303 "additionalContext": "The command updated generated files."

304 }

305}

306```

307 

308That `additionalContext` text is added as extra developer context.

309 

310For this event, `decision: "block"` does not undo the completed Bash command.

311Instead, Codex records the feedback, replaces the tool result with that

312feedback, and continues the model from the hook-provided message.

313 

314You can also use exit code `2` and write the feedback reason to `stderr`.

315 

316To stop normal processing of the original tool result after the command has

317already run, return `continue: false`. Codex will replace the tool result with

318your feedback or stop text and continue from there.

319 

320`updatedMCPToolOutput` and `suppressOutput` are parsed but not supported yet,

321so they fail open.

322 

323### UserPromptSubmit

324 

325`matcher` is not currently used for this event.

326 

327Fields in addition to [Common input fields](#common-input-fields):

328 

329| Field | Type | Meaning |

330| --- | --- | --- |

331| `turn_id` | `string` | Codex-specific extension. Active Codex turn id |

332| `prompt` | `string` | User prompt that is about to be sent |

333 

334Plain text on `stdout` is added as extra developer context.

335 

336JSON on `stdout` supports [Common output fields](#common-output-fields) and

337this hook-specific shape:

338 

339```json

340{

341 "hookSpecificOutput": {

342 "hookEventName": "UserPromptSubmit",

343 "additionalContext": "Ask for a clearer reproduction before editing files."

344 }

345}

346```

347 

348That `additionalContext` text is added as extra developer context.

349 

350To block the prompt, return:

351 

352```json

353{

354 "decision": "block",

355 "reason": "Ask for confirmation before doing that."

356}

357```

358 

359You can also use exit code `2` and write the blocking reason to `stderr`.

360 

361### Stop

362 

363`matcher` is not currently used for this event.

364 

365Fields in addition to [Common input fields](#common-input-fields):

366 

367| Field | Type | Meaning |

368| --- | --- | --- |

369| `turn_id` | `string` | Codex-specific extension. Active Codex turn id |

370| `stop_hook_active` | `boolean` | Whether this turn was already continued by `Stop` |

371| `last_assistant_message` | `string | null` | Latest assistant message text, if available |

372 

373`Stop` expects JSON on `stdout` when it exits `0`. Plain text output is invalid

374for this event.

375 

376JSON on `stdout` supports [Common output fields](#common-output-fields). To keep

377Codex going, return:

378 

379```json

380{

381 "decision": "block",

382 "reason": "Run one more pass over the failing tests."

383}

384```

385 

386You can also use exit code `2` and write the continuation reason to `stderr`.

387 

388For this event, `decision: "block"` does not reject the turn. Instead, it tells

389Codex to continue and automatically creates a new continuation prompt that acts

390as a new user prompt, using your `reason` as that prompt text.

391 

392If any matching `Stop` hook returns `continue: false`, that takes precedence

393over continuation decisions from other matching `Stop` hooks.

394 

395## Schemas

396 

397If you need the exact current wire format, see the generated schemas in the

398[Codex GitHub repository](https://github.com/openai/codex/tree/main/codex-rs/hooks/schema/generated).

ide.md +8 −3

Details

20is experimental. For the best Windows experience, use Codex in a WSL workspace20is experimental. For the best Windows experience, use Codex in a WSL workspace

21and follow our [Windows setup guide](https://developers.openai.com/codex/windows).21and follow our [Windows setup guide](https://developers.openai.com/codex/windows).

22 22 

23After you install it, youll find the extension in your left sidebar next to your other extensions.23After you install it, you'll find Codex in your editor sidebar.

24In VS Code, Codex opens in the right sidebar by default.

24If you're using VS Code, restart the editor if you don't see Codex right away.25If you're using VS Code, restart the editor if you don't see Codex right away.

25 26 

26If you're using Cursor, the activity bar displays horizontally by default. Collapsed items can hide Codex, so you can pin it and reorganize the order of the extensions.27If you're using Cursor, the activity bar displays horizontally by default. Collapsed items can hide Codex, so you can pin it and reorganize the order of the extensions.


35 36 

36### Move Codex to the right sidebar37### Move Codex to the right sidebar

37 38 

38In VS Code, you can drag the Codex icon to the right of your editor to move it to the right sidebar.39In VS Code, Codex appears in the right sidebar automatically.

40If you prefer it in the primary (left) sidebar, drag the Codex icon back to the left activity bar.

39 41 

40In some IDEs, like Cursor, you may need to temporarily change the activity bar orientation first:42In VS Code forks like Cursor, you may need to move Codex to the right sidebar manually.

43To do that, you may need to temporarily change the activity bar orientation first:

41 44 

421. Open your editor settings and search for `activity bar` (in Workbench settings).451. Open your editor settings and search for `activity bar` (in Workbench settings).

432. Change the orientation to `vertical`.462. Change the orientation to `vertical`.


48Now drag the Codex icon to the right sidebar (for example, next to your Cursor chat). Codex appears as another tab in the sidebar.51Now drag the Codex icon to the right sidebar (for example, next to your Cursor chat). Codex appears as another tab in the sidebar.

49 52 

50After you move it, reset the activity bar orientation to `horizontal` to restore the default behavior.53After you move it, reset the activity bar orientation to `horizontal` to restore the default behavior.

54If you change your mind later, you can drag Codex back to the primary (left) sidebar at any time.

51 55 

52### Sign in56### Sign in

53 57 


64To see all available commands and bind them as keyboard shortcuts, select the settings icon in the Codex chat and select **Keyboard shortcuts**.68To see all available commands and bind them as keyboard shortcuts, select the settings icon in the Codex chat and select **Keyboard shortcuts**.

65You can also refer to the [Codex IDE extension commands](https://developers.openai.com/codex/ide/commands) page.69You can also refer to the [Codex IDE extension commands](https://developers.openai.com/codex/ide/commands) page.

66For a list of supported slash commands, see [Codex IDE extension slash commands](https://developers.openai.com/codex/ide/slash-commands).70For a list of supported slash commands, see [Codex IDE extension slash commands](https://developers.openai.com/codex/ide/slash-commands).

71If you're new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).

67 72 

68---73---

69 74 

ide/features.md +1 −1

Details

57 57 

58## Web search58## Web search

59 59 

60Codex ships with a first-party web search tool. For local tasks in the Codex IDE Extension, Codex enables web search by default and serves results from a web search cache. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you configure your sandbox for [full access](https://developers.openai.com/codex/security), web search defaults to live results. See [Config basics](https://developers.openai.com/codex/config-basic) to disable web search or switch to live results that fetch the most recent data.60Codex ships with a first-party web search tool. For local tasks in the Codex IDE Extension, Codex enables web search by default and serves results from a web search cache. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you configure your sandbox for [full access](https://developers.openai.com/codex/agent-approvals-security), web search defaults to live results. See [Config basics](https://developers.openai.com/codex/config-basic) to disable web search or switch to live results that fetch the most recent data.

61 61 

62You'll see `web_search` items in the transcript or `codex exec --json` output whenever Codex looks something up.62You'll see `web_search` items in the transcript or `codex exec --json` output whenever Codex looks something up.

63 63 

ide/settings.md +4 −0

Details

12 12 

13The Codex IDE extension uses the Codex CLI. Configure some behavior, such as the default model, approvals, and sandbox settings, in the shared `~/.codex/config.toml` file instead of in editor settings. See [Config basics](https://developers.openai.com/codex/config-basic).13The Codex IDE extension uses the Codex CLI. Configure some behavior, such as the default model, approvals, and sandbox settings, in the shared `~/.codex/config.toml` file instead of in editor settings. See [Config basics](https://developers.openai.com/codex/config-basic).

14 14 

15The extension also honors VS Code's built-in chat font settings for Codex conversation surfaces.

16 

15## Settings reference17## Settings reference

16 18 

17| Setting | Description |19| Setting | Description |

18| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |20| -------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

21| `chat.fontSize` | Controls chat text in the Codex sidebar, including conversation content and the composer. |

22| `chat.editor.fontSize` | Controls code-rendered content in Codex conversations, including code snippets and diffs. |

19| `chatgpt.cliExecutable` | Development only: Path to the Codex CLI executable. You don't need to set this unless you're actively developing the Codex CLI. If you set this manually, parts of the extension might not work as expected. |23| `chatgpt.cliExecutable` | Development only: Path to the Codex CLI executable. You don't need to set this unless you're actively developing the Codex CLI. If you set this manually, parts of the extension might not work as expected. |

20| `chatgpt.commentCodeLensEnabled` | Show CodeLens above to-do comments so you can complete them with Codex. |24| `chatgpt.commentCodeLensEnabled` | Show CodeLens above to-do comments so you can complete them with Codex. |

21| `chatgpt.localeOverride` | Preferred language for the Codex UI. Leave empty to detect automatically. |25| `chatgpt.localeOverride` | Preferred language for the Codex UI. Leave empty to detect automatically. |

Details

62 62 

63When you mention `@Codex` or assign an issue to it, Codex receives your issue content to understand your request and create a task.63When you mention `@Codex` or assign an issue to it, Codex receives your issue content to understand your request and create a task.

64Data handling follows OpenAI's [Privacy Policy](https://openai.com/privacy), [Terms of Use](https://openai.com/terms/), and other applicable [policies](https://openai.com/policies).64Data handling follows OpenAI's [Privacy Policy](https://openai.com/privacy), [Terms of Use](https://openai.com/terms/), and other applicable [policies](https://openai.com/policies).

65For more on security, see the [Codex security documentation](https://developers.openai.com/codex/security).65For more on security, see the [Codex security documentation](https://developers.openai.com/codex/agent-approvals-security).

66 66 

67Codex uses large language models that can make mistakes. Always review answers and diffs.67Codex uses large language models that can make mistakes. Always review answers and diffs.

68 68 

Details

31 31 

32When you mention `@Codex`, Codex receives your message and thread history to understand your request and create a task.32When you mention `@Codex`, Codex receives your message and thread history to understand your request and create a task.

33Data handling follows OpenAI's [Privacy Policy](https://openai.com/privacy), [Terms of Use](https://openai.com/terms/), and other applicable [policies](https://openai.com/policies).33Data handling follows OpenAI's [Privacy Policy](https://openai.com/privacy), [Terms of Use](https://openai.com/terms/), and other applicable [policies](https://openai.com/policies).

34For more on security, see the Codex [security documentation](https://developers.openai.com/codex/security).34For more on security, see the Codex [security documentation](https://developers.openai.com/codex/agent-approvals-security).

35 35 

36Codex uses large language models that can make mistakes. Always review answers and diffs.36Codex uses large language models that can make mistakes. Always review answers and diffs.

37 37 

learn/best-practices.md +223 −0 added

Details

1# Best practices

2 

3If you’re new to Codex or coding agents in general, this guide will help you get better results faster. It covers the core habits that make Codex more effective across the [CLI](https://developers.openai.com/codex/cli), [IDE extension](https://developers.openai.com/codex/ide), and the [Codex app](https://developers.openai.com/codex/app), from prompting and planning to validation, MCP, skills, and automations.

4 

5Codex works best when you treat it less like a one-off assistant and more like a teammate you configure and improve over time.

6 

7A useful way to think about this: start with the right task context, use `AGENTS.md` for durable guidance, configure Codex to match your workflow, connect external systems with MCP, turn repeated work into skills, and automate stable workflows.

8 

9## Strong first use: Context and prompts

10 

11Codex is already strong enough to be useful even when your prompt isn't perfect. You can often hand it a hard problem with minimal setup and still get a strong result. Clear [prompting](https://developers.openai.com/codex/prompting) isn't required to get value, but it does make results more reliable, especially in larger codebases or higher-stakes tasks.

12 

13If you work in a large or complex repository, the biggest unlock is giving Codex the right task context and a clear structure for what you want done.

14 

15A good default is to include four things in your prompt:

16 

17- **Goal:** What are you trying to change or build?

18- **Context:** Which files, folders, docs, examples, or errors matter for this task? You can @ mention certain files as context.

19- **Constraints:** What standards, architecture, safety requirements, or conventions should Codex follow?

20- **Done when:** What should be true before the task is complete, such as tests passing, behavior changing, or a bug no longer reproducing?

21 

22This helps Codex stay scoped, make fewer assumptions, and produce work that's easier to review.

23 

24Choose a reasoning level based on how hard the task is and test what works best for your workflow. Different users and tasks work best with different settings.

25 

26- Low for faster, well-scoped tasks

27- Medium or High for more complex changes or debugging

28- Extra High for long, agentic, reasoning-heavy tasks

29 

30To provide context faster, try using speech dictation inside the Codex app to

31 dictate what you want Codex to do rather than typing it.

32 

33## Plan first for difficult tasks

34 

35If the task is complex, ambiguous, or hard to describe well, ask Codex to plan before it starts coding.

36 

37A few approaches work well:

38 

39**Use Plan mode:** For most users, this is the easiest and most effective option. Plan mode lets Codex gather context, ask clarifying questions, and build a stronger plan before implementation. Toggle with `/plan` or <kbd>Shift</kbd>+<kbd>Tab</kbd>.

40 

41**Ask Codex to interview you:** If you have a rough idea of what you want but aren't sure how to describe it well, ask Codex to question you first. Tell it to challenge your assumptions and turn the fuzzy idea into something concrete before writing code.

42 

43**Use a PLANS.md template:** For more advanced workflows, you can configure Codex to follow a `PLANS.md` or execution-plan template for longer-running or multi-step work. For more detail, see the [execution plans guide](https://developers.openai.com/cookbook/articles/codex_exec_plans).

44 

45## Make guidance reusable with `AGENTS.md`

46 

47Once a prompting pattern works, the next step is to stop repeating it manually. That's where [AGENTS.md](https://developers.openai.com/codex/guides/agents-md) comes in.

48 

49Think of `AGENTS.md` as an open-format README for agents. It loads into context automatically and is the best place to encode how you and your team want Codex to work in a repository.

50 

51A good `AGENTS.md` covers:

52 

53- repo layout and important directories

54- How to run the project

55- Build, test, and lint commands

56- Engineering conventions and PR expectations

57- Constraints and do-not rules

58- What done means and how to verify work

59 

60The `/init` slash command in the CLI is the quick-start command to scaffold a starter `AGENTS.md` in the current directory. It's a great starting point, but you should edit the result to match how your team actually builds, tests, reviews, and ships code.

61 

62You can create `AGENTS.md` files at different levels: a global `AGENTS.md` for personal defaults that sits in `~/.codex`, a repo-level file for shared standards, and more specific files in subdirectories for local rules. If there’s a more specific file closer to your current directory, that guidance wins.

63 

64Keep it practical. A short, accurate `AGENTS.md` is more useful than a long file full of vague rules. Start with the basics, then add new rules only after you notice repeated mistakes.

65 

66If `AGENTS.md` starts getting too large, keep the main file concise and reference task-specific markdown files for things like planning, code review, or architecture.

67 

68When Codex makes the same mistake twice, ask it for a retrospective and update

69 `AGENTS.md`. Guidance stays practical and based on real friction.

70 

71## Configure Codex for consistency

72 

73Configuration is one of the main ways to make Codex behave more consistently across sessions and surfaces. For example, you can set defaults for model choice, reasoning effort, sandbox mode, approval policy, profiles, and MCP setup.

74 

75A good starting pattern is:

76 

77- Keep personal defaults in `~/.codex/config.toml` (Settings → Configuration → Open config.toml from the Codex app)

78- Keep repo-specific behavior in `.codex/config.toml`

79- Use command-line overrides only for one-off situations (if you use the CLI)

80 

81[`config.toml`](https://developers.openai.com/codex/config-basic) is where you define durable preferences such as MCP servers, profiles, multi-agent setup, and feature flags. You can edit it directly or ask Codex to update it for you.

82 

83Codex ships with operating level sandboxing and has two key knobs that you can control. Approval mode determines when Codex asks for your permission to run a command and sandbox mode determines if Codex can read or write in the directory and what files the agent can access.

84 

85If you're new to coding agents, start with the default permissions. Keep approval and sandboxing tight by default, then loosen permissions only for trusted repos or specific workflows once the need is clear.

86 

87Note that the CLI, IDE, and Codex app all share the same configuration layers. Learn more on the [sample configuration](https://developers.openai.com/codex/config-sample) page.

88 

89Configure Codex for your real environment early. Many quality issues are

90 really setup issues, like the wrong working directory, missing write access,

91 wrong model defaults, or missing tools and connectors.

92 

93## Improve reliability with testing and review

94 

95Don't stop at asking Codex to make a change. Ask it to create tests when needed, run the relevant checks, confirm the result, and review the work before you accept it.

96 

97Codex can do this loop for you, but only if it knows what “good” looks like. That guidance can come from either the prompt or `AGENTS.md`.

98 

99That can include:

100 

101- Writing or updating tests for the change

102- Running the right test suites

103- Checking lint, formatting, or type checks

104- Confirming the final behavior matches the request

105- Reviewing the diff for bugs, regressions, or risky patterns

106 

107Toggle the diff panel in the Codex app to directly [review

108 changes](https://developers.openai.com/codex/app/review) locally. Click on a specific row to provide

109 feedback that gets fed as context to the next Codex turn.

110 

111A useful option here is the slash command `/review`, which gives you a few ways to review code:

112 

113- Review against a base branch for PR-style review

114- Review uncommitted changes

115- Review a commit

116- Use custom review instructions

117 

118If you and your team have a `code_review.md` file and reference it from `AGENTS.md`, Codex can follow that guidance during review as well. This is a strong pattern for teams that want review behavior to stay consistent across repositories and contributors.

119 

120Codex shouldn't just generate code. With the right instructions, it can also help **test it, check it, and review it**.

121 

122If you use GitHub Cloud, you can set up Codex to run [code reviews for your PRs](https://developers.openai.com/codex/integrations/github). At OpenAI, Codex reviews 100% of PRs. You can enable automatic reviews or have Codex reactively review when you @Codex.

123 

124## Use MCPs for external context

125 

126Use MCPs when the context Codex needs lives outside the repo. It lets Codex connect to the tools and systems you already use, so you don't have to keep copying and pasting live information into prompts.

127 

128[Model Context Protocol](https://developers.openai.com/codex/mcp), or MCP, is an open standard for connecting Codex to external tools and systems.

129 

130Use MCP when:

131 

132- The needed context lives outside the repo

133- The data changes frequently

134- You want Codex to use a tool rather than rely on pasted instructions

135- You need a repeatable integration across users or projects

136 

137Codex supports both STDIO and Streamable HTTP servers with OAuth.

138 

139In the Codex App, head to Settings → MCP servers to see custom and recommended servers. Often, Codex can help you install the needed servers. All you need to do is ask. You can also use the `codex mcp add` command in the CLI to add your custom servers with a name, URL, and other details.

140 

141Add tools only when they unlock a real workflow. Do not start by wiring in

142 every tool you use. Start with one or two tools that clearly remove a manual

143 loop you already do often, then expand from there.

144 

145## Turn repeatable work into skills

146 

147Once a workflow becomes repeatable, stop relying on long prompts or repeated back-and-forth. Use a [Skill](https://developers.openai.com/codex/skills) to package the instructions in a SKILL.md file, context, and supporting logic Codex should apply consistently. Skills work across the CLI, IDE extension, and Codex app.

148 

149Keep each skill scoped to one job. Start with 2 to 3 concrete use cases, define clear inputs and outputs, and write the description so it says what the skill does and when to use it. Include the kinds of trigger phrases a user would actually say.

150 

151Don't try to cover every edge case up front. Start with one representative task, get it working well, then turn that workflow into a skill and improve from there. Include scripts or extra assets only when they improve reliability.

152 

153A good rule of thumb: if you keep reusing the same prompt or correcting the same workflow, it should probably become a skill.

154 

155Skills are especially useful for recurring jobs like:

156 

157- Log triage

158- Release note drafting

159- PR review against a checklist

160- Migration planning

161- Telemetry or incident summaries

162- Standard debugging flows

163 

164The `$skill-creator` skill is the best place to start to scaffold the first version of a skill. Keep the first version local while you iterate. When it's ready to share broadly, package it as a [plugin](https://developers.openai.com/codex/plugins/build). One of the most important parts of a skill is the description. It should say what the skill does and when to use it.

165 

166Personal skills are stored in `$HOME/.agents/skills`, and shared team skills

167 can be checked into `.agents/skills` inside a repository. This is especially

168 helpful for onboarding new teammates.

169 

170## Use automations for repeated work

171 

172Once a workflow is stable, you can schedule Codex to run it in the background for you. In the Codex app, [automations](https://developers.openai.com/codex/app/automations) let you choose the project, prompt, cadence, and execution environment for a recurring task.

173 

174Once a task becomes repetitive for you, you can create an automation in the Automations tab on the Codex app. You can choose which project it runs in, the prompt it runs (you can invoke skills), and the cadence it will run. You can also choose whether the automation runs in a dedicated git worktree or in your local environment. Learn more about [git worktrees](https://developers.openai.com/codex/app/worktrees).

175 

176Good candidates include:

177 

178- Summarizing recent commits

179- Scanning for likely bugs

180- Drafting release notes

181- Checking CI failures

182- Producing standup summaries

183- Running repeatable analysis workflows on a schedule

184 

185A useful rule is that skills define the method, automations define the schedule. If a workflow still needs a lot of steering, turn it into a skill first. Once it's predictable, automation becomes a force multiplier.

186 

187Use automations for reflection and maintenance, not just execution. Review

188 recent sessions, summarize repeated friction, and improve prompts,

189 instructions, or workflow setup over time.

190 

191## Organize long-running work with session controls

192 

193Codex sessions aren't just chat history. They're working threads that accumulate context, decisions, and actions over time, so managing them well has a big impact on quality.

194 

195The Codex app UI makes thread management easiest because you can pin threads and create worktrees. If you are using the CLI, these [slash commands](https://developers.openai.com/codex/cli/slash-commands) are especially useful:

196 

197- `/experimental` to toggle experimental features and add to your `config.toml`

198- `/resume` to resume a saved conversation

199- `/fork` to create a new thread while preserving the original transcript

200- `/compact` when the thread is getting long and you want a summarized version of earlier context. Note that Codex does automatically compact conversations for you

201- `/agent` when you are running parallel agents and want to switch between the active agent thread

202- `/theme` to choose a syntax highlighting theme

203- `/apps` to use ChatGPT apps directly in Codex

204- `/status` to inspect the current session state

205 

206Keep one thread per coherent unit of work. If the work is still part of the same problem, staying in the same thread is often better because it preserves the reasoning trail. Fork only when the work truly branches.

207 

208Use Codex’s [subagent](https://developers.openai.com/codex/concepts/subagents) workflows to offload bounded

209 work from the main thread. Keep the main agent focused on the core problem,

210 and use subagents for tasks like exploration, tests, or triage.

211 

212## Common mistakes

213 

214A few common mistakes to avoid when first using Codex:

215 

216- Overloading the prompt with durable rules instead of moving them into `AGENTS.md` or a skill

217- Not letting the agent see its work by not giving details on how to best run build and test commands

218- Skipping planning on multi-step and complex tasks

219- Giving Codex full permission to your computer before you understand the workflow

220- Running live threads on the same files without using git worktrees

221- Turning a recurring task into an automation before it's reliable manually

222- Treating Codex like something you have to watch step by step instead of using it in parallel with your own work

223- Using one thread per project instead of one thread per task. This leads to bloated context and worse results over time

mcp.md +14 −2

Details

75- `enabled_tools` (optional): Tool allow list.75- `enabled_tools` (optional): Tool allow list.

76- `disabled_tools` (optional): Tool deny list (applied after `enabled_tools`).76- `disabled_tools` (optional): Tool deny list (applied after `enabled_tools`).

77 77 

78If your OAuth provider requires a static callback URI, set the top-level `mcp_oauth_callback_port` in `config.toml`. If unset, Codex binds to an ephemeral port.78If your OAuth provider requires a fixed callback port, set the top-level `mcp_oauth_callback_port` in `config.toml`. If unset, Codex binds to an ephemeral port.

79 

80If your MCP OAuth flow must use a specific callback URL (for example, a remote devbox ingress URL or a custom callback path), set `mcp_oauth_callback_url`. Codex uses this value as the OAuth `redirect_uri` while still using `mcp_oauth_callback_port` for the callback listener port. Local callback URLs (for example `localhost`) bind on loopback; non-local callback URLs bind on `0.0.0.0` so the callback can reach the host.

81 

82If the MCP server advertises `scopes_supported`, Codex prefers those

83server-advertised scopes during OAuth login. Otherwise, Codex falls back to the

84scopes configured in `config.toml`.

79 85 

80#### config.toml examples86#### config.toml examples

81 87 


88MY_ENV_VAR = "MY_ENV_VALUE"94MY_ENV_VAR = "MY_ENV_VALUE"

89```95```

90 96 

97```toml

98# Optional MCP OAuth callback overrides (used by `codex mcp login`)

99mcp_oauth_callback_port = 5555

100mcp_oauth_callback_url = "https://devbox.example.internal/callback"

101```

102 

91```toml103```toml

92[mcp_servers.figma]104[mcp_servers.figma]

93url = "https://mcp.figma.com/mcp"105url = "https://mcp.figma.com/mcp"


109 121 

110The list of MCP servers keeps growing. Here are a few common ones:122The list of MCP servers keeps growing. Here are a few common ones:

111 123 

112- [OpenAI Docs MCP](/resources/docs-mcp): Search and read OpenAI developer docs.124- [OpenAI Docs MCP](/learn/docs-mcp): Search and read OpenAI developer docs.

113- [Context7](https://github.com/upstash/context7): Connect to up-to-date developer documentation.125- [Context7](https://github.com/upstash/context7): Connect to up-to-date developer documentation.

114- Figma [Local](https://developers.figma.com/docs/figma-mcp-server/local-server-installation/) and [Remote](https://developers.figma.com/docs/figma-mcp-server/remote-server-installation/): Access your Figma designs.126- Figma [Local](https://developers.figma.com/docs/figma-mcp-server/local-server-installation/) and [Remote](https://developers.figma.com/docs/figma-mcp-server/remote-server-installation/): Access your Figma designs.

115- [Playwright](https://www.npmjs.com/package/@playwright/mcp): Control and inspect a browser using Playwright.127- [Playwright](https://www.npmjs.com/package/@playwright/mcp): Control and inspect a browser using Playwright.

models.md +64 −27

Details

2 2 

3## Recommended models3## Recommended models

4 4 

5![gpt-5.3-codex](/images/codex/codex-wallpaper-1.webp)5![gpt-5.4](/images/api/models/gpt-5.4.jpg)

6 6 

7gpt-5.3-codex7gpt-5.4

8 8 

9Most capable agentic coding model to date, combining frontier coding performance with stronger reasoning and professional knowledge capabilities.9Flagship frontier model for professional work that brings the industry-leading coding capabilities of GPT-5.3-Codex together with stronger reasoning, tool use, and agentic workflows.

10 10 

11codex -m gpt-5.3-codex11codex -m gpt-5.4

12 12 

13Copy command13Copy command

14 14 


26 26 

27API Access27API Access

28 28 

29![gpt-5.3-codex-spark](/images/codex/codex-wallpaper-2.webp)29![gpt-5.4-mini](/images/api/models/gpt-5-mini.jpg)

30 30 

31gpt-5.3-codex-spark31gpt-5.4-mini

32 32 

33Text-only research preview model optimized for near-instant, real-time coding iteration. Available to ChatGPT Pro users.33Fast, efficient mini model for responsive coding tasks and subagents.

34 34 

35codex -m gpt-5.3-codex-spark35codex -m gpt-5.4-mini

36 36 

37Copy command37Copy command

38 38 


50 50 

51API Access51API Access

52 52 

53![gpt-5.2-codex](/images/codex/gpt-5.2-codex.png)53![gpt-5.3-codex](/images/codex/codex-wallpaper-1.webp)

54 54 

55gpt-5.2-codex55gpt-5.3-codex

56 56 

57Advanced coding model for real-world engineering. Succeeded by GPT-5.3-Codex.57Industry-leading coding model for complex software engineering. Its coding capabilities now also power GPT-5.4.

58 58 

59codex -m gpt-5.2-codex59codex -m gpt-5.3-codex

60 60 

61Copy command61Copy command

62 62 


74 74 

75API Access75API Access

76 76 

77For most coding tasks in Codex, start with gpt-5.3-codex. It is available for77![gpt-5.3-codex-spark](/images/codex/codex-wallpaper-2.webp)

78ChatGPT-authenticated Codex sessions in the Codex app, CLI, IDE extension, and78 

79Codex Cloud. API access for GPT-5.3-Codex will come soon. The79gpt-5.3-codex-spark

80gpt-5.3-codex-spark model is available in research preview for ChatGPT Pro80 

81subscribers.81Text-only research preview model optimized for near-instant, real-time coding iteration. Available to ChatGPT Pro users.

82 

83codex -m gpt-5.3-codex-spark

84 

85Copy command

86 

87Capability

88 

89Speed

90 

91Codex CLI & SDK

92 

93Codex app & IDE extension

94 

95Codex Cloud

96 

97ChatGPT Credits

98 

99API Access

100 

101For most tasks in Codex, start with `gpt-5.4`. It combines strong coding,

102reasoning, native computer use, and broader professional workflows in one

103model. Use `gpt-5.4-mini` when you want a faster, lower-cost option for

104lighter coding tasks or subagents. The `gpt-5.3-codex-spark` model is

105available in research preview for ChatGPT Pro subscribers and is optimized for

106near-instant, real-time coding iteration.

82 107 

83## Alternative models108## Alternative models

84 109 

85![gpt-5.2](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5.2.jpg)110![gpt-5.2-codex](/images/codex/gpt-5.2-codex.png)

111 

112gpt-5.2-codex

113 

114Advanced coding model for real-world engineering. Succeeded by GPT-5.3-Codex.

115 

116codex -m gpt-5.2-codex

117 

118Copy command

119 

120Show details

121 

122![gpt-5.2](/images/api/models/gpt-5.2.jpg)

86 123 

87gpt-5.2124gpt-5.2

88 125 

89Our best general agentic model for tasks across industries and domains.126Previous general-purpose model for coding and agentic tasks across industries and domains. Succeeded by GPT-5.4.

90 127 

91codex -m gpt-5.2128codex -m gpt-5.2

92 129 


94 131 

95Show details132Show details

96 133 

97![gpt-5.1-codex-max](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5.1-codex-max.jpg)134![gpt-5.1-codex-max](/images/api/models/gpt-5.1-codex-max.jpg)

98 135 

99gpt-5.1-codex-max136gpt-5.1-codex-max

100 137 


106 143 

107Show details144Show details

108 145 

109![gpt-5.1](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5.1.jpg)146![gpt-5.1](/images/api/models/gpt-5.1.jpg)

110 147 

111gpt-5.1148gpt-5.1

112 149 


118 155 

119Show details156Show details

120 157 

121![gpt-5.1-codex](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5.1-codex.jpg)158![gpt-5.1-codex](/images/api/models/gpt-5.1-codex.jpg)

122 159 

123gpt-5.1-codex160gpt-5.1-codex

124 161 


130 167 

131Show details168Show details

132 169 

133![gpt-5-codex](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5-codex.jpg)170![gpt-5-codex](/images/api/models/gpt-5-codex.jpg)

134 171 

135gpt-5-codex172gpt-5-codex

136 173 


142 179 

143Show details180Show details

144 181 

145![gpt-5-codex-mini](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5-codex.jpg)182![gpt-5-codex-mini](/images/api/models/gpt-5-codex.jpg)

146 183 

147gpt-5-codex-mini184gpt-5-codex-mini

148 185 


154 191 

155Show details192Show details

156 193 

157![gpt-5](https://cdn.openai.com/API/docs/images/model-page/model-art/gpt-5.jpg)194![gpt-5](/images/api/models/gpt-5.jpg)

158 195 

159gpt-5196gpt-5

160 197 


182The Codex CLI and IDE extension use the same `config.toml` [configuration file](https://developers.openai.com/codex/config-basic). To specify a model, add a `model` entry to your configuration file. If you don't specify a model, the Codex app, CLI, or IDE Extension defaults to a recommended model.219The Codex CLI and IDE extension use the same `config.toml` [configuration file](https://developers.openai.com/codex/config-basic). To specify a model, add a `model` entry to your configuration file. If you don't specify a model, the Codex app, CLI, or IDE Extension defaults to a recommended model.

183 220 

184```221```

185model = "gpt-5.2"222model = "gpt-5.4"

186```223```

187 224 

188### Choosing a different local model temporarily225### Choosing a different local model temporarily


192To start a new Codex CLI thread with a specific model or to specify the model for `codex exec` you can use the `--model`/`-m` flag:229To start a new Codex CLI thread with a specific model or to specify the model for `codex exec` you can use the `--model`/`-m` flag:

193 230 

194```bash231```bash

195codex -m gpt-5.3-codex232codex -m gpt-5.4

196```233```

197 234 

198### Choosing your model for cloud tasks235### Choosing your model for cloud tasks

multi-agent.md +0 −129 deleted

File DeletedView Diff

1# Multi-agents

2 

3Codex can run multi-agent workflows by spawning specialized agents in parallel and then collecting their results in one response. This can be particularly helpful for complex tasks that are highly parallel, such as codebase exploration or implementing a multi-step feature plan.

4 

5With multi-agent workflows you can also define your own set of agents with different model configurations and instructions depending on the agent.

6 

7## Enable multi-agent

8 

9Multi-agent workflows are currently experimental and need to be explicitly enabled.

10 

11You can enable this feature from the CLI with `/experimental`. Enable

12**Multi-agents**, then restart Codex.

13 

14Multi-agent activity is currently surfaced in the CLI. Visibility in other

15surfaces (the Codex app and IDE Extension) is coming soon.

16 

17You can also add the [`multi_agent` feature flag](https://developers.openai.com/codex/config-basic#feature-flags) directly to your configuration file (`~/.codex/config.toml`):

18 

19```

20[features]

21multi_agent = true

22```

23 

24## Typical workflow

25 

26Codex handles orchestration across agents, including spawning new sub-agents, routing follow-up instructions, waiting for results, and closing agent threads.

27 

28When many agents are running, Codex waits until all requested results are available, then returns a consolidated response.

29 

30Codex will automatically decide when to spawn a new agent or you can explicitly ask it to do so.

31 

32To see it in action, try the following prompt on your project:

33 

34```

35I would like to review the following points on the current PR (this branch vs main). Spawn one agent per point, wait for all of them, and summarize the result for each point.

361. Security issue

372. Code quality

383. Bugs

394. Race

405. Test flakiness

416. Maintainability of the code

42```

43 

44## Managing sub-agents

45 

46- Use `/agent` in the CLI to switch between active agent threads and inspect the ongoing thread.

47- Ask Codex directly to steer a running sub-agent, stop it, or close completed agent threads.

48 

49## Approvals and sandbox controls

50 

51Sub-agents inherit your current sandbox policy, but they run with

52non-interactive approvals. If a sub-agent attempts an action that would require

53a new approval, that action fails and the error is surfaced in the parent

54workflow.

55 

56You can also override the sandbox configuration for individual [agent roles](#agent-roles) such as explicitly marking an agent to work in read-only mode.

57 

58## Agent roles

59 

60You configure agent roles in the `[agents]` section of your [configuration](https://developers.openai.com/codex/config-basic#configuration-precedence).

61 

62Agent roles can be defined either in your local configuration (typically `~/.codex/config.toml`) or shared in a project-specific `.codex/config.toml`.

63 

64Each role can provide guidance (`description`) for when Codex should use this agent, and optionally load a

65role-specific config file (`config_file`) when Codex spawns an agent with that role.

66 

67Codex ships with built-in roles:

68 

69- `default`

70- `worker`

71- `explorer`

72 

73Each agent role can override your default configuration. Common settings to override for an agent role are:

74 

75- `model` and `model_reasoning_effort` to select a specific model for your agent role

76- `sandbox_mode` to mark an agent as `read-only`

77- `developer_instructions` to give the agent role additional instructions without relying on the parent agent for passing them

78 

79### Schema

80 

81| Field | Type | Required | Purpose |

82| --- | --- | --- | --- |

83| `agents.max_threads` | number | No | Maximum number of concurrently open agent threads. |

84| `[agents.<name>]` | table | No | Declares a role. `<name>` is used as the `agent_type` when spawning an agent. |

85| `agents.<name>.description` | string | No | Human-facing role guidance shown to Codex when it decides which role to use. |

86| `agents.<name>.config_file` | string (path) | No | Path to a TOML config layer applied to spawned agents for that role. |

87 

88**Notes:**

89 

90- Unknown fields in `[agents.<name>]` are rejected.

91- Relative `config_file` paths are resolved relative to the `config.toml` file that defines the role.

92- If a role name matches a built-in role (for example, `explorer`), your user-defined role takes precedence.

93- If Codex can’t load a role config file, agent spawns can fail until you fix the file.

94- Any configuration not set by the agent role will be inherited from the parent session.

95 

96### Example agent roles

97 

98Below is an example that overrides the definitions for the built-in `default` and `explorer` agent roles and defines a new `reviewer` role.

99 

100Example `~/.codex/config.toml`:

101 

102```

103[agents.default]

104description = "General-purpose helper."

105 

106[agents.reviewer]

107description = "Find security, correctness, and test risks in code."

108config_file = "agents/reviewer.toml"

109 

110[agents.explorer]

111description = "Fast codebase explorer for read-heavy tasks."

112config_file = "agents/custom-explorer.toml"

113```

114 

115Example config file for the `reviewer` role (`~/.codex/agents/reviewer.toml`):

116 

117```

118model = "gpt-5.3-codex"

119model_reasoning_effort = "high"

120developer_instructions = "Focus on high priority issues, write tests to validate hypothesis before flagging an issue. When finding security issues give concrete steps on how to reproduce the vulnerability."

121```

122 

123Example config file for the `explorer` role (`~/.codex/agents/custom-explorer.toml`):

124 

125```

126model = "gpt-5.3-codex-spark"

127model_reasoning_effort = "medium"

128sandbox_mode = "read-only"

129```

Details

111 111 

112`codex exec` reuses saved CLI authentication by default. In CI, it's common to provide credentials explicitly:112`codex exec` reuses saved CLI authentication by default. In CI, it's common to provide credentials explicitly:

113 113 

114### Use API key auth (recommended)

115 

114- Set `CODEX_API_KEY` as a secret environment variable for the job.116- Set `CODEX_API_KEY` as a secret environment variable for the job.

115- Keep prompts and tool output in mind: they can include sensitive code or data.117- Keep prompts and tool output in mind: they can include sensitive code or data.

116 118 


122 124 

123`CODEX_API_KEY` is only supported in `codex exec`.125`CODEX_API_KEY` is only supported in `codex exec`.

124 126 

127Use ChatGPT-managed auth in CI/CD (advanced)

128 

129Read this if you need to run CI/CD jobs with a Codex user account instead of an

130API key, such as enterprise teams using ChatGPT-managed Codex access on trusted

131runners or users who need ChatGPT/Codex rate limits instead of API key usage.

132 

133API keys are the right default for automation because they are simpler to

134provision and rotate. Use this path only if you specifically need to run as

135your Codex account.

136 

137Treat `~/.codex/auth.json` like a password: it contains access tokens. Don't

138commit it, paste it into tickets, or share it in chat.

139 

140Do not use this workflow for public or open-source repositories. If `codex login`

141is not an option on the runner, seed `auth.json` through secure storage, run

142Codex on the runner so Codex refreshes it in place, and persist the updated file

143between runs.

144 

145See [Maintain Codex account auth in CI/CD (advanced)](https://developers.openai.com/codex/auth/ci-cd-auth).

146 

125## Resume a non-interactive session147## Resume a non-interactive session

126 148 

127If you need to continue a previous run (for example, a two-stage pipeline), use the `resume` subcommand:149If you need to continue a previous run (for example, a two-stage pipeline), use the `resume` subcommand:

open-source.md +2 −0

Details

2 2 

3OpenAI develops key parts of Codex in the open. That work lives on GitHub so you can follow progress, report issues, and contribute improvements.3OpenAI develops key parts of Codex in the open. That work lives on GitHub so you can follow progress, report issues, and contribute improvements.

4 4 

5If you maintain a widely used open-source project or want to nominate maintainers stewarding important projects, you can also [apply to the Codex for OSS program](https://developers.openai.com/community/codex-for-oss) for API credits, ChatGPT Pro with Codex, and selective access to Codex Security.

6 

5## Open-source components7## Open-source components

6 8 

7| Component | Where to find | Notes |9| Component | Where to find | Notes |

overview.md +6 −2

Details

22 22 

23 Learn more](https://developers.openai.com/codex/explore) [### Community23 Learn more](https://developers.openai.com/codex/explore) [### Community

24 24 

25Join the OpenAI Discord to ask questions, share workflows and connect with others.25Read community posts, explore meetups, and connect with Codex builders.

26 26 

27 Join the Discord](https://discord.gg/openai)27 See community](/community) [### Codex for Open Source

28 

29Apply or nominate maintainers for API credits, ChatGPT Pro with Codex, and selective Codex Security access.

30 

31 Learn more](https://developers.openai.com/community/codex-for-oss)

plugins.md +114 −0 added

Details

1# Plugins

2 

3## Overview

4 

5Plugins bundle skills, app integrations, and MCP servers into reusable

6workflows for Codex.

7 

8Extend what Codex can do, for example:

9 

10- Install the Gmail plugin to let Codex read and manage Gmail.

11- Install the Google Drive plugin to work across Drive, Docs, Sheets, and

12 Slides.

13- Install the Slack plugin to summarize channels or draft replies.

14 

15A plugin can contain:

16 

17- **Skills:** reusable instructions for specific kinds of work. Codex can load

18 them when needed so it follows the right steps and uses the right references

19 or helper scripts for a task.

20- **Apps:** connections to tools like GitHub, Slack, or Google Drive, so

21 Codex can read information from those tools and take actions in them.

22- **MCP servers:** services that give Codex access to additional tools or

23 shared information, often from systems outside your local project.

24 

25More plugin capabilities are coming soon.

26 

27## Use and install plugins

28 

29### Plugin Directory in the Codex app

30 

31Open **Plugins** in the Codex app to browse and install curated plugins.

32 

33![Codex Plugins page](/images/codex/plugins/directory.png)

34 

35### Plugin directory in the CLI

36 

37In Codex CLI, run the following command to open the plugins list:

38 

39```text

40codex

41/plugins

42```

43 

44![Plugins list in Codex CLI](/images/codex/plugins/cli_light.png)

45 

46### Install and use a plugin

47 

48Once you open the plugin directory:

49 

501. Search or browse for a plugin, then open its details.

512. Select the install button. In the app, select the plus button or

52 **Add to Codex**. In the CLI, select `Install plugin`.

533. If the plugin needs an external app, connect it when prompted. Some plugins

54 ask you to authenticate during install. Others wait until the first time you

55 use them.

564. After installation, start a new thread and ask Codex to use the plugin.

57 

58After you install a plugin, you can use it directly in the prompt window:

59 

60![Codex Plugins page](/images/codex/plugins/plugin-github-invoke.png)

61 

62Describe the task directly

63 

64 Ask for the outcome you want, such as "Summarize unread Gmail threads

65 from today" or "Pull the latest launch notes from Google Drive."

66 

67 Use this when you want Codex to choose the right installed tools for the

68 task.

69 

70Choose a specific plugin

71 

72 Type <code>@</code> to invoke the plugin or one of its bundled skills

73 explicitly.

74 

75 Use this when you want to be specific about which plugin or skill Codex

76should use. See [Codex app commands](https://developers.openai.com/codex/app/commands) and

77[Skills](https://developers.openai.com/codex/skills).

78 

79### How permissions and data sharing work

80 

81Installing a plugin makes its workflows available in Codex, but your existing

82[approval settings](https://developers.openai.com/codex/agent-approvals-security) still apply. Any

83connected external services remain subject to their own authentication,

84privacy, and data-sharing policies.

85 

86- Bundled skills are available as soon as you install the plugin.

87- If a plugin includes apps, Codex may prompt you to install or sign in to

88 those apps in ChatGPT during setup or the first time you use them.

89- If a plugin includes MCP servers, they may require additional setup or

90 authentication before you can use them.

91- When Codex sends data through a bundled app, that app's terms and privacy

92 policy apply.

93 

94### Remove or turn off a plugin

95 

96To remove a plugin, reopen it from the plugin browser and select

97**Uninstall plugin**.

98 

99Uninstalling a plugin removes the plugin bundle from Codex, but bundled apps

100stay installed until you manage them in ChatGPT.

101 

102If you want to keep a plugin installed but turn it off, set its entry in

103`~/.codex/config.toml` to `enabled = false`, then restart Codex:

104 

105```toml

106[plugins."gmail@openai-curated"]

107enabled = false

108```

109 

110## Build your own plugin

111 

112If you want to create, test, or distribute your own plugin, see

113[Build plugins](https://developers.openai.com/codex/plugins/build). That page covers local scaffolding,

114manual marketplace setup, plugin manifests, and packaging guidance.

plugins/build.md +359 −0 added

Details

1# Build plugins

2 

3This page is for plugin authors. If you want to browse, install, and use

4plugins in Codex, see [Plugins](https://developers.openai.com/codex/plugins). If you are still iterating on

5one repo or one personal workflow, start with a local skill. Build a plugin

6when you want to share that workflow across teams, bundle app integrations or

7MCP config, or publish a stable package.

8 

9## Create a plugin with `$plugin-creator`

10 

11For the fastest setup, use the built-in `$plugin-creator` skill.

12 

13![plugin-creator skill in Codex](/images/codex/plugins/plugin-creator.png)

14 

15It scaffolds the required `.codex-plugin/plugin.json` manifest and can also

16generate a local marketplace entry for testing. If you already have a plugin

17folder, you can still use `$plugin-creator` to wire it into a local

18marketplace.

19 

20![how to invoke the plugin-creator skill](/images/codex/plugins/plugin-creator-invoke.png)

21 

22### Build your own curated plugin list

23 

24A marketplace is a JSON catalog of plugins. `$plugin-creator` can generate one

25for a single plugin, and you can keep adding entries to that same marketplace

26to build your own curated list for a repo, team, or personal workflow.

27 

28In Codex, each marketplace appears as a selectable source in the plugin

29directory. Use `$REPO_ROOT/.agents/plugins/marketplace.json` for a repo-scoped

30list or `~/.agents/plugins/marketplace.json` for a personal list. Add one

31entry per plugin under `plugins[]`, point each `source.path` at the plugin

32folder with a `./`-prefixed path relative to the marketplace root, and set

33`interface.displayName` to the label you want Codex to show in the marketplace

34picker. Then restart Codex. After that, open the plugin directory, choose your

35marketplace, and browse or install the plugins in that curated list.

36 

37You don't need a separate marketplace per plugin. One marketplace can expose a

38single plugin while you are testing, then grow into a larger curated catalog as

39you add more plugins.

40 

41![custom local marketplace in the plugin directory](/images/codex/plugins/codex-local-plugin-light.png)

42 

43### Create a plugin manually

44 

45Start with a minimal plugin that packages one skill.

46 

471. Create a plugin folder with a manifest at `.codex-plugin/plugin.json`.

48 

49```bash

50mkdir -p my-first-plugin/.codex-plugin

51```

52 

53`my-first-plugin/.codex-plugin/plugin.json`

54 

55```json

56{

57 "name": "my-first-plugin",

58 "version": "1.0.0",

59 "description": "Reusable greeting workflow",

60 "skills": "./skills/"

61}

62```

63 

64Use a stable plugin `name` in kebab-case. Codex uses it as the plugin

65identifier and component namespace.

66 

672. Add a skill under `skills/<skill-name>/SKILL.md`.

68 

69```bash

70mkdir -p my-first-plugin/skills/hello

71```

72 

73`my-first-plugin/skills/hello/SKILL.md`

74 

75```md

76---

77name: hello

78description: Greet the user with a friendly message.

79---

80 

81Greet the user warmly and ask how you can help.

82```

83 

843. Add the plugin to a marketplace. Use `$plugin-creator` to generate one, or

85 follow [Build your own curated plugin list](#build-your-own-curated-plugin-list)

86 to wire the plugin into Codex manually.

87 

88From there, you can add MCP config, app integrations, or marketplace metadata

89as needed.

90 

91### Install a local plugin manually

92 

93Use a repo marketplace or a personal marketplace, depending on who should be

94able to access the plugin or curated list.

95 

96 Add a marketplace file at `$REPO_ROOT/.agents/plugins/marketplace.json`

97 and store your plugins under `$REPO_ROOT/plugins/`.

98 

99 **Repo marketplace example**

100 

101 Step 1: Copy the plugin folder into `$REPO_ROOT/plugins/my-plugin`.

102 

103```bash

104mkdir -p ./plugins

105cp -R /absolute/path/to/my-plugin ./plugins/my-plugin

106```

107 

108 Step 2: Add or update `$REPO_ROOT/.agents/plugins/marketplace.json` so

109 that `source.path` points to that plugin directory with a `./`-prefixed

110 relative path:

111 

112```json

113{

114 "name": "local-repo",

115 "plugins": [

116 {

117 "name": "my-plugin",

118 "source": {

119 "source": "local",

120 "path": "./plugins/my-plugin"

121 },

122 "policy": {

123 "installation": "AVAILABLE",

124 "authentication": "ON_INSTALL"

125 },

126 "category": "Productivity"

127 }

128 ]

129}

130```

131 

132 Step 3: Restart Codex and verify that the plugin appears.

133 

134 Add a marketplace file at `~/.agents/plugins/marketplace.json` and store

135 your plugins under `~/.codex/plugins/`.

136 

137 **Personal marketplace example**

138 

139 Step 1: Copy the plugin folder into `~/.codex/plugins/my-plugin`.

140 

141```bash

142mkdir -p ~/.codex/plugins

143cp -R /absolute/path/to/my-plugin ~/.codex/plugins/my-plugin

144```

145 

146 Step 2: Add or update `~/.agents/plugins/marketplace.json` so that the

147 plugin entry's `source.path` points to that directory.

148 

149 Step 3: Restart Codex and verify that the plugin appears.

150 

151The marketplace file points to the plugin location, so those directories are

152examples rather than fixed requirements. Codex resolves `source.path` relative

153to the marketplace root, not relative to the `.agents/plugins/` folder. See

154[Marketplace metadata](#marketplace-metadata) for the file format.

155 

156After you change the plugin, update the plugin directory that your marketplace

157entry points to and restart Codex so the local install picks up the new files.

158 

159### Marketplace metadata

160 

161If you maintain a repo marketplace, define it in

162`$REPO_ROOT/.agents/plugins/marketplace.json`. For a personal marketplace, use

163`~/.agents/plugins/marketplace.json`. A marketplace file controls plugin

164ordering and install policies in Codex-facing catalogs. It can represent one

165plugin while you are testing or a curated list of plugins that you want Codex

166to show together under one marketplace name. Before you add a plugin to a

167marketplace, make sure its `version`, publisher metadata, and install-surface

168copy are ready for other developers to see.

169 

170```json

171{

172 "name": "local-example-plugins",

173 "interface": {

174 "displayName": "Local Example Plugins"

175 },

176 "plugins": [

177 {

178 "name": "my-plugin",

179 "source": {

180 "source": "local",

181 "path": "./plugins/my-plugin"

182 },

183 "policy": {

184 "installation": "AVAILABLE",

185 "authentication": "ON_INSTALL"

186 },

187 "category": "Productivity"

188 },

189 {

190 "name": "research-helper",

191 "source": {

192 "source": "local",

193 "path": "./plugins/research-helper"

194 },

195 "policy": {

196 "installation": "AVAILABLE",

197 "authentication": "ON_INSTALL"

198 },

199 "category": "Productivity"

200 }

201 ]

202}

203```

204 

205- Use top-level `name` to identify the marketplace.

206- Use `interface.displayName` for the marketplace title shown in Codex.

207- Add one object per plugin under `plugins` to build a curated list that Codex

208 shows under that marketplace title.

209- Point each plugin entry's `source.path` at the plugin directory you want

210 Codex to load. For repo installs, that often lives under `./plugins/`. For

211 personal installs, a common pattern is `./.codex/plugins/<plugin-name>`.

212- Keep `source.path` relative to the marketplace root, start it with `./`, and

213 keep it inside that root.

214- Always include `policy.installation`, `policy.authentication`, and

215 `category` on each plugin entry.

216- Use `policy.installation` values such as `AVAILABLE`,

217 `INSTALLED_BY_DEFAULT`, or `NOT_AVAILABLE`.

218- Use `policy.authentication` to decide whether auth happens on install or

219 first use.

220 

221The marketplace controls where Codex loads the plugin from. `source.path` can

222point somewhere else if your plugin lives outside those example directories. A

223marketplace file can live in the repo where you are developing the plugin or in

224a separate marketplace repo, and one marketplace file can point to one plugin

225or many.

226 

227### How Codex uses marketplaces

228 

229A plugin marketplace is a JSON catalog of plugins that Codex can read and

230install.

231 

232Codex can read marketplace files from:

233 

234- the curated marketplace that powers the official Plugin Directory

235- a repo marketplace at `$REPO_ROOT/.agents/plugins/marketplace.json`

236- a personal marketplace at `~/.agents/plugins/marketplace.json`

237 

238You can install any plugin exposed through a marketplace. Codex installs

239plugins into

240`~/.codex/plugins/cache/$MARKETPLACE_NAME/$PLUGIN_NAME/$VERSION/`. For local

241plugins, `$VERSION` is `local`, and Codex loads the installed copy from that

242cache path rather than directly from the marketplace entry.

243 

244You can enable or disable each plugin individually. Codex stores each plugin's

245on or off state in `~/.codex/config.toml`.

246 

247## Package and distribute plugins

248 

249### Plugin structure

250 

251Every plugin has a manifest at `.codex-plugin/plugin.json`. It can also include

252a `skills/` directory, an `.app.json` file that points at one or more apps or

253connectors, and assets used to present the plugin across supported surfaces.

254 

255- my-plugin/

256 

257 - .codex-plugin/

258 

259 - plugin.json Required: plugin manifest

260 - skills/

261 

262 - my-skill/

263 

264 - SKILL.md Optional: skill instructions

265 - .app.json Optional: app or connector mappings

266 - .mcp.json Optional: MCP server configuration

267 - assets/ Optional: icons, logos, screenshots

268 

269Only `plugin.json` belongs in `.codex-plugin/`. Keep `skills/`, `assets/`,

270`.mcp.json`, and `.app.json` at the plugin root.

271 

272Published plugins typically use a richer manifest than the minimal example that

273appears in quick-start scaffolds. The manifest has three jobs:

274 

275- Identify the plugin.

276- Point to bundled components such as skills, apps, or MCP servers.

277- Provide install-surface metadata such as descriptions, icons, and legal

278 links.

279 

280Here's a complete manifest example:

281 

282```json

283{

284 "name": "my-plugin",

285 "version": "0.1.0",

286 "description": "Bundle reusable skills and app integrations.",

287 "author": {

288 "name": "Your team",

289 "email": "team@example.com",

290 "url": "https://example.com"

291 },

292 "homepage": "https://example.com/plugins/my-plugin",

293 "repository": "https://github.com/example/my-plugin",

294 "license": "MIT",

295 "keywords": ["research", "crm"],

296 "skills": "./skills/",

297 "mcpServers": "./.mcp.json",

298 "apps": "./.app.json",

299 "interface": {

300 "displayName": "My Plugin",

301 "shortDescription": "Reusable skills and apps",

302 "longDescription": "Distribute skills and app integrations together.",

303 "developerName": "Your team",

304 "category": "Productivity",

305 "capabilities": ["Read", "Write"],

306 "websiteURL": "https://example.com",

307 "privacyPolicyURL": "https://example.com/privacy",

308 "termsOfServiceURL": "https://example.com/terms",

309 "defaultPrompt": [

310 "Use My Plugin to summarize new CRM notes.",

311 "Use My Plugin to triage new customer follow-ups."

312 ],

313 "brandColor": "#10A37F",

314 "composerIcon": "./assets/icon.png",

315 "logo": "./assets/logo.png",

316 "screenshots": ["./assets/screenshot-1.png"]

317 }

318}

319```

320 

321`.codex-plugin/plugin.json` is the required entry point. The other manifest

322fields are optional, but published plugins commonly use them.

323 

324### Manifest fields

325 

326Use the top-level fields to define package metadata and point to bundled

327components:

328 

329- `name`, `version`, and `description` identify the plugin.

330- `author`, `homepage`, `repository`, `license`, and `keywords` provide

331 publisher and discovery metadata.

332- `skills`, `mcpServers`, and `apps` point to bundled components relative to

333 the plugin root.

334- `interface` controls how install surfaces present the plugin.

335 

336Use the `interface` object for install-surface metadata:

337 

338- `displayName`, `shortDescription`, and `longDescription` control the title

339 and descriptive copy.

340- `developerName`, `category`, and `capabilities` add publisher and capability

341 metadata.

342- `websiteURL`, `privacyPolicyURL`, and `termsOfServiceURL` provide external

343 links.

344- `defaultPrompt`, `brandColor`, `composerIcon`, `logo`, and `screenshots`

345 control starter prompts and visual presentation.

346 

347### Path rules

348 

349- Keep manifest paths relative to the plugin root and start them with `./`.

350- Store visual assets such as `composerIcon`, `logo`, and `screenshots` under

351 `./assets/` when possible.

352- Use `skills` for bundled skill folders, `apps` for `.app.json`, and

353 `mcpServers` for `.mcp.json`.

354 

355### Publish official public plugins

356 

357Adding plugins to the official Plugin Directory is coming soon.

358 

359Self-serve plugin publishing and management are coming soon.

prompting.md +1 −1

Details

31 31 

32Threads can run either locally or in the cloud:32Threads can run either locally or in the cloud:

33 33 

34- **Local threads** run on your machine. Codex can read and edit your files and run commands, so you can see what changes and use your existing tools. To reduce the risk of unwanted changes outside your workspace, local threads run in a [sandbox](https://developers.openai.com/codex/security).34- **Local threads** run on your machine. Codex can read and edit your files and run commands, so you can see what changes and use your existing tools. To reduce the risk of unwanted changes outside your workspace, local threads run in a [sandbox](https://developers.openai.com/codex/agent-approvals-security).

35- **Cloud threads** run in an isolated [environment](https://developers.openai.com/codex/cloud/environments). Codex clones your repository and checks out the branch it's working on. Cloud threads are useful when you want to run work in parallel or delegate tasks from another device. To use cloud threads with your repo, push your code to GitHub first. You can also [delegate tasks from your local machine](https://developers.openai.com/codex/ide/cloud-tasks), which includes your current working state.35- **Cloud threads** run in an isolated [environment](https://developers.openai.com/codex/cloud/environments). Codex clones your repository and checks out the branch it's working on. Cloud threads are useful when you want to run work in parallel or delegate tasks from another device. To use cloud threads with your repo, push your code to GitHub first. You can also [delegate tasks from your local machine](https://developers.openai.com/codex/ide/cloud-tasks), which includes your current working state.

36 36 

37## Context37## Context

quickstart.md +5 −2

Details

14 14 

151. Download and install the Codex app151. Download and install the Codex app

16 16 

17 The Codex app is currently only available for macOS.17 Download the Codex app for Windows or macOS.

18 18 

19 [Download for macOS](https://persistent.oaistatic.com/codex-app-prod/Codex.dmg)19 [Download for macOS](https://persistent.oaistatic.com/codex-app-prod/Codex.dmg)

20 20 

21 [Get notified for Windows and Linux](https://openai.com/form/codex-app/)21 [Get notified for Linux](https://openai.com/form/codex-app/)

222. Open Codex and sign in222. Open Codex and sign in

23 23 

24 Once you downloaded and installed the Codex app, open it and sign in with your ChatGPT account or an OpenAI API key.24 Once you downloaded and installed the Codex app, open it and sign in with your ChatGPT account or an OpenAI API key.


41- Find and fix bugs in my codebase with minimal, high-confidence changes.40- Find and fix bugs in my codebase with minimal, high-confidence changes.

42 41 

43 If you need more inspiration, check out the [explore section](https://developers.openai.com/codex/explore).42 If you need more inspiration, check out the [explore section](https://developers.openai.com/codex/explore).

43 If you’re new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).

44 44 

45 [Learn more about the Codex app](https://developers.openai.com/codex/app)45 [Learn more about the Codex app](https://developers.openai.com/codex/app)

46 46 


694. Use Git checkpoints694. Use Git checkpoints

70 70 

71 Codex can modify your codebase, so consider creating Git checkpoints before and after each task so you can easily revert changes if needed.71 Codex can modify your codebase, so consider creating Git checkpoints before and after each task so you can easily revert changes if needed.

72 If you’re new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).

72 73 

73 [Learn more about the Codex IDE extension](https://developers.openai.com/codex/ide)74 [Learn more about the Codex IDE extension](https://developers.openai.com/codex/ide)

74 75 


1004. Use Git checkpoints1014. Use Git checkpoints

101 102 

102 Codex can modify your codebase, so consider creating Git checkpoints before and after each task so you can easily revert changes if needed.103 Codex can modify your codebase, so consider creating Git checkpoints before and after each task so you can easily revert changes if needed.

104 If you’re new to Codex, read the [best practices guide](https://developers.openai.com/codex/learn/best-practices).

103 105 

104[Learn more about the Codex CLI](https://developers.openai.com/codex/cli)106[Learn more about the Codex CLI](https://developers.openai.com/codex/cli)

105 107 

rules.md +1 −1

Details

43carefully before accepting it.43carefully before accepting it.

44 44 

45Admins can also enforce restrictive `prefix_rule` entries from45Admins can also enforce restrictive `prefix_rule` entries from

46[`requirements.toml`](https://developers.openai.com/codex/security#admin-enforced-requirements-requirementstoml).46[`requirements.toml`](https://developers.openai.com/codex/enterprise/managed-configuration#admin-enforced-requirements-requirementstoml).

47 47 

48## Understand rule fields48## Understand rule fields

49 49 

security.md +22 −370

Details

1# Codex Security1# Codex Security

2 2 

3Codex helps protect your code and data and reduces the risk of misuse.3Codex Security helps engineering and security teams find, validate, and remediate likely vulnerabilities in connected GitHub repositories.

4 4 

5By default, the agent runs with network access turned off. Locally, Codex uses an OS-enforced sandbox that limits what it can touch (typically to the current workspace), plus an approval policy that controls when it must stop and ask you before acting.5This page covers Codex Security, the product that scans connected GitHub

6 repositories for likely security issues. For Codex sandboxing, approvals,

7 network controls, and admin settings, see [Agent approvals &

8 security](https://developers.openai.com/codex/agent-approvals-security).

6 9 

7## Sandbox and approvals10It helps teams:

8 11 

9Codex security controls come from two layers that work together:121. **Find likely vulnerabilities** by using a repo-specific threat model and real code context.

132. **Reduce noise** by validating findings before you review them.

143. **Move findings toward fixes** with ranked results, evidence, and suggested patch options.

10 15 

11- **Sandbox mode**: What Codex can do technically (for example, where it can write and whether it can reach the network) when it executes model-generated commands.16## How it works

12- **Approval policy**: When Codex must ask you before it executes an action (for example, leaving the sandbox, using the network, or running commands outside a trusted set).

13 17 

14Codex uses different sandbox modes depending on where you run it:18Codex Security scans connected repositories commit by commit.

19It builds scan context from your repo, checks likely vulnerabilities against that context, and validates high-signal issues in an isolated environment before surfacing them.

15 20 

16- **Codex cloud**: Runs in isolated OpenAI-managed containers, preventing access to your host system or unrelated data. You can expand access intentionally (for example, to install dependencies or allow specific domains) when needed. Network access is always enabled during the setup phase, which runs before the agent has access to your code.21You get a workflow focused on:

17- **Codex CLI / IDE extension**: OS-level mechanisms enforce sandbox policies. Defaults include no network access and write permissions limited to the active workspace. You can configure the sandbox, approval policy, and network settings based on your risk tolerance.

18 22 

19In the `Auto` preset (for example, `--full-auto`), Codex can read files, make edits, and run commands in the working directory automatically.23- repo-specific context instead of generic signatures

24- validation evidence that helps reduce false positives

25- suggested fixes you can review in GitHub

20 26 

21Codex asks for approval to edit files outside the workspace or to run commands that require network access. If you want to chat or plan without making changes, switch to `read-only` mode with the `/permissions` command.27## Access and prerequisites

22 28 

23Codex can also elicit approval for app (connector) tool calls that advertise side effects, even when the action isnt a shell command or file change.29Codex Security works with connected GitHub repositories through Codex Web. OpenAI manages access. If you need access or a repository isn't visible, contact your OpenAI account team and confirm the repository is available through your Codex Web workspace.

24 30 

25## Network access [Elevated Risk](https://help.openai.com/articles/20001061)31## Related docs

26 32 

27For Codex cloud, see [agent internet access](https://developers.openai.com/codex/cloud/internet-access) to enable full internet access or a domain allow list.33- [Codex Security setup](https://developers.openai.com/codex/security/setup) covers setup, scanning, and findings review.

28 34- [FAQ](https://developers.openai.com/codex/security/faq) covers common product questions.

29For the Codex app, CLI, or IDE Extension, the default `workspace-write` sandbox mode keeps network access turned off unless you enable it in your configuration:35- [Improving the threat model](https://developers.openai.com/codex/security/threat-model) explains how to tune scope, attack surface, and criticality assumptions.

30 

31```

32[sandbox_workspace_write]

33network_access = true

34```

35 

36You can also control the [web search tool](https://platform.openai.com/docs/guides/tools-web-search) without granting full network access to spawned commands. Codex defaults to using a web search cache to access results. The cache is an OpenAI-maintained index of web results, so cached mode returns pre-indexed results instead of fetching live pages. This reduces exposure to prompt injection from arbitrary live content, but you should still treat web results as untrusted. If you are using `--yolo` or another [full access sandbox setting](#common-sandbox-and-approval-combinations), web search defaults to live results. Use `--search` or set `web_search = "live"` to allow live browsing, or set it to `"disabled"` to turn the tool off:

37 

38```

39web_search = "cached" # default

40# web_search = "disabled"

41# web_search = "live" # same as --search

42```

43 

44Use caution when enabling network access or web search in Codex. Prompt injection can cause the agent to fetch and follow untrusted instructions.

45 

46## Defaults and recommendations

47 

48- On launch, Codex detects whether the folder is version-controlled and recommends:

49 - Version-controlled folders: `Auto` (workspace write + on-request approvals)

50 - Non-version-controlled folders: `read-only`

51- Depending on your setup, Codex may also start in `read-only` until you explicitly trust the working directory (for example, via an onboarding prompt or `/permissions`).

52- The workspace includes the current directory and temporary directories like `/tmp`. Use the `/status` command to see which directories are in the workspace.

53- To accept the defaults, run `codex`.

54- You can set these explicitly:

55 - `codex --sandbox workspace-write --ask-for-approval on-request`

56 - `codex --sandbox read-only --ask-for-approval on-request`

57 

58### Protected paths in writable roots

59 

60In the default `workspace-write` sandbox policy, writable roots still include protected paths:

61 

62- `<writable_root>/.git` is protected as read-only whether it appears as a directory or file.

63- If `<writable_root>/.git` is a pointer file (`gitdir: ...`), the resolved Git directory path is also protected as read-only.

64- `<writable_root>/.agents` is protected as read-only when it exists as a directory.

65- `<writable_root>/.codex` is protected as read-only when it exists as a directory.

66- Protection is recursive, so everything under those paths is read-only.

67 

68### Run without approval prompts

69 

70You can disable approval prompts with `--ask-for-approval never` or `-a never` (shorthand).

71 

72This option works with all `--sandbox` modes, so you still control Codex’s level of autonomy. Codex makes a best effort within the constraints you set.

73 

74If you need Codex to read files, make edits, and run commands with network access without approval prompts, use `--sandbox danger-full-access` (or the `--dangerously-bypass-approvals-and-sandbox` flag). Use caution before doing so.

75 

76### Common sandbox and approval combinations

77 

78| Intent | Flags | Effect |

79| --- | --- | --- |

80| Auto (preset) | *no flags needed* or `--full-auto` | Codex can read files, make edits, and run commands in the workspace. Codex requires approval to edit outside the workspace or to access network. |

81| Safe read-only browsing | `--sandbox read-only --ask-for-approval on-request` | Codex can read files and answer questions. Codex requires approval to make edits, run commands, or access network. |

82| Read-only non-interactive (CI) | `--sandbox read-only --ask-for-approval never` | Codex can only read files; never asks for approval. |

83| Automatically edit but ask for approval to run untrusted commands | `--sandbox workspace-write --ask-for-approval untrusted` | Codex can read and edit files but asks for approval before running untrusted commands. |

84| Dangerous full access | `--dangerously-bypass-approvals-and-sandbox` (alias: `--yolo`) | [Elevated Risk](https://help.openai.com/articles/20001061) No sandbox; no approvals *(not recommended)* |

85 

86`--full-auto` is a convenience alias for `--sandbox workspace-write --ask-for-approval on-request`.

87 

88With `--ask-for-approval untrusted`, Codex runs only known-safe read operations automatically. Commands that can mutate state or trigger external execution paths (for example, destructive Git operations or Git output/config-override flags) require approval.

89 

90#### Configuration in `config.toml`

91 

92```

93# Always ask for approval mode

94approval_policy = "untrusted"

95sandbox_mode = "read-only"

96 

97# Optional: Allow network in workspace-write mode

98[sandbox_workspace_write]

99network_access = true

100```

101 

102You can also save presets as profiles, then select them with `codex --profile <name>`:

103 

104```

105[profiles.full_auto]

106approval_policy = "on-request"

107sandbox_mode = "workspace-write"

108 

109[profiles.readonly_quiet]

110approval_policy = "never"

111sandbox_mode = "read-only"

112```

113 

114### Test the sandbox locally

115 

116To see what happens when a command runs under the Codex sandbox, use these Codex CLI commands:

117 

118```

119# macOS

120codex sandbox macos [--full-auto] [--log-denials] [COMMAND]...

121# Linux

122codex sandbox linux [--full-auto] [COMMAND]...

123```

124 

125The `sandbox` command is also available as `codex debug`, and the platform helpers have aliases (for example `codex sandbox seatbelt` and `codex sandbox landlock`).

126 

127## OS-level sandbox

128 

129Codex enforces the sandbox differently depending on your OS:

130 

131- **macOS** uses Seatbelt policies and runs commands using `sandbox-exec` with a profile (`-p`) that corresponds to the `--sandbox` mode you selected.

132- **Linux** uses `Landlock` plus `seccomp` by default. You can opt into the alternative Linux sandbox pipeline with `features.use_linux_sandbox_bwrap = true` (or `-c use_linux_sandbox_bwrap=true`).

133- **Windows** uses the Linux sandbox implementation when running in [Windows Subsystem for Linux (WSL)](https://developers.openai.com/codex/windows#windows-subsystem-for-linux). When running natively on Windows, you can enable an [experimental sandbox](https://developers.openai.com/codex/windows#windows-experimental-sandbox) implementation.

134 

135If you use the Codex IDE extension on Windows, it supports WSL directly. Set the following in your VS Code settings to keep the agent inside WSL whenever it’s available:

136 

137```

138{

139 "chatgpt.runCodexInWindowsSubsystemForLinux": true

140}

141```

142 

143This ensures the IDE extension inherits Linux sandbox semantics for commands, approvals, and filesystem access even when the host OS is Windows. Learn more in the [Windows setup guide](https://developers.openai.com/codex/windows).

144 

145The native Windows sandbox is experimental and has important limitations. For example, it can’t prevent writes in directories where the `Everyone` SID already has write permissions (for example, world-writable folders). See the [Windows setup guide](https://developers.openai.com/codex/windows#windows-experimental-sandbox) for details and mitigation steps.

146 

147When you run Linux in a containerized environment such as Docker, the sandbox may not work if the host or container configuration doesn’t support the required `Landlock` and `seccomp` features.

148 

149In that case, configure your Docker container to provide the isolation you need, then run `codex` with `--sandbox danger-full-access` (or the `--dangerously-bypass-approvals-and-sandbox` flag) inside the container.

150 

151## Version control

152 

153Codex works best with a version control workflow:

154 

155- Work on a feature branch and keep `git status` clean before delegating. This keeps Codex patches easier to isolate and revert.

156- Prefer patch-based workflows (for example, `git diff`/`git apply`) over editing tracked files directly. Commit frequently so you can roll back in small increments.

157- Treat Codex suggestions like any other PR: run targeted verification, review diffs, and document decisions in commit messages for auditing.

158 

159## Monitoring and telemetry

160 

161Codex supports opt-in monitoring via OpenTelemetry (OTel) to help teams audit usage, investigate issues, and meet compliance requirements without weakening local security defaults. Telemetry is off by default; enable it explicitly in your configuration.

162 

163### Overview

164 

165- Codex turns off OTel export by default to keep local runs self-contained.

166- When enabled, Codex emits structured log events covering conversations, API requests, SSE/WebSocket stream activity, user prompts (redacted by default), tool approval decisions, and tool results.

167- Codex tags exported events with `service.name` (originator), CLI version, and an environment label to separate dev/staging/prod traffic.

168 

169### Enable OTel (opt-in)

170 

171Add an `[otel]` block to your Codex configuration (typically `~/.codex/config.toml`), choosing an exporter and whether to log prompt text.

172 

173```

174[otel]

175environment = "staging" # dev | staging | prod

176exporter = "none" # none | otlp-http | otlp-grpc

177log_user_prompt = false # redact prompt text unless policy allows

178```

179 

180- `exporter = "none"` leaves instrumentation active but doesn’t send data anywhere.

181- To send events to your own collector, pick one of:

182 

183```

184[otel]

185exporter = { otlp-http = {

186 endpoint = "https://otel.example.com/v1/logs",

187 protocol = "binary",

188 headers = { "x-otlp-api-key" = "${OTLP_TOKEN}" }

189}}

190```

191 

192```

193[otel]

194exporter = { otlp-grpc = {

195 endpoint = "https://otel.example.com:4317",

196 headers = { "x-otlp-meta" = "abc123" }

197}}

198```

199 

200Codex batches events and flushes them on shutdown. Codex exports only telemetry produced by its OTel module.

201 

202### Event categories

203 

204Representative event types include:

205 

206- `codex.conversation_starts` (model, reasoning settings, sandbox/approval policy)

207- `codex.api_request` (attempt, status/success, duration, and error details)

208- `codex.sse_event` (stream event kind, success/failure, duration, plus token counts on `response.completed`)

209- `codex.websocket_request` and `codex.websocket_event` (request duration plus per-message kind/success/error)

210- `codex.user_prompt` (length; content redacted unless explicitly enabled)

211- `codex.tool_decision` (approved/denied, source: configuration vs. user)

212- `codex.tool_result` (duration, success, output snippet)

213 

214Associated OTel metrics (counter plus duration histogram pairs) include `codex.api_request`, `codex.sse_event`, `codex.websocket.request`, `codex.websocket.event`, and `codex.tool.call` (with corresponding `.duration_ms` instruments).

215 

216For the full event catalog and configuration reference, see the [Codex configuration documentation on GitHub](https://github.com/openai/codex/blob/main/docs/config.md#otel).

217 

218### Security and privacy guidance

219 

220- Keep `log_user_prompt = false` unless policy explicitly permits storing prompt contents. Prompts can include source code and sensitive data.

221- Route telemetry only to collectors you control; apply retention limits and access controls aligned with your compliance requirements.

222- Treat tool arguments and outputs as sensitive. Favor redaction at the collector or SIEM when possible.

223- Review local data retention settings (for example, `history.persistence` / `history.max_bytes`) if you don’t want Codex to save session transcripts under `CODEX_HOME`. See [Advanced Config](https://developers.openai.com/codex/config-advanced#history-persistence) and [Configuration Reference](https://developers.openai.com/codex/config-reference).

224- If you run the CLI with network access turned off, OTel export can’t reach your collector. To export, allow network access in `workspace-write` mode for the OTel endpoint, or export from Codex cloud with the collector domain on your approved list.

225- Review events periodically for approval/sandbox changes and unexpected tool executions.

226 

227OTel is optional and designed to complement, not replace, the sandbox and approval protections described above.

228 

229## Managed configuration

230 

231Enterprise admins can control local Codex behavior in two ways:

232 

233- **Requirements**: admin-enforced constraints that users can’t override.

234- **Managed defaults**: starting values applied when Codex launches. Users can still change settings during a session; Codex reapplies managed defaults the next time it starts.

235 

236### Admin-enforced requirements (requirements.toml)

237 

238Requirements constrain security-sensitive settings (approval policy, sandbox mode, web search mode, and optionally which MCP servers you can enable). If a user explicitly selects a disallowed value (via `config.toml`, CLI flags, profiles, or in-session UI), Codex rejects the change. If a value isn’t explicitly set and the default conflicts with requirements, Codex falls back to a requirements-compliant default. If you configure an `mcp_servers` approved list, Codex enables an MCP server only when both its name and identity match an approved entry; otherwise, Codex turns it off.

239 

240#### Locations

241 

242- Linux/macOS (Unix): `/etc/codex/requirements.toml`

243- macOS MDM: preference domain `com.openai.codex`, key `requirements_toml_base64`

244 

245#### Cloud requirements (Business and Enterprise)

246 

247When you sign in with ChatGPT on a Business or Enterprise plan, Codex can also

248fetch admin-enforced requirements from the Codex service. This applies across

249Codex surfaces, including the TUI, `codex exec`, and `codex app-server`.

250 

251Cloud requirements are currently best-effort. If the fetch fails or times out,

252Codex continues without the cloud layer.

253 

254Requirements layer in this order (higher wins):

255 

256- macOS managed preferences (MDM; highest precedence)

257- Cloud requirements (ChatGPT Business or Enterprise)

258- `/etc/codex/requirements.toml`

259 

260Cloud requirements only fill unset requirement fields, so higher-precedence

261managed layers still win when both specify the same constraint.

262 

263For backwards compatibility, Codex also interprets legacy `managed_config.toml` fields `approval_policy` and `sandbox_mode` as requirements (allowing only that single value).

264 

265#### Example requirements.toml

266 

267This example blocks `--ask-for-approval never` and `--sandbox danger-full-access` (including `--yolo`):

268 

269```

270allowed_approval_policies = ["untrusted", "on-request"]

271allowed_sandbox_modes = ["read-only", "workspace-write"]

272```

273 

274You can also constrain web search mode:

275 

276```

277allowed_web_search_modes = ["cached"] # "disabled" remains implicitly allowed

278```

279 

280`allowed_web_search_modes = []` effectively allows only `"disabled"`.

281For example, `allowed_web_search_modes = ["cached"]` prevents live web search even in `danger-full-access` sessions.

282 

283#### Enforce command rules from requirements

284 

285Admins can also enforce restrictive command rules from `requirements.toml`

286using a `[rules]` table. These rules merge with regular `.rules` files, and the

287most restrictive decision still wins.

288 

289Unlike `.rules`, requirements rules must specify `decision`, and that decision

290must be `"prompt"` or `"forbidden"` (not `"allow"`).

291 

292```

293[rules]

294prefix_rules = [

295 { pattern = [{ token = "rm" }], decision = "forbidden", justification = "Use git clean -fd instead." },

296 { pattern = [{ token = "git" }, { any_of = ["push", "commit"] }], decision = "prompt", justification = "Require review before mutating history." },

297]

298```

299 

300To restrict which MCP servers Codex can enable, add an `mcp_servers` approved list. For stdio servers, match on `command`; for streamable HTTP servers, match on `url`:

301 

302```

303[mcp_servers.docs]

304identity = { command = "codex-mcp" }

305 

306[mcp_servers.remote]

307identity = { url = "https://example.com/mcp" }

308```

309 

310If `mcp_servers` is present but empty, Codex disables all MCP servers.

311 

312### Managed defaults (managed\_config.toml)

313 

314Managed defaults merge on top of a user’s local `config.toml` and take precedence over any CLI `--config` overrides, setting the starting values when Codex launches. Users can still change those settings during a session; Codex reapplies managed defaults the next time it starts.

315 

316Make sure your managed defaults meet your requirements; Codex rejects disallowed values.

317 

318#### Precedence and layering

319 

320Codex assembles the effective configuration in this order (top overrides bottom):

321 

322- Managed preferences (macOS MDM; highest precedence)

323- `managed_config.toml` (system/managed file)

324- `config.toml` (user’s base configuration)

325 

326CLI `--config key=value` overrides apply to the base, but managed layers override them. This means each run starts from the managed defaults even if you provide local flags.

327 

328Cloud requirements affect the requirements layer (not managed defaults). See

329[Admin-enforced requirements](https://developers.openai.com/codex/security#admin-enforced-requirements-requirementstoml)

330for their precedence.

331 

332#### Locations

333 

334- Linux/macOS (Unix): `/etc/codex/managed_config.toml`

335- Windows/non-Unix: `~/.codex/managed_config.toml`

336 

337If the file is missing, Codex skips the managed layer.

338 

339#### macOS managed preferences (MDM)

340 

341On macOS, admins can push a device profile that provides base64-encoded TOML payloads at:

342 

343- Preference domain: `com.openai.codex`

344- Keys:

345 - `config_toml_base64` (managed defaults)

346 - `requirements_toml_base64` (requirements)

347 

348Codex parses these “managed preferences” payloads as TOML and applies them with the highest precedence.

349 

350### MDM setup workflow

351 

352Codex honors standard macOS MDM payloads, so you can distribute settings with tooling like `Jamf Pro`, `Fleet`, or `Kandji`. A lightweight deployment looks like:

353 

3541. Build the managed payload TOML and encode it with `base64` (no wrapping).

3552. Drop the string into your MDM profile under the `com.openai.codex` domain at `config_toml_base64` (managed defaults) or `requirements_toml_base64` (requirements).

3563. Push the profile, then ask users to restart Codex and confirm the startup config summary reflects the managed values.

3574. When revoking or changing policy, update the managed payload; the CLI reads the refreshed preference the next time it launches.

358 

359Avoid embedding secrets or high-churn dynamic values in the payload. Treat the managed TOML like any other MDM setting under change control.

360 

361### Example managed\_config.toml

362 

363```

364# Set conservative defaults

365approval_policy = "on-request"

366sandbox_mode = "workspace-write"

367 

368[sandbox_workspace_write]

369network_access = false # keep network disabled unless explicitly allowed

370 

371[otel]

372environment = "prod"

373exporter = "otlp-http" # point at your collector

374log_user_prompt = false # keep prompts redacted

375# exporter details live under exporter tables; see Monitoring and telemetry above

376```

377 

378### Recommended guardrails

379 

380- Prefer `workspace-write` with approvals for most users; reserve full access for controlled containers.

381- Keep `network_access = false` unless your security review allows a collector or domains required by your workflows.

382- Use managed configuration to pin OTel settings (exporter, environment), but keep `log_user_prompt = false` unless your policy explicitly allows storing prompt contents.

383- Periodically audit diffs between local `config.toml` and managed policy to catch drift; managed layers should win over local flags and files.

security/faq.md +104 −0 added

Details

1# FAQ

2 

3## Getting started

4 

5### What is Codex Security?

6 

7Software security remains one of the hardest and most important problems in engineering. Codex Security is an LLM-driven security analysis toolkit that inspects source code and returns structured, ranked vulnerability findings with proposed patches. It helps developers and security teams discover and fix security issues at scale.

8 

9### Why does it matter?

10 

11Software is foundational to modern industry and society, and vulnerabilities create systemic risk. Codex Security supports a defender-first workflow by continuously identifying likely issues, validating them when possible, and proposing fixes. That helps teams improve security without slowing development.

12 

13### What business problem does Codex Security solve?

14 

15Codex Security shortens the path from a suspected issue to a confirmed, reproducible finding with evidence and a proposed patch. That reduces triage load and cuts false positives compared with traditional scanners alone.

16 

17### How does Codex Security work?

18 

19Codex Security runs analysis in an ephemeral, isolated container and temporarily clones the target repository. It performs code-level analysis and returns structured findings with a description, file and location, criticality, root cause, and a suggested remediation.

20 

21For findings that include verification steps, the system executes proposed commands or tests in the same sandbox, records success or failure, exit codes, stdout, stderr, test results, and any generated diffs or artifacts, and attaches that output as evidence for review.

22 

23### Does it replace SAST?

24 

25No. Codex Security complements SAST. It adds semantic, LLM-based reasoning and automated validation, while existing SAST tools still provide broad deterministic coverage.

26 

27## Features

28 

29### What is the analysis pipeline?

30 

31Codex Security follows a staged pipeline:

32 

331. **Analysis** builds a threat model for the repository.

342. **Commit scanning** reviews merged commits and repository history for likely issues.

353. **Validation** tries to reproduce likely vulnerabilities in a sandbox to reduce false positives.

364. **Patching** integrates with Codex to propose patches that reviewers can inspect before opening a PR.

37 

38It works alongside engineers in GitHub, Codex, and standard review workflows.

39 

40### What languages are supported?

41 

42Codex Security is language-agnostic. In practice, performance depends on the model's reasoning ability for the language and framework used by the repository.

43 

44### What outputs do I get after the scan completes?

45 

46You get ranked findings with criticality, validation status, and a proposed patch when one is available. Findings can also include crash output, reproduction evidence, call-path context, and related annotations.

47 

48### How is customer code isolated?

49 

50Each analysis and validation job runs in an ephemeral Codex container with session-scoped tools. Artifacts are extracted for review, and the container is torn down after the job completes.

51 

52### Does Codex Security auto-apply patches?

53 

54No. The proposed patch is a recommended remediation. Users can review it and push it as a PR to GitHub from the findings UI, but Codex Security does not auto-apply changes to the repository.

55 

56### Does the project need to be built for scanning?

57 

58No. Codex Security can produce findings from repository and commit context without a compile step. During auto-validation, it may try to build the project inside the container if that helps reproduce the issue. For environment setup details, see [Codex cloud environments](https://developers.openai.com/codex/cloud/environments).

59 

60### How does Codex Security reduce false positives and avoid broken patches?

61 

62Codex Security uses two stages. First, the model ranks likely issues. Then auto-validation tries to reproduce each issue in a clean container. Findings that successfully reproduce are marked as validated, which helps reduce false positives before human review.

63 

64### How long do initial scans take, and what happens after that?

65 

66Initial scan time depends on repository size, build time, and how many findings proceed to validation. For some repositories, scans can take several hours. For larger repositories, they can take multiple days. Later scans are usually faster because they focus on new commits and incremental changes.

67 

68### What is a threat model?

69 

70A threat model is the scan-time security context for a repository. It combines a concise project overview with attack-surface details such as entry points, trust boundaries, auth assumptions, and risky components. For more detail, see [Improving the threat model](https://developers.openai.com/codex/security/threat-model).

71 

72### How is a threat model generated?

73 

74Codex Security prompts the model to summarize the repository architecture and security entry points, classify the repository type, run specialized extractors, and merge the results into a project overview or threat model artifact used throughout the scan.

75 

76### Does it replace manual security review?

77 

78No. Codex Security accelerates review and helps rank findings, but it does not replace code-level validation, exploitability checks, or human threat assessment.

79 

80### Can I edit the threat model?

81 

82Yes. Codex Security creates the initial threat model, and you can update it as the architecture, risks, and business context change. For the editing workflow, see [Improving the threat model](https://developers.openai.com/codex/security/threat-model).

83 

84### Do I need to configure a scan before using threat modeling?

85 

86Yes. Threat-model guidance is tied to how and what you scan, so you need to configure the repository first. See [Codex Security setup](https://developers.openai.com/codex/security/setup).

87 

88### What does the proposed patch contain?

89 

90The proposed patch contains a minimal actionable diff with filename and line context when a remediation can be generated for the finding.

91 

92### Does the patch directly modify my PR branch?

93 

94No. The workflow generates a diff, patch file, or suggested change for maintainers and reviewers to inspect before applying.

95 

96## Validation

97 

98### What is auto-validation?

99 

100Auto-validation is the phase that tries to reproduce a suspected issue in an isolated container. It records whether reproduction succeeded or failed and captures logs, commands, and related artifacts as evidence.

101 

102### What happens if validation fails?

103 

104The finding remains unvalidated. Logs and reports still capture what was attempted so engineers can retry, investigate further, or adjust the reproduction steps.

security/setup.md +97 −0 added

Details

1# Codex Security setup

2 

3This page walks you from initial access to reviewed findings and remediation pull requests in Codex Security.

4 

5Confirm you've set up Codex Cloud first. If not, see [Codex

6 Cloud](https://developers.openai.com/codex/cloud) to get started.

7 

8## 1. Access and environment

9 

10Codex Security scans GitHub repositories connected through [Codex Cloud](https://developers.openai.com/codex/cloud).

11 

12- Confirm your workspace has access to Codex Security.

13- Confirm the repository you want to scan is available in Codex Cloud.

14 

15Go to [Codex environments](https://chatgpt.com/codex/settings/environments) and check whether the repository already has an environment. If it doesn't, create one there before continuing.

16 

17[Open environments](https://chatgpt.com/codex/settings/environments)

18 

19![Codex environments](/_astro/create_environment.M-EPszPH.png)

20 

21## 2. New security scan

22 

23After the environment exists, go to [Create a security scan](https://chatgpt.com/codex/security/scans/new) and choose the repository you just connected.

24 

25[Create a security scan](https://chatgpt.com/codex/security/scans/new)

26 

27Codex Security scans repositories from newest commits backward first. It uses this to build and refresh scan context as new commits come in.

28 

29To configure a repository:

30 

311. Select the GitHub organization.

322. Select the repository.

333. Select the branch you want to scan.

344. Select the environment.

355. Choose a **history window**. Longer windows provide more context, but backfill takes longer.

366. Click **Create**.

37 

38![Create a security scan](/_astro/create_scan.mEjmf4U_.png)

39 

40## 3. Initial scans can take a while

41 

42When you create the scan, Codex Security first runs a commit-level security pass across the selected history window.

43The initial backfill can take a few hours, especially for larger repositories or longer windows.

44If findings aren't visible right away, this is expected. Wait for the initial scan to finish before opening a ticket or troubleshooting.

45 

46Initial scan setup is automatic and thorough. This can take a few hours. Don’t

47 be alarmed if the first set of findings is delayed.

48 

49## 4. Review scans and improve the threat model

50 

51[Review scans](https://chatgpt.com/codex/security/scans)

52 

53![Threat model editor in Codex Security](/_astro/review_threat_model.JTLMQEmx.png)

54 

55When the initial scan finishes, open the scan and review the threat model that was generated.

56After initial findings appear, update the threat model so it matches your architecture, trust boundaries, and business context.

57This helps Codex Security rank issues for your team.

58 

59If you want scan results to change, you can edit the threat model with your

60 updated scope, priorities, and assumptions.

61 

62After initial findings appear, revisit the model so scan guidance stays aligned with current priorities.

63Keeping it current helps Codex Security produce better suggestions.

64 

65For a deeper explanation of threat models and how they affect criticality and triage, see [Improving the threat model](https://developers.openai.com/codex/security/threat-model).

66 

67## 5. Review findings and patch

68 

69After the initial backfill completes, review findings from the **Findings** view.

70 

71[Open findings](https://chatgpt.com/codex/security/findings)

72 

73You can use two views:

74 

75- **Recommended Findings**: an evolving top 10 list of the most critical issues in the repo

76- **All Findings**: a sortable, filterable table of findings across the repository

77 

78![Recommended findings view](https://developers.openai.com/codex/security/images/aardvark_recommended_findings.png)

79 

80Click a finding to open its detail page, which includes:

81 

82- a concise description of the issue

83- key metadata such as commit details and file paths

84- contextual reasoning about impact

85- relevant code excerpts

86- call-path or data-flow context when available

87- validation steps and validation output

88 

89You can review each finding and create a PR directly from the finding detail page.

90 

91[Review findings and create a PR](https://chatgpt.com/codex/security/findings)

92 

93## Related docs

94 

95- [Codex Security](https://developers.openai.com/codex/security) gives the product overview.

96- [FAQ](https://developers.openai.com/codex/security/faq) covers common questions.

97- [Improving the threat model](https://developers.openai.com/codex/security/threat-model) explains how to improve scan context and finding prioritization.

security/threat-model.md +40 −0 added

Details

1# Improving the threat model

2 

3Learn what a threat model is and how editing it improves Codex Security's suggestions.

4 

5## What a threat model is

6 

7A threat model is a short security summary of how your repository works. In Codex Security, you edit it as a `project overview`, and the system uses it as scan context for future scans, prioritization, and review.

8 

9Codex Security creates the first draft from the code. If the findings feel off, this is the first thing to edit.

10 

11A useful threat model calls out:

12 

13- entry points and untrusted inputs

14- trust boundaries and auth assumptions

15- sensitive data paths or privileged actions

16- the areas your team wants reviewed first

17 

18For example:

19 

20> Public API for account changes. Accepts JSON requests and file uploads. Uses an internal auth service for identity checks and writes billing changes through an internal service. Focus review on auth checks, upload parsing, and service-to-service trust boundaries.

21 

22That gives Codex Security a better starting point for future scans and finding prioritization.

23 

24## Improving and revisiting the threat model

25 

26If you want to improve the results, edit the threat model first. Use it when findings are missing the areas you care about or showing up in places you don't expect. The threat model changes future scan context.

27 

28Some users copy the current threat model into Codex, have a conversation to

29 improve it based on the areas they want reviewed more closely, and then paste

30 the updated version back into the web UI.

31 

32### Where to edit

33 

34To review or update the threat model, go to [Codex Security scans](https://chatgpt.com/codex/security/scans), open the repository, and click **Edit**.

35 

36## Related docs

37 

38- [Codex Security setup](https://developers.openai.com/codex/security/setup) covers repository setup and findings review.

39- [Codex Security](https://developers.openai.com/codex/security) gives the product overview.

40- [FAQ](https://developers.openai.com/codex/security/faq) covers common questions.

skills.md +27 −5

Details

1# Agent Skills1# Agent Skills

2 2 

3Use agent skills to extend Codex with task-specific capabilities. A skill packages instructions, resources, and optional scripts so Codex can follow a workflow reliably. You can share skills across teams or with the community. Skills build on the [open agent skills standard](https://agentskills.io).3Use agent skills to extend Codex with task-specific capabilities. A skill packages instructions, resources, and optional scripts so Codex can follow a workflow reliably. Skills build on the [open agent skills standard](https://agentskills.io).

4 

5Skills are the authoring format for reusable workflows. Plugins are the installable distribution unit for reusable skills and apps in Codex. Use skills to design the workflow itself, then package it as a [plugin](https://developers.openai.com/codex/plugins/build) when you want other developers to install it.

4 6 

5Skills are available in the Codex CLI, IDE extension, and Codex app.7Skills are available in the Codex CLI, IDE extension, and Codex app.

6 8 


65 67 

66Codex supports symlinked skill folders and follows the symlink target when scanning these locations.68Codex supports symlinked skill folders and follows the symlink target when scanning these locations.

67 69 

68## Install skills70These locations are for authoring and local discovery. When you want to

71distribute reusable skills beyond a single repo, or optionally bundle them with

72app integrations, use [plugins](https://developers.openai.com/codex/plugins/build).

73 

74## Distribute skills with plugins

75 

76Direct skill folders are best for local authoring and repo-scoped workflows. If

77you want to distribute a reusable skill, bundle two or more skills together, or

78ship a skill alongside an app integration, package them as a

79[plugin](https://developers.openai.com/codex/plugins/build).

69 80 

70To install skills beyond the built-ins, use `$skill-installer`:81Plugins can include one or more skills. They can also optionally bundle app

82mappings, MCP server configuration, and presentation assets in a single

83package.

84 

85## Install curated skills for local use

86 

87To add curated skills beyond the built-ins for your own local Codex setup, use `$skill-installer`. For example, to install the `$linear` skill:

71 88 

72```bash89```bash

73$skill-installer install the linear skill from the .experimental folder90$skill-installer linear

74```91```

75 92 

76You can also prompt the installer to download skills from other repositories. Codex detects newly installed skills automatically; if one doesn’t appear, restart Codex.93You can also prompt the installer to download skills from other repositories.

94Codex detects newly installed skills automatically; if one doesn't appear,

95restart Codex.

96 

97Use this for local setup and experimentation. For reusable distribution of your

98own skills, prefer plugins.

77 99 

78## Enable or disable skills100## Enable or disable skills

79 101 

speed.md +26 −0 added

Details

1# Speed

2 

3## Fast mode

4 

5Codex offers the ability to increase the speed of the model for increased

6credit consumption.

7 

8Fast mode is currently supported on GPT-5.4. When enabled, speed is increased

9by 1.5x and credits are consumed at a 2x rate.

10 

11Use `/fast on`, `/fast off`, or `/fast status` in the CLI to change or inspect

12the current setting. You can also persist the default with `service_tier = "fast"` plus `[features].fast_mode = true` in `config.toml`. Fast mode is

13available in the Codex IDE extension, Codex CLI, and the Codex app when you

14sign in with ChatGPT. With an API key, Codex uses standard API pricing instead

15and you can't use Fast mode credits.

16 

17[

18Your browser does not support the video tag.

19](/videos/codex/fast-mode-demo.mp4)

20 

21## Codex-Spark

22 

23GPT-5.3-Codex-Spark is a separate fast, less-capable Codex model optimized for near-instant, real-time coding iteration. Unlike fast mode, which speeds up GPT-5.4 at a higher credit rate,

24Codex-Spark is its own model choice and has its own usage limits.

25 

26During research preview Codex-Spark is only available for ChatGPT Pro subscribers.

subagents.md +340 −0 added

Details

1# Subagents

2 

3Codex can run subagent workflows by spawning specialized agents in parallel and then collecting their results in one response. This can be particularly helpful for complex tasks that are highly parallel, such as codebase exploration or implementing a multi-step feature plan.

4 

5With subagent workflows, you can also define your own custom agents with different model configurations and instructions depending on the task.

6 

7For the concepts and tradeoffs behind subagent workflows, including context pollution, context rot, and model-selection guidance, see [Subagent concepts](https://developers.openai.com/codex/concepts/subagents).

8 

9## Availability

10 

11Current Codex releases enable subagent workflows by default.

12 

13Subagent activity is currently surfaced in the Codex app and CLI. Visibility

14 in the IDE Extension is coming soon.

15 

16Codex only spawns subagents when you explicitly ask it to. Because each

17subagent does its own model and tool work, subagent workflows consume more

18tokens than comparable single-agent runs.

19 

20## Typical workflow

21 

22Codex handles orchestration across agents, including spawning new subagents,

23routing follow-up instructions, waiting for results, and closing agent

24threads.

25 

26When many agents are running, Codex waits until all requested results are

27available, then returns a consolidated response.

28 

29Codex only spawns a new agent when you explicitly ask it to do so.

30 

31To see it in action, try the following prompt on your project:

32 

33```text

34I would like to review the following points on the current PR (this branch vs main). Spawn one agent per point, wait for all of them, and summarize the result for each point.

351. Security issue

362. Code quality

373. Bugs

384. Race

395. Test flakiness

406. Maintainability of the code

41```

42 

43## Managing subagents

44 

45- Use `/agent` in the CLI to switch between active agent threads and inspect the ongoing thread.

46- Ask Codex directly to steer a running subagent, stop it, or close completed agent threads.

47 

48## Approvals and sandbox controls

49 

50Subagents inherit your current sandbox policy.

51 

52In interactive CLI sessions, approval requests can surface from inactive agent

53threads even while you are looking at the main thread. The approval overlay

54shows the source thread label, and you can press `o` to open that thread before

55you approve, reject, or answer the request.

56 

57In non-interactive flows, or whenever a run can't surface a fresh approval, an

58action that needs new approval fails and Codex surfaces the error back to the

59parent workflow.

60 

61Codex also reapplies the parent turn's live runtime overrides when it spawns a

62child. That includes sandbox and approval choices you set interactively during

63the session, such as `/approvals` changes or `--yolo`, even if the selected

64custom agent file sets different defaults.

65 

66You can also override the sandbox configuration for individual [custom agents](#custom-agents), such as explicitly marking one to work in read-only mode.

67 

68## Custom agents

69 

70Codex ships with built-in agents:

71 

72- `default`: general-purpose fallback agent.

73- `worker`: execution-focused agent for implementation and fixes.

74- `explorer`: read-heavy codebase exploration agent.

75 

76To define your own custom agents, add standalone TOML files under

77`~/.codex/agents/` for personal agents or `.codex/agents/` for project-scoped

78agents.

79 

80Each file defines one custom agent. Codex loads these files as configuration

81layers for spawned sessions, so custom agents can override the same settings as

82a normal Codex session config. That can feel heavier than a dedicated agent

83manifest, and the format may evolve as authoring and sharing mature.

84 

85Every standalone custom agent file must define:

86 

87- `name`

88- `description`

89- `developer_instructions`

90 

91Optional fields such as `nickname_candidates`, `model`,

92`model_reasoning_effort`, `sandbox_mode`, `mcp_servers`, and `skills.config`

93inherit from the parent session when you omit them.

94 

95### Global settings

96 

97Global subagent settings still live under `[agents]` in your [configuration](https://developers.openai.com/codex/config-basic#configuration-precedence).

98 

99| Field | Type | Required | Purpose |

100| --- | --- | --- | --- |

101| `agents.max_threads` | number | No | Concurrent open agent thread cap. |

102| `agents.max_depth` | number | No | Spawned agent nesting depth (root session starts at 0). |

103| `agents.job_max_runtime_seconds` | number | No | Default timeout per worker for `spawn_agents_on_csv` jobs. |

104 

105**Notes:**

106 

107- `agents.max_threads` defaults to `6` when you leave it unset.

108- `agents.max_depth` defaults to `1`, which allows a direct child agent to spawn but prevents deeper nesting. Keep the default unless you specifically need recursive delegation. Raising this value can turn broad delegation instructions into repeated fan-out, which increases token usage, latency, and local resource consumption. `agents.max_threads` still caps concurrent open threads, but it doesn't remove the cost and predictability risks of deeper recursion.

109- `agents.job_max_runtime_seconds` is optional. When you leave it unset, `spawn_agents_on_csv` falls back to its per-call default timeout of 1800 seconds per worker.

110- If a custom agent name matches a built-in agent such as `explorer`, your custom agent takes precedence.

111 

112### Custom agent file schema

113 

114| Field | Type | Required | Purpose |

115| --- | --- | --- | --- |

116| `name` | string | Yes | Agent name Codex uses when spawning or referring to this agent. |

117| `description` | string | Yes | Human-facing guidance for when Codex should use this agent. |

118| `developer_instructions` | string | Yes | Core instructions that define the agent's behavior. |

119| `nickname_candidates` | string[] | No | Optional pool of display nicknames for spawned agents. |

120 

121You can also include other supported `config.toml` keys in a custom agent file, such as `model`, `model_reasoning_effort`, `sandbox_mode`, `mcp_servers`, and `skills.config`.

122 

123Codex identifies the custom agent by its `name` field. Matching the filename to

124the agent name is the simplest convention, but the `name` field is the source

125of truth.

126 

127### Display nicknames

128 

129Use `nickname_candidates` when you want Codex to assign more readable display

130names to spawned agents. This is especially helpful when you run many

131instances of the same custom agent and want the UI to show distinct labels

132instead of repeating the same agent name.

133 

134Nicknames are presentation-only. Codex still identifies and spawns the agent by

135its `name`.

136 

137Nickname candidates must be a non-empty list of unique names. Each nickname can

138use ASCII letters, digits, spaces, hyphens, and underscores.

139 

140Example:

141 

142```toml

143name = "reviewer"

144description = "PR reviewer focused on correctness, security, and missing tests."

145developer_instructions = """

146Review code like an owner.

147Prioritize correctness, security, behavior regressions, and missing test coverage.

148"""

149nickname_candidates = ["Atlas", "Delta", "Echo"]

150```

151 

152In practice, the Codex app and CLI can show the nicknames where agent activity

153appears, while the underlying agent type stays

154`reviewer`.

155 

156### Example custom agents

157 

158The best custom agents are narrow and opinionated. Give each one clear job, a

159tool surface that matches that job, and instructions that keep it from

160drifting into adjacent work.

161 

162#### Example 1: PR review

163 

164This pattern splits review across three focused custom agents:

165 

166- `pr_explorer` maps the codebase and gathers evidence.

167- `reviewer` looks for correctness, security, and test risks.

168- `docs_researcher` checks framework or API documentation through a dedicated MCP server.

169 

170Project config (`.codex/config.toml`):

171 

172```toml

173[agents]

174max_threads = 6

175max_depth = 1

176```

177 

178`.codex/agents/pr-explorer.toml`:

179 

180```toml

181name = "pr_explorer"

182description = "Read-only codebase explorer for gathering evidence before changes are proposed."

183model = "gpt-5.3-codex-spark"

184model_reasoning_effort = "medium"

185sandbox_mode = "read-only"

186developer_instructions = """

187Stay in exploration mode.

188Trace the real execution path, cite files and symbols, and avoid proposing fixes unless the parent agent asks for them.

189Prefer fast search and targeted file reads over broad scans.

190"""

191```

192 

193`.codex/agents/reviewer.toml`:

194 

195```toml

196name = "reviewer"

197description = "PR reviewer focused on correctness, security, and missing tests."

198model = "gpt-5.4"

199model_reasoning_effort = "high"

200sandbox_mode = "read-only"

201developer_instructions = """

202Review code like an owner.

203Prioritize correctness, security, behavior regressions, and missing test coverage.

204Lead with concrete findings, include reproduction steps when possible, and avoid style-only comments unless they hide a real bug.

205"""

206```

207 

208`.codex/agents/docs-researcher.toml`:

209 

210```toml

211name = "docs_researcher"

212description = "Documentation specialist that uses the docs MCP server to verify APIs and framework behavior."

213model = "gpt-5.4-mini"

214model_reasoning_effort = "medium"

215sandbox_mode = "read-only"

216developer_instructions = """

217Use the docs MCP server to confirm APIs, options, and version-specific behavior.

218Return concise answers with links or exact references when available.

219Do not make code changes.

220"""

221 

222[mcp_servers.openaiDeveloperDocs]

223url = "https://developers.openai.com/mcp"

224```

225 

226This setup works well for prompts like:

227 

228```text

229Review this branch against main. Have pr_explorer map the affected code paths, reviewer find real risks, and docs_researcher verify the framework APIs that the patch relies on.

230```

231 

232## Process CSV batches with subagents (experimental)

233 

234This workflow is experimental and may change as subagent support evolves.

235Use `spawn_agents_on_csv` when you have many similar tasks that map to one row per work item. Codex reads the CSV, spawns one worker subagent per row, waits for the full batch to finish, and exports the combined results to CSV.

236 

237This works well for repeated audits such as:

238 

239- reviewing one file, package, or service per row

240- checking a list of incidents, PRs, or migration targets

241- generating structured summaries for many similar inputs

242 

243The tool accepts:

244 

245- `csv_path` for the source CSV

246- `instruction` for the worker prompt template, using `{column_name}` placeholders

247- `id_column` when you want stable item ids from a specific column

248- `output_schema` when each worker should return a JSON object with a fixed shape

249- `output_csv_path`, `max_concurrency`, and `max_runtime_seconds` for job control

250 

251Each worker must call `report_agent_job_result` exactly once. If a worker exits without reporting a result, Codex marks that row with an error in the exported CSV.

252 

253Example prompt:

254 

255```text

256Create /tmp/components.csv with columns path,owner and one row per frontend component.

257 

258Then call spawn_agents_on_csv with:

259- csv_path: /tmp/components.csv

260- id_column: path

261- instruction: "Review {path} owned by {owner}. Return JSON with keys path, risk, summary, and follow_up via report_agent_job_result."

262- output_csv_path: /tmp/components-review.csv

263- output_schema: an object with required string fields path, risk, summary, and follow_up

264```

265 

266When you run this through `codex exec`, Codex shows a single-line progress update on `stderr` while the batch is running. The exported CSV includes the original row data plus metadata such as `job_id`, `item_id`, `status`, `last_error`, and `result_json`.

267 

268Related runtime settings:

269 

270- `agents.max_threads` caps how many agent threads can stay open concurrently.

271- `agents.job_max_runtime_seconds` sets the default per-worker timeout for CSV fan-out jobs. A per-call `max_runtime_seconds` override takes precedence.

272- `sqlite_home` controls where Codex stores the SQLite-backed state used for agent jobs and their exported results.

273 

274#### Example 2: Frontend integration debugging

275 

276This pattern is useful for UI regressions, flaky browser flows, or integration bugs that cross application code and the running product.

277 

278Project config (`.codex/config.toml`):

279 

280```toml

281[agents]

282max_threads = 6

283max_depth = 1

284```

285 

286`.codex/agents/code-mapper.toml`:

287 

288```toml

289name = "code_mapper"

290description = "Read-only codebase explorer for locating the relevant frontend and backend code paths."

291model = "gpt-5.4-mini"

292model_reasoning_effort = "medium"

293sandbox_mode = "read-only"

294developer_instructions = """

295Map the code that owns the failing UI flow.

296Identify entry points, state transitions, and likely files before the worker starts editing.

297"""

298```

299 

300`.codex/agents/browser-debugger.toml`:

301 

302```toml

303name = "browser_debugger"

304description = "UI debugger that uses browser tooling to reproduce issues and capture evidence."

305model = "gpt-5.4"

306model_reasoning_effort = "high"

307sandbox_mode = "workspace-write"

308developer_instructions = """

309Reproduce the issue in the browser, capture exact steps, and report what the UI actually does.

310Use browser tooling for screenshots, console output, and network evidence.

311Do not edit application code.

312"""

313 

314[mcp_servers.chrome_devtools]

315url = "http://localhost:3000/mcp"

316startup_timeout_sec = 20

317```

318 

319`.codex/agents/ui-fixer.toml`:

320 

321```toml

322name = "ui_fixer"

323description = "Implementation-focused agent for small, targeted fixes after the issue is understood."

324model = "gpt-5.3-codex-spark"

325model_reasoning_effort = "medium"

326developer_instructions = """

327Own the fix once the issue is reproduced.

328Make the smallest defensible change, keep unrelated files untouched, and validate only the behavior you changed.

329"""

330 

331[[skills.config]]

332path = "/Users/me/.agents/skills/docs-editor/SKILL.md"

333enabled = false

334```

335 

336This setup works well for prompts like:

337 

338```text

339Investigate why the settings modal fails to save. Have browser_debugger reproduce it, code_mapper trace the responsible code path, and ui_fixer implement the smallest fix once the failure mode is clear.

340```

Details

1# Upgrade your API integration | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Use Codex to update your existing OpenAI API integration to the latest recommended models and API features, while checking for regressions before you ship.

6 

7Intermediate

8 

91h

10 

11Related links

12 

13[Latest model guide](https://developers.openai.com/api/docs/guides/latest-model) [Prompt guidance](https://developers.openai.com/api/docs/guides/prompt-guidance) [OpenAI Docs MCP](/learn/docs-mcp) [Evals guide](https://developers.openai.com/api/docs/guides/evals)

14 

15## Best for

16 

17 - Teams upgrading from older models or API surfaces

18 - Repos that need behavior-preserving migrations with explicit validation

19 

20## Skills & Plugins

21 

22- [OpenAI Docs](https://github.com/openai/skills/tree/main/skills/.curated/openai-docs)

23 

24 Pull the current model, migration, and API guidance before Codex makes edits to your implementation.

25 

26## Starter prompt

27 

28Use $openai-docs to upgrade this OpenAI integration to the latest recommended model and API features.

29Specifically, look for the latest model and prompt guidance for this specific model.

30 Requirements:

31- Start by inventorying the current models, endpoints, and tool assumptions in the repo.

32- Identify the smallest migration plan that gets us onto the latest supported path.

33 - Preserve behavior unless a change is required by the new API or model.

34 - Update prompts using the latest model prompt guidance.

35- Call out any prompt, tool, or response-shape changes we need to review manually.

36 

37## Introduction

38 

39As we release new models and API features, we recommend upgrading your integration to benefit from the latest improvements.

40Changing from one model to another is often not as simple as just updating the model name.

41 

42There might be changes to the API–for example, for the GPT-5.4 model, we added a new `phase` parameter to the assistant message that is important to include in your integration–but most importantly, model behavior can be different and require changes to your existing prompts.

43 

44When migrating to a new model, you should make sure to not only make the necessary code changes, but also evaluate the impact on your workflows.

45 

46## Leverage the OpenAI Docs skill

47 

48All the specifics about the new API features and model behavior are documented in our docs, in the [latest model](https://developers.openai.com/api/docs/guides/latest-model) and [prompt guidance](https://developers.openai.com/api/docs/guides/prompt-guidance) guides.

49 

50The OpenAI Docs skill also includes [specific guidance](https://github.com/openai/codex/blob/6323f0104d17d211029faab149231ba787f7da37/codex-rs/skills/src/assets/samples/openai-docs/references/upgrading-to-gpt-5p4.md) as reference, codifying how to upgrade to the latest model–currently [GPT-5.4](https://developers.openai.com/api/docs/models/gpt-5.4).

51 

52Codex now automatically comes with the OpenAI Docs skill, so make sure to mention it in your prompt to access all the latest documentation and guidance when building with the OpenAI API.

53 

54## Build a robust evals pipeline

55 

56Codex can automatically update your prompts based on the latest prompt guidance, but you should have a way to automate verifying your integration is working as expected.

57 

58Make sure to build an evals pipeline that you can run every time you make changes to your integration, to verify there is no regression in behavior.

59 

60This [cookbook guide](https://developers.openai.com/cookbook/examples/evaluation/building_resilient_prompts_using_an_evaluation_flywheel) covers in detail how to do this using our [Evals API](https://developers.openai.com/api/docs/guides/evals).

61 

62## Related use cases

63 

64[![](/images/codex/codex-wallpaper-1.webp)

65 

66### Create browser-based games

67 

68Use Codex to turn a game brief into first a well-defined plan, and then a real browser-based...

69 

70Engineering Code](https://developers.openai.com/codex/use-cases/browser-games)[![](/images/codex/codex-wallpaper-1.webp)

71 

72### Bring your app to ChatGPT

73 

74Build one narrow ChatGPT app outcome end to end: define the tools, scaffold the MCP server...

75 

76Integrations Code](https://developers.openai.com/codex/use-cases/chatgpt-apps)[![](/images/codex/codex-wallpaper-3.webp)

77 

78### Build for iOS and macOS

79 

80Use Codex to scaffold SwiftUI projects, keep the build loop CLI-first with `xcodebuild` or...

81 

82Mobile Code](https://developers.openai.com/codex/use-cases/native-ios-macos-apps)

Details

1# Create browser-based games | Codex use cases

2 

3Need

4 

5Backend stack

6 

7Default options

8 

9[Fastify](https://fastify.dev/) , WebSockets, [Postgres](https://www.postgresql.org/) , and [Redis](https://redis.io/)

10 

11Why it's needed

12 

13A strong default when the game needs persistence, matchmaking, leaderboards, or pub/sub.

use-cases/chatgpt-apps.md +13 −0 added

Details

1# Bring your app to ChatGPT | Codex use cases

2 

3Need

4 

5Widget framework

6 

7Default options

8 

9[React](https://react.dev/)

10 

11Why it's needed

12 

13A strong default for stateful widgets, especially when the UI needs filters, tables, or multi-step interaction.

Details

1# Understand large codebases | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Use Codex to map unfamiliar codebases, explain different modules and data flow, and point you to the next files worth reading before you edit.

6 

7Easy

8 

95m

10 

11Related links

12 

13[Codex app](https://developers.openai.com/codex/app)

14 

15## Best for

16 

17 - New engineers onboarding to a new repo or service

18 - Anyone trying to understand how a feature works before changing it

19 

20## Starter prompt

21 

22Explain how the request flows through <name of the system area> in the codebase.

23 Include:

24 - which modules own what

25 - where data is validated

26 - the top gotchas to watch for before making changes

27 End with the files I should read next.

28 

29## Introduction

30 

31When you are new to a repo or dropped into an unfamiliar feature, Codex can help you get oriented before you start changing code. The goal is not just to get a high-level summary, but to map the request flow, understand which modules own what, and identify the next files worth reading.

32 

33## How to use

34 

35If you're new to a project, you can simply start by asking Codex to explain the whole codebase:

36 

37Explain this repo to me

38 

39If you need to contribute a new feature to an existing codebase, you can ask codex to explain a specific system area. The better you scope the request, the more concrete the explanation will be:

40 

411. Give Codex the relevant files, directories, or feature area you are trying to understand.

422. Ask it to trace the request flow and explain which modules own the business logic, transport, persistence, or UI.

433. Ask where validation, side effects, or state transitions happen before you edit anything.

444. End by asking which files you should read next and what the risky spots are.

45 

46A useful onboarding answer should leave you with a concrete map, not just a list of filenames. By the end, Codex should have explained the main flow, highlighted the risky parts, and pointed you to the next files or checks that matter before you start editing.

47 

48## Questions to ask next

49 

50Once Codex gives you a first pass, keep going until the explanation is specific enough that you would trust yourself to make the first edit. Good follow-up questions usually force it to call out assumptions, hidden dependencies, and the checks that matter after a change.

51 

52- Which module owns the actual business logic versus the transport or UI layer?

53- Where does validation happen, and what assumptions are enforced there?

54- What related files or background jobs are easy to miss if I change this flow?

55- Which tests or checks should I run after editing this area?

56 

57## Related use cases

58 

59[![](/images/codex/codex-wallpaper-3.webp)

60 

61### Iterate on difficult problems

62 

63Give Codex an evaluation system, such as scripts and reviewable artifacts, so it can keep...

64 

65Engineering Analysis](https://developers.openai.com/codex/use-cases/iterate-on-difficult-problems)[![](/images/codex/codex-wallpaper-1.webp)

66 

67### Create browser-based games

68 

69Use Codex to turn a game brief into first a well-defined plan, and then a real browser-based...

70 

71Engineering Code](https://developers.openai.com/codex/use-cases/browser-games)[![](/images/codex/codex-wallpaper-2.webp)

72 

73### Analyze datasets and ship reports

74 

75Use Codex to clean data, join sources, explore hypotheses, model results, and package the...

76 

77Data Analysis](https://developers.openai.com/codex/use-cases/datasets-and-reports)

Details

1# Analyze datasets and ship reports | Codex use cases

2 

3Need

4 

5Analysis stack

6 

7Default options

8 

9[pandas](https://pandas.pydata.org/) with [matplotlib](https://matplotlib.org/) or [seaborn](https://seaborn.pydata.org/)

10 

11Why it's needed

12 

13Good defaults for import, profiling, joins, cleaning, and the first round of charts.

Details

1# Turn Figma designs into code | Codex use cases

2 

3Need

4 

5Design source

6 

7Default options

8 

9[Figma](https://www.figma.com/)

10 

11Why it's needed

12 

13A concrete frame or component selection keeps the implementation grounded.

Details

1# Build responsive front-end designs | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Use Codex to translate screenshots and design briefs into code that matches the repo's design system, then use Playwright to compare the implementation to your references for different screen sizes and iterate until it looks right.

6 

7Intermediate

8 

91h

10 

11Related links

12 

13[Codex skills](https://developers.openai.com/codex/skills)

14 

15## Best for

16 

17 - Creating new front-end projects from scratch

18- Implementing already designed screens or flows from screenshots in an existing codebase

19 

20## Skills & Plugins

21 

22- [Playwright](https://github.com/openai/skills/tree/main/skills/.curated/playwright-interactive)

23 

24 Open the app in a real browser to verify the implementation and iterate on layout and behavior.

25 

26## Starter prompt

27 

28Implement this UI in the current project using the screenshots and notes I provide as the source of truth.

29 Requirements:

30 - Reuse the existing design system components and tokens.

31- Translate the screenshots into this repo's utilities and component patterns instead of inventing a parallel system.

32 - Match spacing, layout, hierarchy, and responsive behavior closely.

33 - Respect the repo's routing, state, and data-fetch patterns.

34 - Make the page responsive on desktop and mobile.

35- If any screenshot detail is ambiguous, choose the simplest implementation that still matches the overall direction and note the assumption briefly.

36 Validation:

37- Compare the finished UI against the provided screenshots for both look and behavior.

38- Use $playwright-interactive to check that the UI matches the references and iterate as needed until it does.

39 

40## Introduction

41 

42When you have screenshots, a short design brief, or a few references for inspiration, Codex can turn those into responsive UI without ignoring the patterns already established in your project.

43 

44With the Playwright skill, Codex can open the app in a real browser, compare the implementation to your screenshots for different screen sizes, and iterate on layout or behavior until the result is closer to the target.

45 

46## Start from references

47 

48Give Codex the clearest references you have for the UI you want. A single screenshot can be enough for a narrow task, but the handoff gets better when you include multiple states such as desktop and mobile layouts, hover or selected states, and any empty or loading views that matter.

49 

50The references do not need to be perfect design deliverables. They just need to make the intended hierarchy, spacing, and direction concrete enough that Codex is not guessing.

51 

52## Be specific

53 

54The more specific you are about the expected interaction patterns and the style you want, the better the result will be.

55The model tends to default to high-frequency patterns and style so if it's not obvious from your references that you want something else, the UI might look generic.

56The more input you give, be it more reference inspiration or more specific instructions, the more you can expect to have a UI that stands out.

57 

58## Prepare the design system

59 

60Codex works best when the target repo already has a clear component layer. Codex can automatically use your existing component and design system instead of recreating them from scratch.

61 

62If you think it's necessary (i.e. if you're not using a standard stack), specify to Codex which primitives to reuse, where your tokens live, and what the repo considers canonical for buttons, inputs, cards, typography, and icons.

63 

64If you're starting from an existing codebase, it's very likely that Codex will understand on its own how to use your components and design system, but if starting from scratch, it's a good idea to be explicit.

65 

66Ask Codex to treat the screenshots as a visual target but to translate that target into the project's actual utilities, component wrappers, color system, typography scale, spacing tokens, routing, state management, and data-fetch patterns.

67 

68## Leverage Playwright

69 

70Playwright is a great tool to help Codex iterate on the UI. With it, Codex can open the app in a real browser, compare the implementation to the screenshots you provided, and iterate on layout or behavior.

71 

72It can resize the browser window to different screen sizes and check the layout at different breakpoints.

73 

74Make sure you have the Playwright interactive skill enabled in Codex. For more details, see the [skills documentation](https://developers.openai.com/codex/skills).

75 

76## Iterate

77 

78The first pass should already be directionally close to the screenshots. For complex layouts, interactions, or animation-heavy UI, expect a few rounds of adjustment.

79 

80Ask Codex to compare the implementation back to the screenshots, not just whether the page builds. When conflicts come up, it should prefer the repo's design-system tokens and only make minimal spacing or sizing adjustments needed to preserve the overall look of the design.

81 

82Use additional screenshots or short notes if they help clarify states that are not obvious from one image.

83 

84### Suggested follow-up prompt

85 

86[current implementation image] [reference image]

87This doesn't look right. Make sure to implement something that matches closely the reference:

88[if needed, specify what is different]

89 

90## Related use cases

91 

92[![](/images/codex/codex-wallpaper-2.webp)

93 

94### Turn Figma designs into code

95 

96Use Codex to pull design context, assets, and variants from Figma, translate them into code...

97 

98Front-end Design](https://developers.openai.com/codex/use-cases/figma-designs-to-code)[![](/images/codex/codex-wallpaper-3.webp)

99 

100### Generate slide decks

101 

102Use Codex to update existing presentations or build new decks by editing slides directly...

103 

104Data Workflow](https://developers.openai.com/codex/use-cases/generate-slide-decks)[![](/images/codex/codex-wallpaper-1.webp)

105 

106### Create browser-based games

107 

108Use Codex to turn a game brief into first a well-defined plan, and then a real browser-based...

109 

110Engineering Code](https://developers.openai.com/codex/use-cases/browser-games)

Details

1# Generate slide decks | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Use Codex to update existing presentations or build new decks by editing slides directly through code, generating visuals, and applying repeatable layout rules slide by slide.

6 

7Easy

8 

930m

10 

11Related links

12 

13[Image generation guide](https://developers.openai.com/api/docs/guides/image-generation)

14 

15## Best for

16 

17 - Teams turning notes or structured inputs into repeatable slide decks

18 - Creating new visual presentations from scratch

19- Rebuilding or extending decks from screenshots, PDFs, or reference presentations

20 

21## Skills & Plugins

22 

23- [Slides](https://github.com/openai/skills/tree/main/skills/.curated/slides)

24 

25 Create and edit `.pptx` decks in JavaScript with PptxGenJS, bundled helpers, and render and validation scripts for overflow, overlap, and font checks.

26- [ImageGen](https://github.com/openai/skills/tree/main/skills/.curated/imagegen)

27 

28 Generate illustrations, cover art, diagrams, and slide visuals that match one reusable visual direction.

29 

30## Starter prompt

31 

32Use $slides with $imagegen to edit this slide deck in the following way:

33 - If present, add logo.png in the bottom right corner on every slide

34- On slides X, Y and Z, move the text to the left and use image generation to generate an illustration (style: abstract, digital art) on the right

35- Preserve text as text and simple charts as native PowerPoint charts where practical.

36 - Add these slides: [describe new slides here]

37- Use the existing branding on new slides and new text (colors, fonts, layout, etc.)

38- Render the updated deck to slide images, review the output, and fix layout issues before delivery.

39- Run overflow and font-substitution checks before delivery, especially if the deck is dense.

40- Save reusable prompts or generation notes when you create a batch of related images.

41 Output:

42 - A copy of the slide deck with the changes applied

43 - notes on which slides were generated, rewritten, or left unchanged

44 

45## Introduction

46 

47You can use Codex to manipulate PowerPoint decks in a systematic way, using the Slides skill to create and edit decks with PptxGenJS, and using image generation to generate visuals for the slides.

48 

49Skills can be installed directly from the Codex app–see our [skills documentation](https://developers.openai.com/codex/skills) for more details.

50 

51You can create new decks from scratch, describing what you want, but the ideal workflow is to start from an existing deck–already set up with your branding guidelines–and ask Codex to edit it.

52 

53## Start from the source deck and references

54 

55If a deck already exists, ask Codex to inspect it before making changes.

56 

57The slides skill is opinionated here: match the source aspect ratio before you rebuild layout, and default to 16:9 only when the source material does not already define the deck size. If the references are screenshots or a PDF, ask Codex to render or inspect them first so it can compare slide geometry visually instead of guessing.

58 

59## Keep the deck editable

60 

61When building out new slides, ask Codex to keep the slides editable: when slides contain text, charts, or simple layout elements, those should stay PowerPoint-native when practical. Text should stay text. Simple bar, line, pie, and histogram visuals should stay native charts when possible. For diagrams or visuals that are too custom for native slide objects, Codex can generate or place SVG and image assets deliberately instead of rasterizing the whole slide.

62 

63For example, if you want to build a complex timeline with illustrations, instead of generating a whole image, ask Codex to generate each illustration separately (using a set style prompt as reference), place them on the slide, then link them using native lines. The text and dates should be text objects as well, and not included in the illustrations.

64 

65## Generate visuals intentionally

66 

67Image generation is most useful when the slides need a cover image, a concept illustration, or a lightweight diagram that would otherwise take manual design work. Ask Codex to define the visual direction first, then reuse that direction consistently across the whole deck.

68 

69When several slides need related visuals, have Codex save the prompts or generation notes it used. That makes the deck easier to extend later without starting over stylistically.

70 

71## Keep slide logic explicit

72 

73Deck automation works better when Codex treats each slide as its own decision. Some slides should preserve exact copy, some need a stronger headline and cleaner structure, and some should stay mostly untouched apart from asset cleanup or formatting fixes.

74 

75The slides skill also ships with bundled layout helpers. Ask Codex to copy those helpers into the working directory and reuse them instead of reimplementing spacing, text-sizing, and image-placement logic on every deck.

76 

77## Validation before delivery

78 

79Decks are easy to get almost right and still ship with clipped text, substituted fonts, or layout drift that only shows up after export. The slides skill includes scripts to render decks to per-slide PNGs, build a quick montage for review, detect overflow beyond the slide canvas, and report missing or substituted fonts.

80 

81Ask Codex to use those checks before it hands back the final deck, especially when slides are dense or margins are tight.

82 

83## Example ideas

84 

85Here are some ideas you could try with this use case:

86 

87### New deck from scratch

88 

89You can create new slide decks from scratch, describing what you want slide by slide and the overall vibe.

90If you have assets like logos or images, you can copy them in the same folder so that Codex can easily access them.

91 

92Create a new slide deck with the following slides:

93- Slide 1: Title slide with the company logo (logo.png) and the title of the presentation

94- Slide 2: Agenda slide with the key points of the presentation

95- Slide 3: [TITLE] [TAGLINE] [DESCRIPTION]

96- ...

97- Slide N: Conclusion slide with the key takeaways

98- Slide N+1: Q&A slide with my picture (my-picture.png)

99 

100### Deck template update

101 

102You can update a deck template on a regular basis (weekly, monthly, quarterly, etc.) with new content.

103If you're doing this frequently, create a file like `guidelines.md` to define the content and structure of the deck and how it should be updated.

104 

105Combine it with other skills to fetch information from your preferred data

106 sources.

107 

108For example, if you need to give quarterly updates to your stakeholders, you can update the deck template with new numbers and insights.

109 

110Update the deck template, pulling content from [integration 1] and [integration 2].

111Make sure to follow guidelines defined in guidelines.md.

112 

113### Adjust existing deck

114 

115If you built a deck but want to adjust it to fix spacing, misaligned text, or other layout issues, you can ask Codex to fix it.

116 

117Adjust the deck to make sure the following layout rules are followed:

118- Spacing should be consistent when there are multiple items on the same slide displayed in a row or grid.

119- When there are multiple items on the same slide displayed in a row or grid, the items are aligned horizontally or vertically depending on the content.

120- All text boxes should be aligned left, except when they are below an illustration

121- All titles should use the font [font name] and size [size]

122- All captions should be in [color]

123- ....

124 

125## Related use cases

126 

127[![](/images/codex/codex-wallpaper-2.webp)

128 

129### Kick off coding tasks from Slack

130 

131Mention `@Codex` in Slack to start a task tied to the right repo and environment, then...

132 

133Integrations Workflow](https://developers.openai.com/codex/use-cases/slack-coding-tasks)[![](/images/codex/codex-wallpaper-2.webp)

134 

135### Analyze datasets and ship reports

136 

137Use Codex to clean data, join sources, explore hypotheses, model results, and package the...

138 

139Data Analysis](https://developers.openai.com/codex/use-cases/datasets-and-reports)[![](/images/codex/codex-wallpaper-2.webp)

140 

141### Build responsive front-end designs

142 

143Use Codex to translate screenshots and design briefs into code that matches the repo's...

144 

145Front-end Design](https://developers.openai.com/codex/use-cases/frontend-designs)

Details

1# Review pull requests faster | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Use Codex in GitHub to automatically surface regressions, missing tests, and documentation issues directly on a pull request.

6 

7Easy

8 

95s

10 

11Related links

12 

13[Use Codex in GitHub](https://developers.openai.com/codex/integrations/github) [Custom instructions with AGENTS.md](https://developers.openai.com/codex/guides/agents-md)

14 

15## Best for

16 

17 - Teams that want another review signal before human merge approval

18 - Large codebases for projects in production

19 

20## Skills & Plugins

21 

22- [Security Best Practices](https://github.com/openai/skills/tree/main/skills/.curated/security-best-practices)

23 

24 Focus the review on risky surfaces such as secrets, auth, and dependency changes.

25 

26## Starter prompt

27 

28@codex review for security regressions, missing tests, and risky behavior changes.

29 

30## How to use

31 

32Start by adding Codex code review to your GitHub organization or repository. See [Use Codex in GitHub](https://developers.openai.com/codex/integrations/github) for more details.

33 

34You can set up Codex to automatically review every pull request, or you can request a review with `@codex review` in a pull request comment.

35 

36If Codex flags a regression or potential issue, you can ask it to fix it by commenting on the pull request with a follow-up prompt like `@codex fix it`.

37 

38This will start a new cloud task that will fix the issue and update the pull request.

39 

40## Define additional guidance

41 

42To customize what Codex reviews, add or update a top-level `AGENTS.md` with a section like this:

43 

44```md

45## Review guidelines

46 

47- Flag typos and grammar issues as P0 issues.

48- Flag potential missing documentation as P1 issues.

49- Flag missing tests as P1 issues.

50 ...

51```

52 

53Codex applies guidance from the closest `AGENTS.md` to each changed file. You can place more specific instructions deeper in the tree when particular packages need extra scrutiny.

54 

55## Related use cases

56 

57[![](/images/codex/codex-wallpaper-1.webp)

58 

59### Bring your app to ChatGPT

60 

61Build one narrow ChatGPT app outcome end to end: define the tools, scaffold the MCP server...

62 

63Integrations Code](https://developers.openai.com/codex/use-cases/chatgpt-apps)[![](/images/codex/codex-wallpaper-3.webp)

64 

65### Generate slide decks

66 

67Use Codex to update existing presentations or build new decks by editing slides directly...

68 

69Data Workflow](https://developers.openai.com/codex/use-cases/generate-slide-decks)[![](/images/codex/codex-wallpaper-2.webp)

70 

71### Kick off coding tasks from Slack

72 

73Mention `@Codex` in Slack to start a task tied to the right repo and environment, then...

74 

75Integrations Workflow](https://developers.openai.com/codex/use-cases/slack-coding-tasks)

Details

1# Iterate on difficult problems | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Give Codex an evaluation system, such as scripts and reviewable artifacts, so it can keep improving a hard task until the scores are good enough.

6 

7Advanced

8 

9Long-running

10 

11Related links

12 

13[Custom instructions with AGENTS.md](https://developers.openai.com/codex/guides/agents-md) [Codex workflows](https://developers.openai.com/codex/workflows)

14 

15## Best for

16 

17- Problems where each iteration can be scored, but the best result usually takes many passes

18- Tasks with visual or subjective outputs that need both deterministic checks and an LLM-as-a-judge score

19- Long-running Codex sessions where you want progress tracked clearly instead of relying on context

20 

21## Starter prompt

22 

23I have a difficult task in this workspace and I want you to run it as an eval-driven improvement loop.

24 Before changing anything:

25 - Read `AGENTS.md`.

26 - Find the script or command that scores the current output.

27 Iteration loop:

28 - Make one focused improvement at a time.

29 - Re-run the eval command after each meaningful change.

30 - Log the scores and what changed.

31- Inspect generated artifacts directly. If the output is visual, use `view\_image`.

32 - Keep going until both the overall score and the LLM average are above 90%.

33 Constraints:

34 - Do not stop at the first acceptable result.

35- Do not revert to an earlier version unless the new result is clearly worse in scores or artifacts.

36- If the eval improves but is still below target, explain the bottleneck and continue.

37 Output:

38 - current best scores

39 - log of major iterations

40 - remaining risks or weak spots

41 

42## Introduction

43 

44Some tasks are easy to verify in one shot: the build passes, the tests go green, and you are done. But there are some optimization problems that are difficult to solve, and need many iterations with a tight evaluation loop. To know which direction to go in, Codex needs to inspect the current output, score it, decide the next change, and repeat until the result is actually good.

45 

46This type of use case pairs well with a custom UI that lets you inspect progress visually, by having Codex log the outputs and generated artifacts for each iteration.

47You can watch Codex continue working in the app while the target artifact, model output, or generated asset keeps improving.

48The key is to give Codex the necessary scripts to generate the evaluation metrics and the artifacts to inspect.

49 

50## Start with evals

51 

52Before the task begins, define how success will be measured. The best setup usually combines:

53 

54- **Deterministic checks:** things the scripts can score directly, such as constraint violations or deterministic metrics computed with code

55- **LLM-as-a-judge checks:** rubric-based scores for qualities that are harder to encode exactly, such as resemblance, readability, usefulness, or overall quality - this can rely on text or image outputs

56 

57If the subjective part matters, give Codex a script that can call a model for example using the [Responses API](https://developers.openai.com/api/reference/resources/responses/methods/create) and return structured scores. The point is not to replace deterministic checks, it's to supplement them with a consistent judge for the part humans would otherwise assess by eye.

58 

59The loop works best when the eval output is machine-readable, saved after every run, and easy to compare over time.

60 

61**Tip**: Ask Codex to generate the evaluation script for you, describing the

62 checks you want to run.

63 

64## Give Codex a stopping rule

65 

66Hard tasks often drift because the prompt says “keep improving” without saying when to stop. Make the stopping rule explicit.

67 

68A practical pattern is:

69 

701. Set a target for the overall score.

712. Set a separate target for the LLM-judge average.

723. Tell Codex to continue until both are above the threshold, not just one.

73 

74For example, if the goal is a high-quality artifact, ask Codex to keep going until both the overall score and the LLM average are above 90%. That makes the task legible: Codex can tell whether it is still below target, where the gap is, and whether the latest change helped.

75 

76## Keep a running log of the loop

77 

78Long-running work is much more reliable when Codex keeps notes about the loop instead of trying to remember everything from the thread.

79 

80That running log should record:

81 

82- the current best scores

83- what changed on the last iteration

84- what the eval said got better or worse

85- what Codex plans to try next

86 

87This is especially important when the task runs for a long time. The log becomes the handoff point for the next session and the self-evaluation record for the current one.

88 

89## Inspect the artifact, not just the logs

90 

91For some difficult tasks, the code diff and metric output are not enough. Codex should look at the artifact it produced.

92 

93If the output is visual, such as a generated image, layout, or rendered state, let Codex inspect that artifact directly, for example when the output lives on disk as an image and compare the current result to the prior best result or to the intended rubric.

94 

95This makes the loop stronger:

96 

97- the eval script reports the score

98- the artifact shows what the score missed

99- the next change is grounded in both

100 

101That combination is much more effective than changing code blindly between runs.

102 

103## Make every iteration explicit

104 

105Ask Codex to follow the same loop every time:

106 

1071. Run the evals on the current baseline.

1082. Identify the biggest failure mode from the scores and artifacts.

1093. Make one focused change that addresses that bottleneck.

1104. Re-run the evals.

1115. Log the new scores and whether the change helped.

1126. Continue until the thresholds are met.

113 

114This discipline matters. If each iteration changes too many things at once, Codex cannot tell which idea improved the score. If it skips logging, the session becomes hard to trust and hard to resume.

115 

116## Related use cases

117 

118[![](/images/codex/codex-wallpaper-1.webp)

119 

120### Understand large codebases

121 

122Use Codex to map unfamiliar codebases, explain different modules and data flow, and point...

123 

124Engineering Analysis](https://developers.openai.com/codex/use-cases/codebase-onboarding)[![](/images/codex/codex-wallpaper-1.webp)

125 

126### Create browser-based games

127 

128Use Codex to turn a game brief into first a well-defined plan, and then a real browser-based...

129 

130Engineering Code](https://developers.openai.com/codex/use-cases/browser-games)[![](/images/codex/codex-wallpaper-2.webp)

131 

132### Analyze datasets and ship reports

133 

134Use Codex to clean data, join sources, explore hypotheses, model results, and package the...

135 

136Data Analysis](https://developers.openai.com/codex/use-cases/datasets-and-reports)

Details

1# Build for iOS and macOS | Codex use cases

2 

3Need

4 

5Project automation

6 

7Default options

8 

9[XcodeBuildMCP](https://www.xcodebuildmcp.com/)

10 

11Why it's needed

12 

13A strong option once you need Codex to inspect schemes and targets, launch the app, capture screenshots, and keep iterating without leaving the agentic loop.

Details

1# Kick off coding tasks from Slack | Codex use cases

2 

3[← All use cases](https://developers.openai.com/codex/use-cases)

4 

5Mention `@Codex` in Slack to start a task tied to the right repo and environment, then review the result back in the thread or in Codex cloud.

6 

7Easy

8 

95m

10 

11Related links

12 

13[Use Codex in Slack](https://developers.openai.com/codex/integrations/slack) [Codex cloud environments](https://developers.openai.com/codex/cloud/environments)

14 

15## Best for

16 

17- Async handoffs that start in a Slack thread and already have enough context to act on

18- Teams that want quick issue triage, bug fixes, or scoped implementation work without context switching

19 

20## Starter prompt

21 

22@Codex analyze the issue mentioned in this thread and implement a fix in <name of your environment>.

23 

24## How to use

25 

261. Install the Slack app, connect the right repositories and environments, and add `@Codex` to the channel.

272. Mention `@Codex` in a thread with a clear request, constraints, and the outcome you want.

283. Open the task link, review the result, and continue the follow-up in Slack if the task needs another pass.

29 

30You can learn more about how to use Codex in Slack in the [dedicated guide](https://developers.openai.com/codex/integrations/slack).

31 

32## Tips

33 

34- If the thread does not already include enough context or suggested fix, include in your prompt some guidance

35- Make sure the repo and environment mapping are correct by mentioning the name of the project or environment in your prompt

36- Scope the request so Codex can finish it without a second planning loop

37- If your project is a large codebase, guide Codex by mentioning which files or folders are relevant to the task

38 

39## Related use cases

40 

41[![](/images/codex/codex-wallpaper-3.webp)

42 

43### Generate slide decks

44 

45Use Codex to update existing presentations or build new decks by editing slides directly...

46 

47Data Workflow](https://developers.openai.com/codex/use-cases/generate-slide-decks)[![](/images/codex/codex-wallpaper-2.webp)

48 

49### Analyze datasets and ship reports

50 

51Use Codex to clean data, join sources, explore hypotheses, model results, and package the...

52 

53Data Analysis](https://developers.openai.com/codex/use-cases/datasets-and-reports)[![](/images/codex/codex-wallpaper-1.webp)

54 

55### Bring your app to ChatGPT

56 

57Build one narrow ChatGPT app outcome end to end: define the tools, scaffold the MCP server...

58 

59Integrations Code](https://developers.openai.com/codex/use-cases/chatgpt-apps)

windows.md +216 −19

Details

1# Windows1# Windows

2 2 

3The easiest way to use Codex on Windows is to [set up the IDE extension](https://developers.openai.com/codex/ide) or [install the CLI](https://developers.openai.com/codex/cli) and run it from PowerShell.3Use Codex on Windows with the native [Codex app](https://developers.openai.com/codex/app/windows), the

4[CLI](https://developers.openai.com/codex/cli), or the [IDE extension](https://developers.openai.com/codex/ide).

4 5 

5When you run Codex natively on Windows, the agent mode uses an experimental Windows sandbox to block filesystem writes outside the working folder and prevent network access without your explicit approval. [Learn more below](#windows-experimental-sandbox).6[![](/images/codex/codex-banner-icon.webp)

6 7 

7Instead, you can use [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) (WSL2). WSL2 gives you a Linux shell, Unix-style semantics, and tooling that match many tasks that models see in training.8Use the Codex app on Windows

9 

10Work across projects, run parallel agent threads, and review results in one place with the native Windows app.](https://developers.openai.com/codex/app/windows)

11 

12Depending on the surface and your setup, Codex can run on Windows in three

13practical ways:

14 

15- natively on Windows with the stronger `elevated` sandbox,

16- natively on Windows with the fallback `unelevated` sandbox,

17- or inside [Windows Subsystem for Linux](https://learn.microsoft.com/en-us/windows/wsl/install) (WSL), which uses the Linux sandbox implementation.

18 

19## Windows sandbox

20 

21When you run Codex natively on Windows, agent mode uses a Windows sandbox to

22block filesystem writes outside the working folder and prevent network access

23without your explicit approval.

24 

25Native Windows sandbox support includes two modes that you can configure in

26`config.toml`:

27 

28```toml

29[windows]

30sandbox = "elevated" # or "unelevated"

31```

32 

33`elevated` is the preferred native Windows sandbox. It uses dedicated

34lower-privilege sandbox users, filesystem permission boundaries, firewall

35rules, and local policy changes needed for sandboxed command execution.

36 

37`unelevated` is the fallback native Windows sandbox. It runs commands with a

38restricted Windows token derived from your current user, applies ACL-based

39filesystem boundaries, and uses environment-level offline controls instead of

40the dedicated offline-user firewall rule. It is weaker than `elevated`, but it

41is still useful when administrator-approved setup is blocked by local or

42enterprise policy.

43 

44If both modes are available, use `elevated`. If the default native sandbox

45doesn't work in your environment, use `unelevated` as a fallback while you

46troubleshoot the setup.

47 

48By default, both sandbox modes also use a private desktop for stronger UI

49isolation. Set `windows.sandbox_private_desktop = false` only if you need the

50older `Winsta0\\Default` behavior for compatibility.

51 

52### Sandbox permissions

53 

54Running Codex in full access mode means Codex is not limited to your project

55 directory and might perform unintentional destructive actions that can lead to

56 data loss. For safer automation, keep sandbox boundaries in place and use

57 [rules](https://developers.openai.com/codex/rules) for specific exceptions, or set your [approval policy to

58 never](https://developers.openai.com/codex/agent-approvals-security#run-without-approval-prompts) to have

59 Codex attempt to solve problems without asking for escalated permissions,

60 based on your [approval and security setup](https://developers.openai.com/codex/agent-approvals-security).

61 

62### Windows version matrix

63 

64| Windows version | Support level | Notes |

65| -------------------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

66| Windows 11 | Recommended | Best baseline for Codex on Windows. Use this if you are standardizing an enterprise deployment. |

67| Recent, fully updated Windows 10 | Best effort | Can work, but is less reliable than Windows 11. For Windows 10, Codex depends on modern console support, including ConPTY. In practice, Windows 10 October 2018 Update or newer is required. |

68| Older Windows 10 builds | Not recommended | More likely to miss required console components such as ConPTY and more likely to fail in enterprise setups. |

69 

70Additional environment assumptions:

71 

72- `winget` should be available. If it is missing, update Windows or install

73 the Windows Package Manager before setting up Codex.

74- The recommended native sandbox depends on administrator-approved setup.

75- Some enterprise-managed devices block the required setup steps even when the

76 OS version itself is acceptable.

77 

78### Grant sandbox read access

79 

80When a command fails because the Windows sandbox can't read a directory, use:

81 

82```text

83/sandbox-add-read-dir C:\absolute\directory\path

84```

85 

86The path must be an existing absolute directory. After the command succeeds, later commands that run in the sandbox can read that directory during the current session.

87 

88We recommend using the native Windows sandbox by default. The native Windows sandbox will offer the best perfomance and highest speeds while keeping the same security. Choose WSL when you

89need a Linux-native environment on Windows, when your workflow already lives in

90WSL, or when neither native Windows sandbox mode meets your needs.

8 91 

9## Windows Subsystem for Linux92## Windows Subsystem for Linux

10 93 

94If you choose WSL, Codex runs inside the Linux environment instead of using the

95native Windows sandbox. This is useful if you need Linux-native tooling on

96Windows, if your repositories and developer workflow already live in WSL, or

97if neither native Windows sandbox mode works for your environment.

98 

11### Launch VS Code from inside WSL99### Launch VS Code from inside WSL

12 100 

13For step-by-step instructions, see the [official VS Code WSL tutorial](https://code.visualstudio.com/docs/remote/wsl-tutorial).101For step-by-step instructions, see the [official VS Code WSL tutorial](https://code.visualstudio.com/docs/remote/wsl-tutorial).


43 `WSL: Reopen Folder in WSL`, and keep your repository under `/home/...` (not131 `WSL: Reopen Folder in WSL`, and keep your repository under `/home/...` (not

44 `C:\`) for best performance.132 `C:\`) for best performance.

45 133 

134If the Windows app or project picker does not show your WSL repository, type

135`\wsl$` into the file picker or Explorer, then navigate to your

136 distro's home directory.

137 

46### Use Codex CLI with WSL138### Use Codex CLI with WSL

47 139 

48Run these commands from an elevated PowerShell or Windows Terminal:140Run these commands from an elevated PowerShell or Windows Terminal:


81 ```173 ```

82- If you need Windows access to files, they’re under `\wsl$\Ubuntu\home&lt;user>` in Explorer.174- If you need Windows access to files, they’re under `\wsl$\Ubuntu\home&lt;user>` in Explorer.

83 175 

84## Windows experimental sandbox176## Troubleshooting and FAQ

85 177 

86The Windows sandbox support is experimental. How it works:178If you are troubleshooting a managed Windows machine, start with the native

179sandbox mode, Windows version, and any policy error shown by Codex. Most native

180Windows support issues come from sandbox setup, logon rights, or filesystem

181permissions rather than from the editor itself.

87 182 

88- Launches commands inside a restricted token derived from an AppContainer profile.183My native sandbox setup failed

89- Grants only specifically requested filesystem capabilities by attaching capability security identifiers to that profile.

90- Disables outbound network access by overriding proxy-related environment variables and inserting stub executables for common network tools.

91 184 

92Its primary limitation is that it can’t prevent file writes, deletions, or creations in any directory where the Everyone SID already has write permissions (for example, world-writable folders). When using the Windows sandbox, Codex scans for folders where Everyone has write access and recommends that you remove that access.185If Codex cannot complete the `elevated` sandbox setup, the most common causes

186are:

93 187 

94### Grant sandbox read access188- the Windows UAC or administrator prompt was declined,

189- the machine does not allow local user or group creation,

190- the machine does not allow firewall rule changes,

191- the machine blocks the logon rights needed by the sandbox users,

192- or another enterprise policy blocks part of the setup flow.

95 193 

96When a command fails because the Windows sandbox can't read a directory, use:194What to try:

97 195 

98```text1961. Try the `elevated` sandbox setup again and approve the administrator prompt

99/sandbox-add-read-dir C:\absolute\directory\path197 if your environment allows it.

100```1982. If your company laptop blocks this, ask your IT team whether the machine

199 allows administrator-approved setup for local user/group creation, firewall

200 configuration, and the required sandbox-user logon rights.

2013. If the default setup still fails, use the `unelevated` sandbox so you can

202 continue working while the issue is investigated.

101 203 

102The path must be an existing absolute directory. After the command succeeds, later commands that run in the sandbox can read that directory during the current session.204Codex switched me to the unelevated sandbox

205 

206This means Codex could not finish the stronger `elevated` sandbox setup on your

207machine.

208 

209- Codex can still run in a sandboxed mode.

210- It still applies ACL-based filesystem boundaries, but it does not use the

211 separate sandbox-user boundary from `elevated` and has weaker network

212 isolation.

213- This is a useful fallback, but not the preferred long-term enterprise

214 configuration.

215 

216If you are on a managed enterprise laptop, the best long-term fix is usually to

217get the `elevated` sandbox working with help from your IT team.

218 

219I see Windows error 1385

220 

221If sandboxed commands fail with error `1385`, Windows is denying the logon type

222the sandbox user needs in order to start the command.

223 

224In practice, this usually means Codex created the sandbox users successfully,

225but Windows policy is still preventing those users from launching sandboxed

226commands.

227 

228What to do:

229 

2301. Ask your IT team whether the device policy grants the required logon rights

231 to the Codex-created sandbox users.

2322. Compare group policy or OU differences if the issue affects only some

233 machines or teams.

2343. If you need to keep working immediately, use the `unelevated` sandbox while

235 the policy issue is investigated.

2364. Send `CODEX_HOME/.sandbox/sandbox.log` along with your Windows version and a

237 short description of the failure.

238 

239Codex warns that some folders are writable by Everyone

240 

241Codex may warn that some folders are writable by `Everyone`.

242 

243If you see this warning, Windows permissions on those folders are too broad for

244the sandbox to fully protect them.

245 

246What to do:

247 

2481. Review the folders Codex lists in the warning.

2492. Remove `Everyone` write access from those folders if that is appropriate in

250 your environment.

2513. Restart Codex or re-run the sandbox setup after those permissions are

252 corrected.

253 

254If you are not sure how to change those permissions, ask your IT team for help.

255 

256Sandboxed commands cannot reach the network

257 

258Some Codex tasks are intentionally run without outbound network access,

259depending on the permissions mode in use.

260 

261If a task fails because it cannot reach the network:

262 

2631. Check whether the task was supposed to run with network disabled.

2642. If you expected network access, restart Codex and try again.

2653. If the issue keeps happening, collect the sandbox log so the team can check

266 whether the machine is in a partial or broken sandbox state.

267 

268Sandboxing worked before and then stopped

269 

270This can happen after:

271 

272- moving a repo or workspace,

273- changing machine permissions,

274- changing Windows policies,

275- or other system configuration changes.

276 

277What to try:

278 

2791. Restart Codex.

2802. Try the `elevated` sandbox setup again.

2813. If that does not fix it, use the `unelevated` sandbox as a temporary

282 fallback.

2834. Collect the sandbox log for review.

284 

285I need to send diagnostics to OpenAI

286 

287If you still have problems, send:

288 

289- `CODEX_HOME/.sandbox/sandbox.log`

290 

291It is also helpful to include:

292 

293- a short description of what you were trying to do,

294- whether the `elevated` sandbox failed or the `unelevated` sandbox was used,

295- any error message shown in the app,

296- whether you saw `1385` or another Windows or PowerShell error,

297- and whether you are on Windows 11 or Windows 10.

298 

299Do not send:

103 300 

104### Troubleshooting and FAQ301- the contents of `CODEX_HOME/.sandbox-secrets/`

105 302 

106#### Installed extension, but it’s unresponsive303The IDE extension is installed but unresponsive

107 304 

108Your system may be missing C++ development tools, which some native dependencies require:305Your system may be missing C++ development tools, which some native dependencies require:

109 306 


113 310 

114Then fully restart VS Code after installation.311Then fully restart VS Code after installation.

115 312 

116#### If it feels slow on large repositories313Large repositories feel slow in WSL

117 314 

118- Make sure you’re not working under `/mnt/c`. Move the repository to WSL (for example, `~/code/…`).315- Make sure you’re not working under `/mnt/c`. Move the repository to WSL (for example, `~/code/…`).

119- Increase memory and CPU for WSL if needed; update WSL to the latest version:316- Increase memory and CPU for WSL if needed; update WSL to the latest version:


123 wsl --shutdown320 wsl --shutdown

124 ```321 ```

125 322 

126#### VS Code in WSL can’t find `codex`323VS Code in WSL cannot find codex

127 324 

128Verify the binary exists and is on PATH inside WSL:325Verify the binary exists and is on PATH inside WSL:

129 326