Skip to content
handup
  • How it works
  • Pricing
  • Blog
  • Docs
  • GitHub
Download
handup · betaDownloads · Pricing · Agents · Compare · Blog · Changelog · llms.txt · API · Docs · GitHub · Support · Terms · Privacy

Blog

Codex --dangerously-bypass-approvals-and-sandbox

What Codex's --dangerously-bypass-approvals-and-sandbox (--yolo) flag does, when it is safe, and how to keep the sandbox and approve from your phone.

Ariel Frischer · November 20, 2026

ShareXLinkedInHacker NewsRedditBluesky

--dangerously-bypass-approvals-and-sandbox is Codex CLI's "turn everything off" flag. It skips every approval prompt and runs commands with no sandbox, so Codex can read, write and use the network anywhere your user account can. OpenAI's help text says it is "intended solely for running in environments that are externally sandboxed" (CLI reference). On your normal machine, the safer setup is to keep the sandbox on and send the few approval requests that do come up to your phone. That setup is below.

If you searched for "codex dangerously skip permissions": that is the Claude Code flag name. Codex 0.167.0 doesn't have it, and codex --dangerously-skip-permissions fails with unexpected argument. The Codex equivalent is the flag in this article's title, and --yolo is its alias.

What the flag does

Codex has two separate controls. The sandbox mode is what Codex can do technically. The approval policy is when it has to stop and ask you. The bypass flag turns both off at once. In the docs' table of common sandbox and approval combinations it is the row called "Dangerous full access": no sandbox, no approvals, "not recommended".

It is the same as setting two things yourself. Full access means sandbox_mode = "danger-full-access" together with approval_policy = "never":

toml
# ~/.codex/config.toml: same effect as the bypass flag
sandbox_mode    = "danger-full-access"
approval_policy = "never"

Two side effects people miss. With --yolo or any other full-access setting, web search defaults to live results instead of the cached index, and the docs warn about prompt injection from live pages. And there is a separate flag, --dangerously-bypass-hook-trust, which skips the hook trust check. Its help text says it is for automation that already vets hook sources. Don't confuse the two.

The flags that look similar

What you typedWhat it isStatus in Codex 0.167.0
--dangerously-bypass-approvals-and-sandboxNo approvals, no sandboxCurrent. Listed in codex --help
--yoloAlias for the flag aboveListed as an alias in the approvals docs. The CLI accepts it, though --help doesn't list it
--sandbox danger-full-accessNo sandbox, approval policy unchangedCurrent. Pair with -a never for full access
--ask-for-approval neverNo prompts, sandbox unchangedCurrent. Works with every sandbox mode
--full-autoOld low-friction presetRemoved. The non-interactive docs say to use --sandbox workspace-write or --approve-for-me
--dangerously-skip-permissionsClaude Code's flagNot a Codex flag. Rejected by the CLI

--approve-for-me routes approval requests to an automatic reviewer instead of you, inside the workspace-write sandbox (codex --help; auto-review docs). It is a real middle option, but the decisions are made by a model, not by you.

When bypassing is reasonable

The docs are consistent about this. --sandbox danger-full-access should be used only in a controlled environment, such as an isolated CI runner or container. The CLI reference says to avoid the bypass flag "unless you are inside a dedicated sandbox VM" (developer commands). There the isolation is the boundary, and Codex's own sandbox only gets in the way.

On the laptop where your SSH keys, cloud credentials and personal files live, a bypass run has no boundary left. The protected-path rules that keep .git, .codex and .aws read-only are part of the sandbox, so as far as I can tell they go away with it.

Compare the modes

ModeFlagsAsks you?SandboxFits
Auto preset--sandbox workspace-write --ask-for-approval on-requestWhen it needs to leave the sandbox, such as editing outside the workspace or using the networkOnDaily work in a git repo
Read-only--sandbox read-only --ask-for-approval on-requestOn anything outside the sandboxOn, read-onlyReading and planning
Auto-reviewAuto preset plus -c approvals_reviewer=auto_reviewA reviewer agent handles eligible requestsOnFewer interruptions, a model decides
Read-only CI--sandbox read-only --ask-for-approval neverNeverOn, read-onlyUnattended analysis
Full access--dangerously-bypass-approvals-and-sandbox (--yolo)NeverOffAn already-isolated VM or container

Source for the rows: the common combinations table. Every value of both settings is covered in Codex approval policy and sandbox modes, explained.

A safer middle ground: keep the sandbox, approve from your phone

Most people reach for the bypass flag because approval prompts block a terminal they aren't looking at. That is a routing problem. You don't have to remove the sandbox to fix it.

handup is a local approval inbox. It installs a Codex PermissionRequest hook, so when Codex is about to ask you for approval, the request goes to handup instead. You see the command, and approve or deny it from the desktop app, the Android app or a browser on your phone. Codex keeps its sandbox the whole time.

sh
curl -fsSL https://github.com/gethandup/handup/releases/latest/download/install.sh | sh
handup setup                              # install the service, connect detected agents
handup integrate codex --dry-run          # preview the Codex config changes
handup integrate codex                    # install the hook and MCP server
codex --sandbox workspace-write --ask-for-approval on-request

Codex asks you to review the new hook the first time. Approve it in Codex. handup integrate codex --uninstall removes both the hook and the MCP entry. For the phone, run handup remote tailscale on the computer, then handup pair and scan the code (phone setup).

A deny can carry a reason, for example handup deny ID -m 'Use staging instead', and Codex receives it as the decision message. These commands come from the handup Codex docs; the Codex setup guide has the full flow.

The limits, stated plainly:

  • The hook only runs when Codex actually asks for permission. Commands the sandbox already allows never reach handup.
  • If handup isn't reachable, Codex falls back to its own prompt. handup never approves in its place.
  • Under the bypass flag, Codex asks for nothing, so there is nothing to forward. handup and --yolo don't combine.
  • codex exec can't pause for approval. handup's docs found that it forces the approval policy to never (tested on Codex 0.159.2), so use the interactive CLI.

handup costs $30 one time after a 14-day trial with no account or card. It runs on your machines, and it isn't open source. Download handup to try it.

Fewer prompts without bypassing

If the real complaint is "too many prompts", change the sandbox, not the whole policy. The workspace-write sandbox keeps network access off unless you set sandbox_workspace_write.network_access = true. --add-dir gives write access to one extra directory, which the CLI reference prefers over --sandbox danger-full-access. Codex rules let you decide which commands may run outside the sandbox.

FAQ

Is --yolo the same as --dangerously-bypass-approvals-and-sandbox?

Yes. The approvals docs list --yolo as the alias for the bypass flag. Both mean no sandbox and no approvals.

Does Codex have --dangerously-skip-permissions?

No. That is a Claude Code flag, and Codex 0.167.0 rejects it. Codex splits the idea into --ask-for-approval never (no prompts) and --sandbox danger-full-access (no sandbox), and the bypass flag sets both.

Is --full-auto still a thing?

No. The non-interactive docs say it is no longer supported. Use --sandbox workspace-write, or --approve-for-me for automatic review.

Can I get approval prompts on my phone while Codex runs?

Yes, as long as you don't bypass approvals. With on-request, Codex asks when it needs to go beyond the sandbox, and a hook-based inbox like handup forwards those requests. With never or --yolo, Codex never asks.

Is it safe in Docker or a VM?

That is the case OpenAI's docs describe: the container or VM is the boundary. Check what it can reach: mounted volumes, network, and credentials in environment variables.

ShareXLinkedInHacker NewsRedditBluesky

Related

  • Codex setup guide
  • Codex approval policy and sandbox modes, explained
  • Download handup
  • Docs: Codex
  • OpenAI: Agent approvals and security

Try handup free for 14 days

No signup. After the trial, a personal license is $30 USD one-time plus tax where applicable, with all future released updates.

Download handupSetup guidesMore posts