Skip to content
AgentAtlas

Codex CLI: approval and sandbox modes (and what --yolo does)

How do I make Codex run commands without asking?

Codex combines an approval policy (--ask-for-approval: on-request or never) with a sandbox (--sandbox: read-only, workspace-write or danger-full-access). --dangerously-bypass-approvals-and-sandbox, alias --yolo, removes both. Use /permissions in a session to change them.

Compare: allow all commands in every AI coding agent →

Sandbox modes

  • workspace-write (default in version-controlled folders; others start read-only): read files, edit the workspace and run commands; edits outside it and network access need approval.
  • read-only: read files and run commands within sandbox limits.
  • danger-full-access: no sandbox. Not recommended.

Approval policy

  • on-request: you approve actions that go outside the sandbox.
  • never: no approval prompts.

~/.codex/config.toml

approval_policy = "on-request"
sandbox_mode = "workspace-write"

Hands-off without --yolo

--full-auto has been removed from codex exec. For unattended runs, Codex recommends codex exec with --sandbox workspace-write, which keeps the sandbox while skipping prompts for work inside the workspace.

Sources

More Codex guides

Reviewed Oct 18, 2026. Settings change often; the linked vendor docs are the source of truth.

Built an MCP server? Get it listed everywhere →

Shipping an Android app? Google Play needs 12 testers for 14 days first. Get them with Tester Exchange →