SpyBara
Go Premium

Documentation 2026-08-22 04:57 UTC to 2026-08-24 22:00 UTC

8 files changed +206 −26. View all changes and history on the product overview
2026
Mon 31 19:59 Sat 29 07:02 Fri 28 23:02 Thu 27 21:01 Wed 26 23:58 Tue 25 19:59 Mon 24 22:00 Fri 21 19:59 Thu 20 23:59 Wed 19 22:57 Tue 18 13:01 Mon 17 23:58 Sat 15 01:01 Fri 14 22:00 Thu 13 22:59 Wed 12 19:59 Tue 11 22:59 Mon 10 22:00 Sat 8 03:02 Fri 7 18:59 Thu 6 23:58 Wed 5 19:00 Tue 4 22:00 Mon 3 23:00 Sun 2 21:00
Details

433 key: "hooks.<Event>[].hooks",433 key: "hooks.<Event>[].hooks",

434 type: "array<table>",434 type: "array<table>",

435 description:435 description:

436 "Hook handlers for a matcher group. Command hooks are currently supported; prompt and agent hook handlers are parsed but skipped.",436 "Hook handlers for a matcher group. Command and MCP tool hooks are supported while prompt and agent hook handlers are parsed but skipped.",

437 },437 },

438 {438 {

439 key: "hooks.<Event>[].hooks[].async",439 key: "hooks.<Event>[].hooks[].async",


2068 key: "hooks.<Event>[].hooks",2068 key: "hooks.<Event>[].hooks",

2069 type: "array<table>",2069 type: "array<table>",

2070 description:2070 description:

2071 "Hook handlers for a matcher group. Command hooks are currently supported; prompt and agent hook handlers are parsed but skipped.",2071 "Hook handlers for a matcher group. Command and MCP tool hooks are supported while prompt and agent hook handlers are parsed but skipped.",

2072 },2072 },

2073 {2073 {

2074 key: "hooks.<Event>[].hooks[].async",2074 key: "hooks.<Event>[].hooks[].async",

Details

433 key: "hooks.<Event>[].hooks",433 key: "hooks.<Event>[].hooks",

434 type: "array<table>",434 type: "array<table>",

435 description:435 description:

436 "Hook handlers for a matcher group. Command hooks are currently supported; prompt and agent hook handlers are parsed but skipped.",436 "Hook handlers for a matcher group. Command and MCP tool hooks are supported while prompt and agent hook handlers are parsed but skipped.",

437 },437 },

438 {438 {

439 key: "hooks.<Event>[].hooks[].async",439 key: "hooks.<Event>[].hooks[].async",


2068 key: "hooks.<Event>[].hooks",2068 key: "hooks.<Event>[].hooks",

2069 type: "array<table>",2069 type: "array<table>",

2070 description:2070 description:

2071 "Hook handlers for a matcher group. Command hooks are currently supported; prompt and agent hook handlers are parsed but skipped.",2071 "Hook handlers for a matcher group. Command and MCP tool hooks are supported while prompt and agent hook handlers are parsed but skipped.",

2072 },2072 },

2073 {2073 {

2074 key: "hooks.<Event>[].hooks[].async",2074 key: "hooks.<Event>[].hooks[].async",

Details

342. Use the append-only compliance log stream for ongoing collection. Check the342. Use the append-only compliance log stream for ongoing collection. Check the

35 authenticated reference for the currently supported resources and retrieval35 authenticated reference for the currently supported resources and retrieval

36 patterns.36 patterns.

373. Test ingestion into a non-production security information and event373. [Download log files](#download-logs) and test ingestion into a non-production

38 management (SIEM) system or data lake. The38 security information and event management (SIEM) system or data lake.

39 [Compliance Platform guide](https://help.openai.com/en/articles/9261474-compliance-api-for-chatgpt-enterprise-edu-and-chatgpt-for-teachers)

40 links to the current API documentation and quickstart notebook.

414. Schedule continuous collection and apply your organization's access,394. Schedule continuous collection and apply your organization's access,

42 retention, and legal-hold controls to exported records. Don't assume the40 retention, and legal-hold controls to exported records. Don't assume the

43 source retention window replaces your organization's retention policy.41 source retention window replaces your organization's retention policy.


47discovery workflow. Use the authenticated reference for the current routes and45discovery workflow. Use the authenticated reference for the current routes and

48schemas rather than copying an endpoint contract from this guide.46schemas rather than copying an endpoint contract from this guide.

49 47 

48### Download logs

49 

50Download the [Bash script](https://developers.openai.com/downloads/compliance-api/download_compliance_files.sh)

51or [PowerShell script](https://developers.openai.com/downloads/compliance-api/download_compliance_files.ps1).

52Both list and download every available log file after a given timestamp, follow

53pagination, and write JSONL to standard output. Errors go to standard error.

54 

55Set `COMPLIANCE_API_KEY` to your Enterprise Compliance API key. Replace

56`<workspace_or_org_id>` with your ChatGPT workspace ID or API Platform

57organization ID, and `<after>` with an ISO 8601 timestamp that includes a time

58zone. This example retrieves `AUTH_LOG` files, 100 at a time.

59 

60On macOS or Linux, install Bash, `curl`, and `jq`, then run:

61 

62```bash

63bash ./download_compliance_files.sh "<workspace_or_org_id>" AUTH_LOG 100 "<after>" > output.jsonl

64```

65 

66The Windows script supports PowerShell 5.1 or later. Review the downloaded file.

67If Windows blocks it and your organization's execution policy permits it, run

68`Unblock-File -Path .\download_compliance_files.ps1`. This example uses

69PowerShell 7 to save UTF-8 without a byte-order mark:

70 

71```powershell

72.\download_compliance_files.ps1 "<workspace_or_org_id>" AUTH_LOG 100 "<after>" |

73 Set-Content -Encoding utf8NoBOM output.jsonl

74```

75 

50## Confirm the administration boundaries76## Confirm the administration boundaries

51 77 

52Compliance coverage follows the ChatGPT workspace and the products represented78Compliance coverage follows the ChatGPT workspace and the products represented

Details

10| Experimental | Unstable and OpenAI may remove or change it. | Use at your own risk. |10| Experimental | Unstable and OpenAI may remove or change it. | Use at your own risk. |

11| Beta | Ready for broad testing; complete in most respects, but some aspects may change based on user feedback. | OK for most evaluation and pilots; expect small changes. |11| Beta | Ready for broad testing; complete in most respects, but some aspects may change based on user feedback. | OK for most evaluation and pilots; expect small changes. |

12| Stable | Fully supported, documented, and ready for broad use; behavior and configuration remain consistent over time. | Safe for production use; removals typically go through a deprecation process. |12| Stable | Fully supported, documented, and ready for broad use; behavior and configuration remain consistent over time. | Safe for production use; removals typically go through a deprecation process. |

13| Deprecated | Still available for compatibility, but no longer recommended; OpenAI may remove it in a future release. | Avoid new use and plan to migrate. |

Details

4 4 

5# Running Codex as an MCP server5# Running Codex as an MCP server

6 6 

7`codex mcp-server` is deprecated. Use the [Codex app

8 server](https://learn.chatgpt.com/docs/app-server) instead. To call Codex from Claude Code, use the

9 [Codex plugin for Claude Code](https://github.com/openai/codex-plugin-cc),

10 which uses the app server. This page documents the deprecated command for

11 existing integrations.

12 

7You can run Codex as an MCP server and connect it from other MCP clients (for example, an agent built with the [OpenAI Agents SDK MCP integration](https://developers.openai.com/api/docs/guides/agents/integrations-observability#mcp)).13You can run Codex as an MCP server and connect it from other MCP clients (for example, an agent built with the [OpenAI Agents SDK MCP integration](https://developers.openai.com/api/docs/guides/agents/integrations-observability#mcp)).

8 14 

9To start Codex as an MCP server, you can use the following command:15To start Codex as an MCP server, you can use the following command:

hooks.md +90 −8

Details

2 2 

3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.3> For the complete documentation index, see [llms.txt](https://learn.chatgpt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

4 4 

5Hooks are an extensibility framework for Codex. They allow5Hooks are an extensibility framework for Codex. They let you run scripts or MCP

6you to inject your own scripts into the agentic loop, enabling features such as:6tools during the agentic loop, enabling features such as:

7 7 

8- Send the chat to a custom logging/analytics engine8- Send the chat to a custom logging/analytics engine

9- Scan your team's prompts to block accidentally pasting API keys9- Scan your team's prompts to block accidentally pasting API keys


16- Matching hooks from multiple files all run.16- Matching hooks from multiple files all run.

17- Multiple matching command hooks for the same event are launched concurrently,17- Multiple matching command hooks for the same event are launched concurrently,

18 so one hook can't prevent another matching hook from starting.18 so one hook can't prevent another matching hook from starting.

19- Non-managed command hooks must be reviewed and trusted before they run.19- Non-managed hooks must be reviewed and trusted before they run.

20 20 

21Hooks run at different points in a conversation:21Hooks run at different points in a conversation:

22 22 


61## Review and trust hooks61## Review and trust hooks

62 62 

63Codex lists configured hooks before deciding which ones can run. Before a63Codex lists configured hooks before deciding which ones can run. Before a

64non-managed command hook can run, Codex requires you to review and trust the64non-managed hook can run, Codex requires you to review and trust the exact hook

65exact hook definition. Codex records trust against the hook's current hash, so65definition. Codex records trust against the hook's current hash, so new or

66new or changed hooks are marked for review and skipped until trusted.66changed hooks are marked for review and skipped until trusted.

67 67 

68Use `/hooks` in the CLI to inspect hook sources, review new or changed hooks,68Use `/hooks` in the CLI to inspect hook sources, review new or changed hooks,

69trust hooks, or disable individual non-managed hooks. If hooks need review at69trust hooks, or disable individual non-managed hooks. If hooks need review at


189 `command_windows` or `commandWindows`.189 `command_windows` or `commandWindows`.

190- Set `async` to `true` to [run a command hook in the190- Set `async` to `true` to [run a command hook in the

191 background](#run-hooks-in-the-background).191 background](#run-hooks-in-the-background).

192- Only `type: "command"` handlers run today. `prompt` and `agent` handlers are192- `command` and `mcp_tool` handlers are supported. `prompt` and `agent`

193 parsed but skipped.193 handlers are parsed but skipped.

194- Commands run with the session `cwd` as their working directory.194- Commands run with the session `cwd` as their working directory.

195- For repo-local hooks, prefer resolving from the git root instead of using a195- For repo-local hooks, prefer resolving from the git root instead of using a

196 relative path such as `.codex/hooks/...`. Codex may be started from a196 relative path such as `.codex/hooks/...`. Codex may be started from a


226statusMessage = "Reviewing Bash output"226statusMessage = "Reviewing Bash output"

227```227```

228 228 

229## MCP tool hooks

230 

231An MCP tool hook lets a lifecycle event call a tool on an already-connected MCP

232server. It sends structured arguments directly to the tool and uses the same

233trust review and output contract as a command hook.

234 

235### Configure an MCP tool hook

236 

237This hook asks the `scanner` MCP server to scan each patch after Codex writes or

238edits files:

239 

240```json

241{

242 "hooks": {

243 "PostToolUse": [

244 {

245 "matcher": "Write|Edit",

246 "hooks": [

247 {

248 "type": "mcp_tool",

249 "server": "scanner",

250 "tool": "scan_patch",

251 "input": { "patch": "${tool_input.command}" },

252 "timeout": 30,

253 "statusMessage": "Scanning edited files"

254 }

255 ]

256 }

257 ]

258 }

259}

260```

261 

262| Field | Meaning |

263| --------------- | ---------------------------------------------------------------- |

264| `type` | Must be `mcp_tool`. |

265| `server` | Required name of an already-connected MCP server. |

266| `tool` | Required name of a tool exposed by that server. |

267| `input` | Optional JSON object of argument templates. Defaults to `{}`. |

268| `timeout` | Optional active execution timeout in seconds. Defaults to `600`. |

269| `statusMessage` | Optional message shown while the hook runs. |

270 

271### Expand arguments from the hook event

272 

273Use `${field.nested}` to read a dotted field from the hook event. A placeholder

274that fills an entire value keeps its JSON type. A placeholder inside a larger

275string is rendered as text. Codex expands objects and arrays recursively.

276 

277For an event containing `{"tool_input":{"file_path":"src/main.rs","count":3}}`,

278this argument template:

279 

280```json

281{

282 "path": "${tool_input.file_path}",

283 "count": "${tool_input.count}",

284 "message": "Scanning ${tool_input.file_path}"

285}

286```

287 

288becomes:

289 

290```json

291{

292 "path": "src/main.rs",

293 "count": 3,

294 "message": "Scanning src/main.rs"

295}

296```

297 

298### Execution and lifecycle

299 

300- Hooks use an existing MCP connection. They don't start or reconnect servers.

301- A hook can block an operation when the tool returns a blocking decision.

302 Errors, missing servers, and unavailable tools don't block the operation.

303- MCP tool hooks run synchronously. They don't request tool approval or trigger

304 other hooks.

305- The shorter hook or server timeout applies. Time spent waiting for an MCP

306 elicitation response doesn't count against the timeout.

307- `SessionStart` hooks can run before an MCP server is ready. If that happens,

308 they don't block the session.

309- `SessionEnd` doesn't support MCP tool hooks.

310 

229## Turn hooks off311## Turn hooks off

230 312 

231Hooks are enabled by default. To turn them off in `config.toml`, set:313Hooks are enabled by default. To turn them off in `config.toml`, set:

windows.md +61 −8

Details

140Windows support issues come from sandbox setup, logon rights, or filesystem140Windows support issues come from sandbox setup, logon rights, or filesystem

141permissions rather than from the editor itself.141permissions rather than from the editor itself.

142 142 

143My native sandbox setup failed143 

144 

145### My native sandbox setup failed

146 

144 147 

145If Codex cannot complete the `elevated` sandbox setup, the most common causes148If Codex cannot complete the `elevated` sandbox setup, the most common causes

146are:149are:


1613. If the default setup still fails, use the `unelevated` sandbox so you can1643. If the default setup still fails, use the `unelevated` sandbox so you can

162 continue working while the issue is investigated.165 continue working while the issue is investigated.

163 166 

164Codex switched me to the unelevated sandbox167 

168 

169 

170 

171 

172 

173### Codex switched me to the unelevated sandbox

174 

165 175 

166This means Codex could not finish the stronger `elevated` sandbox setup on your176This means Codex could not finish the stronger `elevated` sandbox setup on your

167machine.177machine.


176If you are on a managed enterprise laptop, the best long-term fix is usually to186If you are on a managed enterprise laptop, the best long-term fix is usually to

177get the `elevated` sandbox working with help from your IT team.187get the `elevated` sandbox working with help from your IT team.

178 188 

179I see Windows error 1385189 

190 

191 

192 

193 

194 

195### I see Windows error 1385

196 

180 197 

181If sandboxed commands fail with error `1385`, Windows is denying the logon type198If sandboxed commands fail with error `1385`, Windows is denying the logon type

182the sandbox user needs in order to start the command.199the sandbox user needs in order to start the command.


1964. Send `CODEX_HOME/.sandbox/sandbox.log` along with your Windows version and a2134. Send `CODEX_HOME/.sandbox/sandbox.log` along with your Windows version and a

197 short description of the failure.214 short description of the failure.

198 215 

199Codex warns that some folders are writable by Everyone216 

217 

218 

219 

220 

221 

222### Codex warns that some folders are writable by Everyone

223 

200 224 

201Codex may warn that some folders are writable by `Everyone`.225Codex may warn that some folders are writable by `Everyone`.

202 226 


213 237 

214If you are not sure how to change those permissions, ask your IT team for help.238If you are not sure how to change those permissions, ask your IT team for help.

215 239 

216Sandboxed commands cannot reach the network240 

241 

242 

243 

244 

245 

246### Sandboxed commands cannot reach the network

247 

217 248 

218Some Codex chats are intentionally run without outbound network access,249Some Codex chats are intentionally run without outbound network access,

219depending on the permissions mode in use.250depending on the permissions mode in use.


2253. If the issue keeps happening, collect the sandbox log so the team can check2563. If the issue keeps happening, collect the sandbox log so the team can check

226 whether the machine is in a partial or broken sandbox state.257 whether the machine is in a partial or broken sandbox state.

227 258 

228Sandboxing worked before and then stopped259 

260 

261 

262 

263 

264 

265### Sandboxing worked before and then stopped

266 

229 267 

230This can happen after:268This can happen after:

231 269 


242 fallback.280 fallback.

2434. Collect the sandbox log for review.2814. Collect the sandbox log for review.

244 282 

245I need to send diagnostics to OpenAI283 

284 

285 

286 

287 

288 

289### I need to send diagnostics to OpenAI

290 

246 291 

247If you still have problems, send:292If you still have problems, send:

248 293 


260 305 

261- the contents of `CODEX_HOME/.sandbox-secrets/`306- the contents of `CODEX_HOME/.sandbox-secrets/`

262 307 

263The IDE extension is installed but unresponsive308 

309 

310 

311 

312 

313 

314### The IDE extension is installed but unresponsive

315 

316 

264 317 

265Your system may be missing C++ development tools, which some native dependencies require:318Your system may be missing C++ development tools, which some native dependencies require:

266 319 

windows/wsl.md +14 −2

Details

81 81 

82## Troubleshooting and FAQ82## Troubleshooting and FAQ

83 83 

84Large repositories feel slow in WSL84 

85 

86### Large repositories feel slow in WSL

87 

88 

85 89 

86- Make sure you're not working under `/mnt/c`. Move the repository to WSL (for example, `~/code/...`).90- Make sure you're not working under `/mnt/c`. Move the repository to WSL (for example, `~/code/...`).

87- Increase memory and CPU for WSL if needed; update WSL to the latest version:91- Increase memory and CPU for WSL if needed; update WSL to the latest version:


90 wsl --shutdown94 wsl --shutdown

91```95```

92 96 

93VS Code in WSL cannot find codex97 

98 

99 

100 

101 

102 

103### VS Code in WSL cannot find codex

104 

105 

94 106 

95Verify the binary exists and is on `PATH` inside WSL:107Verify the binary exists and is on `PATH` inside WSL:

96 108