How to run codex so that it never prompts me

Resolved 💬 4 comments Opened Sep 28, 2025 by nikivdev Closed Oct 5, 2025
💡 Likely answer: A maintainer (dylan-hurd-oai, contributor) responded on this thread — see the highlighted reply below.

<img width="867" height="219" alt="Image" src="https://github.com/user-attachments/assets/f329668c-3484-4488-8c58-649848401b81" />

I want to avoid above. Because even if I press A here, it will prompt again for another command. I need dangerous accept mode like in claude code.

I run codex with these settings now:

codex --search --model=gpt-5-codex -c model_reasoning_effort="high" --sandbox workspace-write -c sandbox_workspace_write.network_access=true

Thank you.

View original on GitHub ↗

4 Comments

nikivdev · 11 months ago

Looking at --help, I think there must be a way to run codex dangerously. I just can't find the right flag.

muX1337 · 11 months ago

I run into approval issues with codex as well, this seems to be an existing issue only on windows in vscode.
My workaround at bottom but for the devs here some more informations:

The settings can be done in a config.toml:
`
approval_policy = "never"
sandbox_mode = "danger-full-access"

[projects.'e:\\path\\to\\directory\\without\\prompts']
trust_level = "trusted"

[projects.'e:\\path\\to\\directory\\with\\prompts']
trust_level = "trusted"
`

For one project it is working and for another not and when I check the sessions at %userprofile%\.codex somehow the approval policies is "approval_policy":"on-request" and I haven't found where vscode is changing this policy because now the workaround shows "approval_policy":"never" without any changes at all.

Workaround

Requirements: node.js installed and in path

  1. Start a cmd and navigate to the project folder
  2. install codex via npm npm i -g @openai/codex
  3. start codex via cli codex
  4. check approval via /status and if it not set to never change with /approval and sandbox should be set to danger-full-access

<img width="683" height="338" alt="Image" src="https://github.com/user-attachments/assets/5907804a-5801-4597-801d-f88c97cf626e" />

I hope this helps somehow and a fix so it works is vscode would also be great.

abra5umente · 11 months ago

I don't have time to read ~1k open issues - but I feel like this has been mentioned previously, and to get around it your best bet is to use WSL.

dylan-hurd-oai contributor · 10 months ago

Per the sandbox docs, the setting you're looking for is /approvals => Full Access:

<img width="862" height="481" alt="Image" src="https://github.com/user-attachments/assets/25dd0a99-4351-47ba-a369-8a6fa5f67f04" />

This is also available in the extension:

<img width="440" height="170" alt="Image" src="https://github.com/user-attachments/assets/c29aa584-f0d3-48a3-b968-8c98648bb685" />

As @abra5umente suggests, we do strongly recommend using WSL if you're on Windows, for improved sandbox guarantees.