Know the boundary Codex is working inside
After this, you'll be able to explain workspace-write, read-only, danger-full-access, and why approval policy is separate from sandbox mode.
Complete Make AGENTS.md useful first.
Sandbox mode says what Codex can touch. Approval policy says when it has to ask.
Those are two different controls, so read both before you trust a run. The sandbox is a fenced-off area Codex works inside.
| Ready | Needs work |
|---|---|
| Job fit | |
| The answer separates sandbox from approval | The task is still vague |
| Proof | |
| The command's effect is named | The result is assumed |
| Risk | |
| Low | Breaks when Codex can write outside the intended project because the sandbox boundary |
| Next move | |
| Continue | Clarify first |
Use Ready only when the proof is visible.
Read-only lets Codex look, not edit. Workspace-write lets it edit and run routine commands inside that boundary (here, workspace means your project folder, not a ChatGPT team account).
Danger-full-access drops the boundary, and OpenAI does not recommend it. Save it for an environment you isolated on purpose, such as a throwaway computer with nothing important on it.
Approval policy has three forms. On-request keeps Codex inside its boundary and stops it before anything riskier. The never policy skips every prompt, and granular sets a different rule per category instead of one blanket setting.
The safe default is the Auto preset: workspace-write with on-request approvals. OpenAI recommends it for a project kept under Git, so you can see and undo what changed. For a folder without Git, use read-only until you have turned it into a Git project (lesson 1, step 6).
Auto keeps Codex moving on normal edits. It still stops at the door for network access (reaching the internet) and for edits outside your project.
Where these settings live. Don't expect a sandbox picker in the app's message box, because OpenAI's documentation does not show one there or in the IDE extension. Ask Codex instead: What sandbox mode and approval policy are you running under?
Both are saved in Codex's settings file, ~/.codex/config.toml, as sandbox_mode and approval_policy. A slash command is a short command you type in the message box, starting with /. Only if you use the terminal version: type /permissions to switch modes, or /status to see the session's setup.
That is network access, so it needs your approval. A package is an add-on code library the project uses, also called a dependency.
Why it works: the After asks for both controls separately: the boundary and the reason for the prompt. Now you can approve once, or ask Codex to revise.
In Claude Code and Antigravity: Claude Code has permission modes you switch with Shift+Tab: Manual (reads only without asking), Accept edits, and Plan (writes a plan, no edits). Antigravity has presets named Request Review, Default, Auto, and Turbo. In both, the idea is the same: one setting for how far the agent reaches, and a prompt when it needs more.
Don't approve a command because it looks familiar. Approve it because you know the boundary it runs inside.
Paste this into Codex
Audit this Codex run before approving commands: Surface: [app, CLI, IDE, cloud] Sandbox mode shown: [read-only, workspace-write, danger-full-access, unknown] Approval policy shown: [on-request, never, granular, unknown] Command requesting approval: [paste command] Why Codex says it needs it: [paste reason] Return: 1. What the sandbox allows. 2. Why approval is being requested. 3. The safest response: approve once, approve for session (the same kind of request stops asking until you close this chat or start a new one), reject, or ask Codex to revise. No approval prompt in front of you yet? In the practice project, ask Codex: *First check whether a file named codex-sandbox-test.html exists in my Documents folder. If it does, stop. If not, save a copy of index.html there with that name.* That is outside the project, so it usually asks first. Paste the prompt it shows. Then choose. The prompt offers choices in general terms (approve once, approve for the session, or decline), and the exact labels can differ between versions. For this practice, decline, or approve once if you want to see the full flow. Approving writes one copy of index.html outside the practice project. To undo an approved copy, ask Codex: *Delete codex-sandbox-test.html from my Documents folder, only if you created it in this chat.* Then check it is gone: ask *Is there a file named codex-sandbox-test.html in my Documents folder?*, or look in the folder yourself. No prompt appeared? That can mean your settings let Codex write there without asking, or that it already made the copy. Check first: ask Codex *Is there a file named codex-sandbox-test.html in my Documents folder?* If it is there, ask Codex whether it made that file in this chat, and delete it only if the answer is yes. The delete also asks for approval, so approve once. Then ask *What sandbox mode and approval policy are you running under?* and audit that answer instead. If the answer shows danger-full-access, or approvals set to never, stop the practice and don't run anything else. OpenAI's pages show no app control for this, so ask Codex to show you the sandbox_mode and approval_policy lines in ~/.codex/config.toml and to change them to workspace-write and on-request. Approve that one edit, quit and reopen Codex, and ask again to check. In the terminal version, /permissions does the same. Don't ask it to install anything; the practice project doesn't need it.
What a good response looks like
Surface: app. Sandbox: workspace-write, so Codex can edit files inside codex-practice but not outside it. Approval policy: on-request, so it must ask before anything beyond that. Why it is asking: saving a copy of index.html in Documents writes outside the project folder, which workspace-write does not allow without your say-so. Safest response: approve once only if you want to see the flow, and delete the copy afterwards by asking Codex to remove it. Otherwise decline. Approving for the session would also cover later writes outside the project, which is wider than this one copy needs.
Check yours against
Use Codex to help you explain workspace-write, read-only, danger-full-access, and why approval policy is separate from sandbox mode. Start with the exercise prompt and your real input. Ask for one draft, then check it against this proof: The answer separates sandbox from approval. Accept only the version you can verify yourself.
You can explain sandbox mode
Pulling this out of your own head now is the part that actually moves it into long-term memory. Re-reading only feels like it does.
Without scrolling up, name the two separate controls that decide what Codex does. Then say what you'd set for a task on your own project and why.
One good answer: 'Sandbox is what Codex can reach, approvals are when it pauses. For tidying my newsletter site: workspace-write, and a pause before anything leaves the project folder.' If your answer treats them as two different dials, not one, you're there.
Sandbox and approvals are separate controls. Read both before you let Codex act.