Skip to content
Agentic Levels
Start hereLevelsTracksPromptsAbout
Get my levelGet my level

  • Start hereYour first useful task with AI.
  • Level quiz8 questions. No AI needed.
  • Fluency ScoreYour Level and a score, from your own AI.

  • LevelsThe 11 levels, in order.
  • LessonsShort lessons, filter by level.
  • TracksGuided paths by tool, role or goal.
  • Set up your AI tool
  • Starter packFree files that help AI remember.

  • PromptsReady prompts to copy and adapt.
  • ChatGPT vs Claude vs GeminiPick the right one for the job.
  • How-tos
  • ReferenceCommands for Claude Code, Codex, Antigravity.
  • ResourcesHand-picked reading and tools.

  • Your progress
  • Your next moveAn interview that picks your next skill.
  • Your next lessonsThe next lessons at your level.
  • Updates

  • Pricing
  • About
  • FAQ & Feedback
  • Work with us
  • How we handle your data
Sign inPreferences
AboutPricingHow-tosPromptsStarter packMy stackHow we handle your data

© 2026 Fuentes Studio

PrivacyTermsRefundsAccessibilityAI content policyCredits
yourCouncil
Ready to help
✦

What do you want to understand?

Ask anything about what you're learning.

←Codex Fundamentals
  1. Tracks
  2. ›Codex Fundamentals: Module 3
  3. ›Read sandbox mode before approving
4

Level 4 · Lesson 4 of 12 · Free

Read sandbox mode before approving

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.

Before you start

Complete Make AGENTS.md useful first.

The idea

Sandbox mode says what Codex can touch. Approval policy says when it has to ask.

Worked example

Before and after

Before: Yes (you approved a prompt without reading it). After: Before I approve this, what does the sandbox let you do, and why does this command need approval?

What the AI might say

The sandbox is workspace-write, so I can edit files in this project. This command installs a package from the internet.

Those are two different controls, so read both before you trust a run. The sandbox is a fenced-off area Codex works inside.

Approval SplitUse the Ready lane when The answer separates sandbox from approval.
ReadyNeeds work
Job fit
The answer separates sandbox from approvalThe task is still vague
Proof
The command's effect is namedThe result is assumed
Risk
LowBreaks when Codex can write outside the intended project because the sandbox boundary
Next move
ContinueClarify 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.

Try it (12 min)

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

  • The answer separates sandbox from approval
  • The command's effect is named
  • Network or outside-workspace access is treated as higher risk
  • The safest approval scope is selected (approve once is the default, and lesson 5 covers the rest)
  • Confusing no approval prompts with no risk.
  • Using danger-full-access because a task is blocked once.
  • Approving network access without knowing why it is needed.
  • Approving for the session when one command would be enough.
  • Looking for a sandbox picker in the app. Ask Codex what it is running under instead.

When this breaks

  • Breaks when Codex can write outside the intended project because the sandbox boundary was loosened too far.
  • Breaks when approval policy is set to never for an interactive high-risk task.

AI can help with this

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 now

✓

You can explain sandbox mode

  • ✓You can explain approval policy
  • ✓You can name the Auto preset
  • ✓You can classify a command by risk
  • ✓You can choose the narrowest useful approval

Try it from memory

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.

Key takeaways

Sandbox and approvals are separate controls. Read both before you let Codex act.

  1. 1Sandbox mode defines technical reach.
  2. 2Approval policy defines when Codex pauses.
  3. 3The Auto preset, workspace-write with on-request, is the normal local work boundary for a Git project.
  4. 4Danger-full-access needs an isolated environment.
  5. 5Ask Codex what it is running under. The app shows no sandbox picker in the message box.

Go deeper

  • Codex sandboxingdevelopers.openai.com (opens in a new tab) ↗
  • Agent approvals and securitylearn.chatgpt.com (opens in a new tab) ↗
Up nextApprove commands by risk, and guard network and secrets→

Was this helpful?

Related lessons

Define the Blast RadiusApprove commands by risk, and guard network and secrets
← Back to Codex Fundamentals