Permission Modes: Ask for Approval, Approve for Me, and Full Access
One of the most important concepts in Codex CLI is its permission modes, which you can view and change with the /permissions command. They decide how much freedom the agent has when it works on your code. Knowing them well helps you use Codex safely and still move fast.
What You Will Learn
- The permission modes in Codex: Ask for approval, Approve for me, Full access, and Custom
- What each mode allows and what it still asks about
- How the sandbox and the approval policy work together
- How to switch modes during a session and from the command line
- How to choose the right mode for different tasks
Why Permission Modes Matter
When an AI agent can read files, write code, and run commands on your machine, you need clear control over what it can do without asking. Codex gives you a small set of modes, from "stay in this folder and ask before going further" to "do anything on this computer."
Choosing the right mode is about matching trust to the task. Exploring unfamiliar code or touching critical code calls for the most careful setup. A routine cleanup in a well-tested project, inside a throwaway container, can get more freedom.
Two Settings Behind Every Mode
Each mode is a mix of two settings:
- The sandbox decides what Codex can touch. The options are
read-only,workspace-write(edit files and run commands inside your project folder), anddanger-full-access(no limits). - The approval policy decides when Codex stops to ask you.
on-requestmeans it asks when it needs to go past the sandbox.nevermeans it never asks.
By default, network access is turned off inside the sandbox. Codex asks before it uses the internet.
Ask for Approval
Ask for approval is the recommended starting point. It uses the workspace-write sandbox with on-request approvals.
In this mode, Codex:
- Can read files, edit files, and run commands inside your current project folder without asking
- Must ask before editing files outside the project folder
- Must ask before running commands that need the internet
Example workflow:
You: "Add input validation to the login endpoint, then install zod and run the tests"
Codex: [edits src/routes/auth.js]
I need network access to install zod:
$ npm install zod
Allow? (y/n)
You: y
Codex: [runs: npm test]
All tests pass.
When to use Ask for approval:
- You are working on critical code (authentication, payments, data handling)
- You are learning what Codex can do
- The codebase is unfamiliar
- You want Codex to stay inside one folder
Want even more control? Use read-only
If you only want Codex to read and explain, switch to a read-only setup. Pick it in /permissions, or start Codex with:
codex --sandbox read-only --ask-for-approval on-request
Codex then asks before it edits any file or runs commands that change things.
Approve for Me
Approve for me keeps the same workspace-write sandbox as Ask for approval. The difference is who answers the questions. Instead of asking you, Codex sends eligible approval requests to automatic review. It only stops to ask you about actions that look unsafe.
Automatic review does not make the sandbox bigger. It only changes who reviews requests that would otherwise interrupt you.
When to use Approve for me:
- Longer tasks where frequent prompts slow you down
- Projects with good tests, so mistakes get caught
- Work you will review with
git diffwhen Codex is done
From the command line you can start in this mode with:
codex --approve-for-me "your task"
Depending on your app version, settings, and organization rules, this mode may be missing or turned off.
Full Access
Full access gives Codex unrestricted access to the internet and to any file on your computer. Use it with care.
In Full access, Codex can:
- Read and edit any file it can reach, not only your project
- Run any command without asking
- Use the internet freely
Codex handles the whole workflow end to end. It reads your code, makes changes, runs tests, fixes failures, and keeps going until the task is done.
Example workflow:
You: "Add error handling to all API endpoints, run the tests, and fix any failures"
Codex: [reads all route files]
[edits src/routes/users.js]
[edits src/routes/products.js]
[edits src/routes/orders.js]
[runs: npm test]
[sees 2 failing tests]
[edits src/routes/orders.js to fix the issue]
[runs: npm test]
[all tests pass]
Done. I added error handling to 3 route files.
2 tests failed at first because of a missing error status code.
I fixed it, and all tests now pass.
When to use Full access:
- The task is clear and you trust Codex to handle it alone
- You are inside an isolated container or virtual machine
- You have good test coverage that will catch mistakes
- The task is repetitive (fixing lint errors, adding boilerplate, updating imports)
Custom Permissions
Custom uses the permissions you define in config.toml. Teams use it to set their own sandbox and approval rules. For example, you can keep the workspace-write sandbox but turn network access on so Codex can install packages. You will see more about config.toml in the team workflows lesson.
Switching Between Modes
Inside a running session, type:
/permissions
Codex shows the available modes and lets you pick one. In the ChatGPT desktop app or the IDE extension, use the permissions control below the message box.
You can also set the sandbox and approval policy when you start Codex:
codex --sandbox workspace-write --ask-for-approval on-request "your task"
codex --sandbox read-only --ask-for-approval on-request "explain this project"
To make a setup your default, put it in ~/.codex/config.toml:
sandbox_mode = "workspace-write"
approval_policy = "on-request"
Note: Older guides show flags like --approval-mode or --full-auto. The current Codex docs do not use them. Use /permissions, --sandbox, --ask-for-approval, or --approve-for-me instead.
Safety Considerations
Ask for approval keeps Codex inside your project and offline unless you say yes. It is the safest place to start.
Approve for me saves time on long tasks. You still get asked about risky actions, but you see fewer prompts, so review the result afterward.
Full access is powerful but needs trust. Take these precautions:
- Always work in a git repository so you can revert changes
- Make sure your project has test coverage
- Do not use Full access on production systems
- Prefer an isolated container or virtual machine
- Review the changes after Codex finishes (use
git diff) - Start with smaller tasks before larger ones
A Practical Rule of Thumb
Here is a simple decision framework:
| Situation | Recommended Mode |
|---|---|
| Exploring unfamiliar code | Read-only or Ask for approval |
| Writing new features | Ask for approval |
| Refactoring with tests | Ask for approval or Approve for me |
| Fixing lint/format issues | Approve for me |
| Updating dependencies | Ask for approval |
| Writing tests for existing code | Ask for approval or Approve for me |
| Work inside an isolated container | Full access |
| Production hotfix | Ask for approval |
Key Takeaways
- Codex has permission modes: Ask for approval, Approve for me, Full access, and Custom (from
config.toml) - Change modes during a session with
/permissions - Each mode mixes a sandbox (what Codex can touch) and an approval policy (when it asks you)
- Ask for approval is the recommended starting point: Codex works inside your project and asks before going outside it or using the internet
- Approve for me keeps the same sandbox but sends eligible requests to automatic review
- Full access removes the limits, so save it for isolated environments
- Always work in a git repository so you can revert changes in any mode
Quiz
Up next ยท Lesson 4 of 11
Reading Codebases and Writing Code
5 min read
3 of 11 lessons done

Ask Byte about this lesson
A private chat about this lesson. Byte has read the whole lesson, answers in seconds, and shows the section each answer comes from. Ask follow-ups in any language.
Questions & Answers
Public questions about this lesson. The AI Tutor answers right away in your language, the FreeAcademy team checks answers, and every learner can read them.

