macOS: approved require_escalated browser tests remain sandboxed when filesystem read denies are active
What version of the IDE extension are you using?
vscode
What subscription do you have?
Pro
Which IDE are you using?
VSCode
What platform is your computer?
Mac os
What issue are you seeing?
Summary Codex cannot run our automated Electron browser test with the current filesystem protections retained. A command-specific allow rule and an explicit require_escalated request do not enable execution outside Seatbelt.
The implementation deliberately preserves denied-read restrictions, but the resulting execution path provides no clear explanation that escalation was not applied. This led to repeated unsuccessful configuration changes.
We need a supported way to run an approved browser test automatically while retaining filesystem protections.
Environment
- macOS, Apple Silicon
- Codex CLI: 0.157.1
- Electron: 44.4.5
- Python: 3.14.6
- Custom permission profile selected through default_permissions
- Filesystem policy includes workspace writes and explicit denied-read paths/globs
- Network access enabled
What steps can reproduce the bug?
Reproduction
- Select a restricted filesystem profile containing explicit deny entries.
- Add a user-layer rule: prefix_rule( pattern = [["python", "python3"], "CoreDev/planner/tests/browser_smoke.py"], decision = "allow", justification = "Run the real Electron browser smoke test.", match = ["python3 CoreDev/planner/tests/browser_smoke.py"], )
- Restart Codex.
- Request the command directly through exec_command with: { "cmd": "python3 CoreDev/planner/tests/browser_smoke.py", "sandbox_permissions": "require_escalated" }
- The Python test starts a local HTTP server and launches Electron against it.
What is the expected behavior?
Expected behavior Codex should support an explicitly approved browser execution path that retains filesystem denies. If that combination is unsupported, it should return a clear error before execution, explaining that denied-read restrictions prevent the requested escalation. Actual behavior The command runs without an approval prompt, but remains sandboxed. Observed failures across attempts:
- Earlier Electron launches exited with -6 (SIGABRT).
- Later launches exceeded the test’s 120-second subprocess timeout.
- During timeout cleanup, Python remained waiting in waitpid until interrupted; the interrupted command exited 130.
- An empty Electron profile directory was created.
- electron-phases.log was never created, so the test’s script-loaded marker was not reached or recorded. The repository owner reports that the same Electron binary and test passed when run outside Codex’s sandbox through another agent. Troubleshooting already performed
- Used direct exec_command calls, rather than nested Code Mode execution.
- Explicitly requested require_escalated.
- Added command-specific user-layer allow rules and restarted.
- Removed ELECTRON_RUN_AS_NODE from Electron’s child environment.
- Removed uppercase and lowercase HTTP_PROXY, HTTPS_PROXY, ALL_PROXY, and NO_PROXY.
- Added Electron’s --no-proxy-server argument. The browser test still failed. Relevant implementation In codex-rs/core/src/tools/sandboxing.rs:
- sandbox_override_for_first_attempt returns NoOverride when denied-read restrictions are present, before considering an allow rule or escalation.
- sandbox_permissions_preserving_denied_reads converts RequireEscalated to UseDefault under that condition. This explains why requesting escalation does not remove Seatbelt. It does not establish the exact macOS operation causing Electron’s abort or hang. We do not yet have a denial trace conclusively tied to the failing launch.
Additional information
Requested resolution
- Clearly report the effective execution permissions when an escalation request cannot be honored.
- Provide actionable diagnostics instead of allowing a browser launch to abort or hang without an explanation.
- Support narrowly scoped browser/GUI permissions while retaining filesystem read denies.
- Clarify the denied-read exception in the documentation for prefix_rule(decision="allow") and require_escalated. Disabling the sandbox or requiring the owner to run every browser check manually does not meet the automated workflow’s requirements.
Related reproduction regarding just file access, on Linux (Btrfs), Codex CLI 0.161.0 (bwrap), with this permission profile selected:
[permissions.safe-workspace]
extends = ":workspace"
[permissions.safe-workspace.filesystem]
":root" = "deny"
":minimal" = "read"
"~/.codex/packages/app-server-daemon/" = "read"
[permissions.safe-workspace.filesystem.":workspace_roots"]
"." = "write"
git add fails creating .git/index.lock with “Read-only file system”, even after an explicit sandbox_permissions: "require_escalated" request and manual approval in the CLI.
Running findmnt -T .git confirms:
- Normal execution: a separate read-only mount at
<repo>/.git. - Explicitly escalated and approved execution: the same read-only mount.
- Outside Codex: the ordinary read-write
/homemount.
Changing only ":root" = "deny" to "read" restores successful approved Git operations. Removing that rule also fixes it.
I understand preserving read denials, but this also prevents approving writes to otherwise readable paths. At minimum, the approval UI should explain which restrictions remain.
A broader feature suggestion: independently configurable permission profiles for normal and approved/escalated execution, covering filesystem and network access, possibly more. Approval would explicitly switch profiles. This would allow .git to change from read-only to writable, selected paths from denied to readable/writable, and other paths to remain denied or read-only in both profiles.
Related: #38318.
This is really a PITA, any update from contributors?
Additional sanitized desktop reproduction with a newer bundled runtime. Please triage this with the Codex core/exec-server maintainers; the release CODEOWNERS identifies openai/codex-core-agent-team for those components.
Verified environment
- Installed desktop application: 26.1106.51428, build 26605, bundle
com.openai.codex. - Bundled Codex package metadata: 0.167.0-alpha.4.1.
- macOS 26.6.2, Apple Silicon.
- Playwright 1.62.1.
- Filesystem credential-directory and environment-file read denials are retained.
Installed-package metadata is verified; the exact live executor binary/source correspondence was not independently measured. The matching release tag resolves to d2c035639366e0bf2c316aa2065c24aabc12bcdc.
Observations
- Normal and reviewed
require_escalatedChromium runs fail before opening a page:
bootstrap_check_in org.chromium.Chromium.MachPortRendezvousServer.<pid>:
Permission denied (1100)
- A read-only
sandbox_check(getpid(), NULL, 0)probe through reviewed execution returns 1. Sandbox presence alone is not claimed as a defect; retaining file-read denials requires enforcement. - An independent stale task-ownership lease was repaired and its exact approval canary passed. A fresh reviewed browser attempt still produced the Chromium failure above, separating that ownership problem from browser startup.
- Earlier preview identity/page/asset checks passed. In a later turn, the declared network mode is restricted: localhost resolves, but both
localhostand numeric loopback connections to the existing preview return EPERM, while GitHub hostname resolution fails in command execution. GitHub connector reads still work. - No standard proxy environment variables are present in either login or non-login command shells. Saved configuration enables the managed proxy and permits localhost, but that does not establish the turn's effective grants. These observations do not prove a machine-wide DNS failure or that restricted networking should have been overridden.
Version-pinned source findings
- orchestrator.rs retains the network policy when widening approved filesystem access.
- unified_exec.rs already normalizes denied-read escalation before choosing its managed proxy.
- The release's macOS base policy is deny-default and has no Chromium Mach-registration allowance.
These paths are consistent with the observations; the actual incoming executor parameters, selected-mode mapping and generated policy remain unverified.
Requested resolution
Please identify the effective host/policy layer and provide a supported scoped network/browser execution path that retains credential/environment-file denials, network filtering and task boundaries. If that combination is unsupported, return a precise capability error before launching a crashing browser.
Acceptance includes four pending local-page rendered checks at 768 / 1280 / 1440 / 1920, with their existing copy/geometry/media/header/overflow assertions and screenshots retained. No permission relaxation, alternate proxy, installed-app patch, merge or deployment was used. Private paths, session identifiers, raw transcripts, credentials and project contents are excluded from this report.
Related symptom reports: #21292, #32848 and #60822.