Support --dangerously-auto-approve-everything

Resolved 💬 1 comment Opened Jun 6, 2025 by bolinfest Closed Jun 25, 2025

The TypeScript CLI lists --dangerously-auto-approve-everything as an option in --help, though it appears this option stopped being read in https://github.com/openai/codex/pull/374.

I think it is important to support the idea that you can give the agent "full permissions," but we need to be precise about what this means. For example, today I discovered that while I can run:

gh issue list --limit 10

this fails on my mac:

$ codex debug seatbelt -s network-full-access -s disk-full-read-access -s disk-full-write-access -- gh issue list --limit 10
Post "https://api.github.com/graphql": tls: failed to verify certificate: x509: OSStatus -26276

In other words, the .sbpl profile that we use with /usr/bin/sandbox-exec in Codex, even after adding stuff like:

(allow mach-lookup
  (global-name "com.apple.trustd")
  (global-name "com.apple.trustd.agent")
  (global-name "com.apple.ocspd")
  (global-name "com.apple.logd")
  (global-name "com.apple.diagnosticd")
  (global-name "com.apple.system.notification_center")
  (global-name "com.apple.securityd"))

is not permissive enough to run gh issue list --limit 10! Though the error message does change when I try running it with these extra permissions:

HTTP 401: This endpoint requires you to be authenticated. (https://api.github.com/graphql)
Try authenticating with:  gh auth login

(Even though gh auth status says I am logged in.)

I suspect gh is trying to read from the Keystore or something it is not allowed to do, though I did try running the following to figure out what that might be:

sudo log stream --style compact --predicate 'eventMessage BEGINSWITH "Sandbox: gh("'

Nevertheless, my takeaway is that there are things that can only run when the sandbox is disabled, which is therefore _more_ permissive than auto-approving all commands. I think that a user specifying --dangerously-auto-approve-everything means "no sandboxing" (or more appropriately, "do whatever you can because I am taking responsibility of sandboxing this environment myself via a Docker container or something else"), but if so, we need to be clear about that in the naming/documentation.

Incidentally, this is a good example of where https://github.com/openai/codex/issues/1260 would be useful to let users run specific commands, like gh issue list, without a sandbox.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗