Codex can make unsafe host-system recommendations from sandbox-distorted execution context
(This is a safety/product bug, not only a distro-specific CLI bug. The reproduction
happened on Linux/CachyOS, but the issue is broader: Codex should not treat sandbox/
container/AppContainer/TCC/UAC/WSL-restricted observations as host truth without
explicit verification)
Summary:
Codex may observe the user’s machine through a sandbox, container, user namespace,
virtualization layer, restricted permission context, or app security boundary, then
incorrectly treat that view as authoritative host/system truth. This can produce
false findings about filesystem state, ownership, permissions, services, devices,
networking, credentials, package integrity, boot state, or OS health.
This is not limited to one Linux distro. It likely applies across Linux
distributions and may also apply across macOS, Windows, WSL, iOS/iPadOS, Android,
and other environments where Codex runs with a restricted or virtualized execution
context.
Example reproduction:
On a Linux VM, Codex saw:
- root-owned system files as uid/gid 65534 due to uid namespace mapping
- global mounts such as
/,/run, and/bootas read-only /bootas inaccessible- host auth state as broken or suspicious
Codex almost recommended recovery-style actions. Later checks showed the shell was
running inside a container/user namespace, while the host system was operating
normally.
Generalized risk:
Codex can confuse sandbox artifacts with host facts, including but not limited to:
Linux:
- UID/GID namespace artifacts such as root-owned files appearing as nobody/65534
- read-only or bind-mounted views of
/,/run,/boot,/sys,/proc,/dev - distorted output from service managers, package verification, bootloader checks,
journal access, mount checks, device checks, and permission checks
macOS:
- App sandbox and TCC permission limits affecting files, keychain, camera,
microphone, calendar, contacts, automation, and full disk access
- SIP, APFS snapshots, sealed system volume, and containerized app paths being
misread as host damage
- launchd/service visibility differing by user/session/context
Windows:
- UAC integrity levels, AppContainer, Defender-controlled folder access,
virtualization, reparse points, ACL restrictions, and per-user registry/file
virtualization
- WSL/Hyper-V/container views being mistaken for the Windows host
- service, driver, firewall, device, and credential-store checks reflecting a
restricted context
WSL:
- Linux userspace view being mistaken for Windows host state, or Windows mount/
permission translations being mistaken for corruption
- systemd, device, network, and filesystem behavior differing from native Linux
Mobile/locked-down OSes:
- iOS/iPadOS/Android app sandboxing, scoped storage, permission prompts, and
unavailable system APIs being mistaken for missing/damaged user data or OS
components
Impact:
This can lead Codex to provide confident but false guidance, including risky
recovery, repair, reinstall, permission-reset, ownership-reset, bootloader,
credential, firewall, package-manager, or filesystem advice. Users may take harmful
actions based on observations that are artifacts of Codex’s execution environment.
Expected behavior:
Codex should explicitly reason about and disclose its execution context before
making host/system-level claims. Any host-global diagnostic result obtained from a
sandboxed or restricted context should be labeled provisional unless verified from a
trusted host context.
Recommended product fixes:
- Display an execution-context banner for shell/tool use:
- OS/platform
- sandbox mode
- writable roots
- network policy
- effective user
- uid/gid mapping where applicable
- container/VM/namespace/AppContainer/TCC/UAC/WSL indicators
- whether commands are running in the host namespace or a restricted view
- Add automatic trust labels for diagnostics:
- host-verified
- sandbox-scoped
- permission-limited
- namespace-distorted
- unknown trust boundary
- Require stronger verification before high-risk recommendations:
- disk repair
- bootloader repair
- partition/filesystem recovery
- ownership/permission resets
- auth/credential resets
- package database repair
- service/driver/firewall repair
- OS reinstall/recovery mode guidance
- Linux uid/gid 65534/nobody ownership patterns
- inaccessible
/boot,/sys,/proc,/dev - service manager unavailable due to container/session scope
- macOS TCC/SIP/sandbox permission denials
- Windows AppContainer/UAC/ACL virtualization
- WSL path, mount, and service translation artifacts
- Make Codex ask for host-context verification before concluding host damage:
- “This may be a sandbox artifact. Please run this in a normal terminal/admin
shell.”
- or request explicit escalation through the product’s permission flow.
- Provide a built-in issue-report path:
- “Report unsafe sandbox-context inference”
- include command outputs, sandbox metadata, model response, and user correction
- redact secrets automatically
Core principle:
Codex must identify the observer boundary before diagnosing the system. A restricted
execution view is evidence about the sandbox first, and only provisional evidence
about the host.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗