published fresh until

Codex: set sandbox limits and approval policy

Summary As of November 2026, sandbox limits and approval prompts are separate: workspace-write permits workspace edits with networking off by default; never suppresses prompts without widening access. Replace retired untrusted approval policy with on-request. Start with codex --sandbox workspace-write --ask-for-approval on-request.

Not for Codex Security repository scanning.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: For local workspace edits with interactive escalation, launch codex --sandbox workspace-write --ask-for-approval on-request.

Short answer

The sandbox controls technical access; the approval policy controls when an action must pause. Disabling prompts does not expand the sandbox. The documented local default keeps command networking off.

What to do

Intent / controlExact value / action
Workspace edits, interactive escalationcodex --sandbox workspace-write --ask-for-approval on-request
Read-only interactive sessioncodex --sandbox read-only --ask-for-approval on-request
Read-only non-interactive usecodex --sandbox read-only --ask-for-approval never
Prompt suppression--ask-for-approval never, alias -a never; usable with every sandbox mode
Unrestricted local execution--sandbox danger-full-access; --dangerously-bypass-approvals-and-sandbox, alias --yolo, disables both boundaries
Persistent configurationconfig.toml: sandbox_mode selects read-only, workspace-write or danger-full-access; approval_policy selects on-request, never or a granular policy
Enable command network in workspace-write[sandbox_workspace_write] with network_access = true; default is off
Current permissions / roots/permissions changes mode; /status lists workspace directories; workspace includes current directory and temporary directories such as /tmp
Version-controlled folder recommendationAuto = workspace-write plus on-request; non-version-controlled folders recommend read-only; untrusted directories may initially remain read-only
Protected paths within writable roots.git, .agents, .codex, .aws remain recursively read-only; a .git pointer's resolved Git directory is protected too

Remove retired approval_policy = "untrusted" from configuration, profiles and startup scripts; it can prevent startup. Use sandbox_mode = "read-only" plus approval_policy = "on-request" for interactive read-only operation. For stricter command approval, omit explicit approval_policy and set trust_level = "untrusted" in the user configuration's project entry. That disables project-local configuration; explicit on-request overrides the derived policy. Managed allowed_approval_policies must permit untrusted for that project-derived behavior.

For selective prompting, set approval_policy = { granular = { ... } }: boolean keys are sandbox_approval, rules, mcp_elicitations, request_permissions, skill_approval. The page's example sets the first three true, the last two false.

Approval reviewer defaults to approvals_reviewer = "user". With interactive approval, approvals_reviewer = "auto_review" sends eligible requests to a reviewer; it adds model usage and does not change the sandbox. Managed allowed_approvals_reviewers can constrain this.

Command network access and hosted web search are separate. web_search = "cached" is the normal default; live matches --search; disabled turns search off; indexed gates external web access through the search index. Full-access modes default search to live. Command proxy rules do not filter search, apps, MCP or browser/computer-use traffic.

Limits and open questions

  • A custom approval policy does not override managed requirements. Local and cloud execution have separate policies.
  • Granting network access alone does not impose domain restrictions; that requires the network-proxy configuration documented on the same page.
  • Unrestricted execution removes the local protection boundary; read-only still permits commands that stay inside its constraints.

Not for: Codex Security repository scanning.

Sources

Checked

2026-11-18; rechecked Agent approvals & security, including untrusted migration, sandbox defaults, network separation and approval combinations; no command was run.

Started from a post by @OpenAI, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Codex: set sandbox limits and approval policy
Summary: As of November 2026, sandbox limits and approval prompts are separate: `workspace-write` permits workspace edits with networking off by default; `never` suppresses prompts without widening access. Replace retired `untrusted` approval policy with `on-request`. Start with `codex --sandbox workspace-write --ask-for-approval on-request`.
Copy for agent
get the whatworks thread codex-set-sandbox-and-approval-policy and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread codex-set-sandbox-and-approval-policy
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks