One command, one decision, plus internet access and keys
After this, you'll be able to sort approval requests into safe, inspect first, and reject categories, decide when network access is needed, keep secrets out of prompts, and switch off any permission you granted.
Complete Read sandbox mode before approving first.
Approval is a risk decision, not a mood. Codex asks because the command crosses a boundary. Not because the command is bad.
Low risk means reading local state or running a known test. Medium risk means installing a dependency, hitting the network, or touching a pile of generated files (files a tool writes for you). High risk means auth, billing, production data, deployment (publishing to the live site), secrets, destructive Git history (erasing the saved record of past commits), or anything outside the workspace.
Ask Codex to explain before medium or high risk. A real answer names why the command is needed and what it changes. A vague one means you reject it and ask Codex for a safer plan.
Three tiers, one rule each. Approve once by default. Approve for the session when you'll see the same prompt again soon, or add it to the allow list when you want it to skip the prompt for good.
That writes a persistent rule matched by prefix, so any command starting with the same words gets approved from then on, not just a session-only pass. Ask Codex Where is my allow list stored, and what is in it? to see what you have saved.
OpenAI's docs say the terminal version saves these rules in a rules file inside the .codex folder in your home folder. They don't say where the app shows the choice or a remove button.
Every permission needs a way back. To undo a rule you added by mistake, ask Codex: Show me the allow-list rules you saved and remove the one for [the command]. Then restart Codex, ask What is in my allow list now? and check the rule is gone. A session approval ends when you close the chat.
Network access is its own risk. A local test and a command that reaches the internet aren't the same risk, even when both feel routine. On your computer, Codex keeps the internet off for its commands by default inside workspace-write.
In Auto, Codex asks before any command that reaches the internet.
Approving usually lets that one command run outside the sandbox, so read what else it could do before you say yes, and approve that one command once. Change the network_access setting in the settings file only for a task with many such commands, then quit and reopen Codex, and turn it off the same way afterwards. Web search is separate, and its default setting is cached, which means saved results.
Why narrow beats open. A stray web page, package script, or issue comment can carry hostile instructions.
That trick is called prompt injection: text written to make Codex do something you didn't ask. Treat anything Codex reads online as untrusted.
In the cloud, choose the narrowest option. A cloud environment's Networks section offers public internet, package manager domains only, or extra allowed domains (a domain is a website address like npmjs.org).
Pick the package domains or your own short list. OpenAI's page doesn't restate the default, so open the section and check it. Cloud needs an eligible paid plan.
Secrets get the same discipline. A secret is a key or password a project needs.
Never paste one into a prompt, because a chat can be saved, shared, or copied into a file. Keep keys in a password manager (an app like 1Password that stores them safely), in a local .env file (a plain file on your computer that holds a project's keys), or in your cloud environment's secrets.
Ask Codex How do I store this key so it never enters the chat? before you do anything. Saving an HTTP secret (a password for one website address) in a cloud environment also allows access to its domains, so add only the ones you mean. Your own Codex sign-in file, auth.json, is a secret too.
If a key leaked, act in this order. A leak means the key appeared in a chat, a file you committed, or any output.
Don't commit that change, and ask Codex to undo it. Then revoke the key at the provider (the service that issued it), make a new one, and tell the person who owns the account so they can check its use.
A key that has appeared anywhere is spent.
Auto-review is a documented option, not the default. With Auto-review, a reviewer step looks at approval requests instead of you.
Each request shows as Reviewing, Approved, Denied, Aborted, or Timed out. You switch it on with approvals_reviewer set to auto_review in your settings file, and the default is user, meaning you.
Start with the default. If you try Auto-review, read the Denied and Timed out items, and keep deciding the high-risk ones yourself. To switch it off, set approvals_reviewer back to user and restart Codex.
In Claude Code and Antigravity: Claude Code and Antigravity both let you write Allow, Ask, and Deny rules, and a Deny rule wins over the others. Each tool has its own network and secret settings, so check its own guide. The habit is the same in all three: never paste a key into a prompt.
Let Codex reach only what the task needs, only for as long as it needs it. The goal is not to block Codex. It is to make every boundary crossing visible.
Paste this into Codex
Part 1. Classify these Codex approval requests: Commands or actions (no real prompts yet? Use these three examples. You're only classifying them, so don't run them: `npm test -- profile`, `npm install date-picker`, `rm -rf public/uploads`): 1. [paste request] 2. [paste request] 3. [paste request] For each, choose: - approve once - approve for session - ask for explanation - reject Give the reason and the follow-up proof you need. Part 2. Decide network and secret access for this task: Task: [describe task. No task? Use: update my shop's shipping rates from the carrier's public page.] Needs package install: [yes/no/unknown] Needs docs or web: [yes/no/unknown] Needs a key or password: [yes/no/unknown] Where it runs: [local, cloud] Return: 1. Whether network access is needed, and how to switch it back off afterward. 2. Which domains to allow if it is (a cloud environment only; on your own computer network is on or off). 3. How the key should be supplied without pasting it into the prompt. 4. What proof confirms no secret was exposed, and what I do if one was.
What a good response looks like
Part 1. npm test -- profile: approve once, it only runs a local check, and I need to see it pass. npm install date-picker: ask for explanation, it uses the internet and changes the package list, then approve once if the change is expected. rm -rf public/uploads: reject, it deletes a whole folder with no undo and is outside the task. Part 2. Network: needed only to read the carrier's public rates page, so approve that one network command once and nothing else. Limiting access to one site is possible only in a cloud environment's Networks section. Key: the carrier login stays in my password manager, never pasted in chat. Proof: search the diff and the output for any part of the key. If any shows up, do not commit. Revoke that key at the carrier, make a new one, and tell the account owner.
Check yours against
Use Codex to help you sort approval requests into safe, inspect first, and reject categories, decide when network access is needed, keep secrets out of prompts, and switch off any permission you granted. Start with the exercise prompt and your real input. Ask for one draft, then check it against this proof: Each request is classified by what it can affect. Accept only the version you can verify yourself.
You can classify read, write, network, and destructive actions
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.
Pick three things Codex could ask to do in your own project. Sort them from low to high risk and say what you'd check before saying yes to the riskiest. Then say what you'd do about any password the task needs.
One good answer: 'Choir ticket site. Read the show list: low. Fetch the venue's seat map from the web: medium, it goes online. Change where ticket payments go: high, it touches billing. Before yes, I'd ask what it changes and how to undo it. The venue login stays in my password manager.' Check yours: sign-ins, payments, passwords or keys, and live customer data are high. So are publishing, erasing the project's saved history of changes, and touching files outside the project folder.
Approve the effect, not the command name, and grant the smallest network and secret access that finishes the task. Every permission you give needs a way to take it back.