bug: Codex CLI crashes with sandbox-exec ENOENT on macOS if sandbox-exec is not in PATH
Resolved 💬 1 comment Opened Apr 23, 2025 by The-Obstacle-Is-The-Way Closed May 1, 2025
Bug Description
When running the Codex CLI on macOS, if the sandbox-exec binary is not available in the system's PATH, the tool crashes with the following error:
Error: spawn sandbox-exec ENOENT
This occurs because the CLI attempts to use the macOS Seatbelt sandbox feature (sandbox-exec) for security, but fails if the executable cannot be found.
Proposed Solution
The CLI should check for the existence and executability of sandbox-exec before attempting to use the MACOS_SEATBELT sandbox type. If sandbox-exec is not available, it should log a warning and gracefully fall back to running commands without sandboxing (SandboxType.NONE).
Pull Request
A fix for this issue has been proposed in Pull Request #590: https://github.com/openai/codex/pull/590
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗