Ask Codex (new session)
codex_askRun hard reasoning or real coding tasks with OpenAI Codex in a sandboxed session, then continue the thread. Read-only by default; set sandbox="workspace-write" to allow file edits.
Instructions
Best for the hardest reasoning and real code work, behind a REAL OS sandbox (OpenAI
Codex, codex exec), in a NEW session. Pass workspace=; without it the
sub-agent sees no repo. Follow up with codex_continue. Uses your Codex login
(ChatGPT or API key). Read-only by default; sandbox="workspace-write" lets it edit.
On Windows the bridge flags refused commands and a silent read-only downgrade with
an [agent-intern] WARNING in the answer: treat such an answer as unsourced.
Autonomous agent: trusted prompts only.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"prompt": "<prompt>"
},
"name": "codex_ask"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| model | No | Optional model override (`-m`); omit to use codex's configured default. | |
| watch | No | If true, open a live "watch" view in your browser that streams codex's steps (reasoning, the commands it runs, file changes) from its `--json` event stream. codex still runs headless; the same final text is returned. Best-effort — if the browser can't open, the run completes normally. Default false. | |
| prompt | Yes | Question or instruction for Codex. | |
| sandbox | No | Filesystem policy, enforced by an OS sandbox: "read-only" (default: reads and answers, writes nothing), "workspace-write" (may edit files in the workspace), or "danger-full-access" (no sandbox, avoid). There is no approval gate, so this is the safety boundary. On Windows, workspace-write runs read-only unless `[windows] sandbox = "unelevated"` is set in ~/.codex/config.toml (see codex_status), and refused commands leave codex answering unsourced; the bridge appends an [agent-intern] WARNING in both cases. | read-only |
| timeout_s | No | Max seconds to wait for codex to complete. Default 180. | |
| workspace | No | Working root for the session (`-C`). Defaults to the server cwd. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |