Skip to content

Codex App denies Docker Unix socket access while CLI allows it with same config #25076

Open

Description

@federico-vitale

What version of the Codex App are you using (From “About Codex” dialog)?

26.519.81530 (3178)

What subscription do you have?

Business

What platform is your computer?

Darwin 25.5.0 arm64 arm

What issue are you seeing?

Codex App and Codex CLI behave differently when accessing the local Docker Unix socket with the same user config, same project config, same working directory, and same Docker context.

In Codex CLI, the following command succeeds without approval:

docker ps --format '{{.Names}}'

In Codex App, the same command fails without approval:

permission denied while trying to connect to the docker API at unix:///Users/<user>/.docker/run/docker.sock

The Docker context points to that exact socket:

docker context show
# desktop-linux

docker context inspect "$(docker context show)" --format '{{json .Endpoints.docker.Host}}'
# "unix:///Users/<user>/.docker/run/docker.sock"

The socket exists:

ls -la /Users/<user>/.docker/run/docker.sock
# srwxr-xr-x@ ... /Users/<user>/.docker/run/docker.sock

/var/run/docker.sock is only a symlink to the same socket:

ls -la /var/run/docker.sock
# /var/run/docker.sock -> /Users/<user>/.docker/run/docker.sock

Both runtimes appear to load the same user config and project config, but the App still denies access to the Docker Unix socket without approval, while the CLI allows it.

What steps can reproduce the bug?

Environment:

  • macOS Apple Silicon
  • Codex CLI version: 0.134.0
  • Codex installed via Homebrew
  • Docker Desktop with context desktop-linux
  • Docker socket: unix:///Users/<user>/.docker/run/docker.sock
  • Project path: /Users/<user>/Documents/Dev/<project>

User config excerpt from ~/.codex/config.toml:

default_permissions = "default"

[permissions.default]
extends = ":workspace"

[permissions.project-workspace.network.unix_sockets]
"/Users/<user>/.docker/run/docker.sock" = "allow"

[projects."/Users/<user>/Documents/Dev/<project>"]
trust_level = "trusted"

Project config excerpt from <project-path>/.codex/config.toml:

approval_policy = "on-request"
default_permissions = "project-workspace"

[permissions.project-workspace]
extends = ":workspace"

[permissions.project-workspace.network]
enabled = true

[permissions.project-workspace.network.domains]
"*" = "allow"

[permissions.project-workspace.network.unix_sockets]
"/Users/<user>/.docker/run/docker.sock" = "allow"

Steps to reproduce:

  1. Open a terminal.
  2. cd /Users/<user>/Documents/Dev/<project>
  3. Start Codex CLI from that directory.
  4. Ask Codex CLI to run the following command without escalation:
docker ps --format '{{.Names}}'
  1. The command succeeds in Codex CLI without approval.
  2. Open Codex App in the same project directory.
  3. Ask Codex App to run the same command without escalation:
docker ps --format '{{.Names}}'
  1. The command fails in Codex App with:
permission denied while trying to connect to the docker API at unix:///Users/<user>/.docker/run/docker.sock
  1. If approval/escalation is granted in Codex App, the same command succeeds.

What is the expected behavior?

Codex App and Codex CLI should behave consistently when using the same user config, same project config, same trusted project path, same Docker context, and same permission profile.

Expected behavior: if Codex CLI can access the allowlisted Docker Unix socket without approval, Codex App should also be able to access it without approval.

Alternatively, if Codex App intentionally applies a stricter sandbox than Codex CLI, that difference should be documented or exposed clearly in diagnostics.

Additional information

Diagnostic information:

codex doctor --json run from <project-path> reports config loading successfully:

{
  "CODEX_HOME": "/Users/<user>/.codex",
  "config.toml": "/Users/<user>/.codex/config.toml",
  "config.toml parse": "ok",
  "cwd": "/Users/<user>/Documents/Dev/<project>",
  "model": "gpt-5.5",
  "model provider": "openai"
}

Sandbox helper details reported from the same project directory:

{
  "approval policy": "OnRequest",
  "codex-linux-sandbox helper": "none",
  "filesystem sandbox": "restricted",
  "network sandbox": "enabled"
}

When the same diagnostics are run from Codex App, the App can read both:

~/.codex/config.toml
<project-path>/.codex/config.toml

The issue does not appear to be caused by Docker context, missing Docker CLI, missing socket, or /var/run/docker.sock vs user Docker socket mismatch:

docker context inspect "$(docker context show)" --format '{{json .Endpoints.docker.Host}}'
# "unix:///Users/<user>/.docker/run/docker.sock"

ls -la /var/run/docker.sock
# /var/run/docker.sock -> /Users/<user>/.docker/run/docker.sock

The same command succeeds in Codex App after approval/escalation, so Docker itself is reachable. The failure only happens in the non-escalated Codex App runtime.

Activity

  1. added
    app
    on May 29, 2026
  2. added
    sandbox
    bug
    on May 29, 2026
  3. ibrahimcavdar commented on Jul 13, 2026

    @ibrahimcavdar

    I’m seeing the same App vs CLI mismatch on Windows.

    With this config:

    sandbox_mode = "danger-full-access"
    
    [windows]
    sandbox = "elevated"

    and after restarting Codex App, docker ps still fails in the App but works in Codex CLI.

    Error on docker ps:

    open C:\Users<user>.docker\config.json: Access is denied.
    permission denied while trying to connect to the docker API at npipe:////./pipe/docker_engine

    So this appears to affect Windows named pipe / Docker Desktop access too, not only macOS Unix sockets.

  4. u7515546016-star commented on Nov 23, 2026

    @u7515546016-star

    Bug: Linux ARM64 sandbox drops Docker group permissions; approval-based escalation hangs

    Environment

    • OS: Ubuntu 26.04 LTS (ARM64)
    • Hardware: Raspberry Pi 5
    • Kernel: 7.0.0-1023-raspi
    • ChatGPT Desktop: 26.1117.41037
    • Codex CLI: 0.171.0-alpha.13
    • Docker socket: /var/run/docker.sock
    • Docker group GID: 983

    Problem

    Docker commands previously worked in the local ChatGPT Work environment. They now fail with permission denied, although Docker works correctly in the regular Ubuntu terminal.

    The Codex Linux sandbox appears to lose supplementary group permissions, including membership in the docker group.

    Additionally, commands requesting execution outside the sandbox hang after the user approves the permission request.

    Steps to reproduce

    1. Verify Docker works on the host

    id
    ls -l /var/run/docker.sock
    docker ps

    Results:

    • User jaan (UID 1000) belongs to group docker (GID 983).
    • Docker socket permissions: srw-rw---- root docker.
    • docker ps succeeds.

    2. Run the same command through ChatGPT Work

    docker ps

    Result:

    Failed to create stream fd: Operation not permitted
    permission denied while trying to connect to the Docker API at unix:///var/run/docker.sock
    

    3. Inspect sandbox group membership

    /usr/lib/chatgpt/resources/codex sandbox -P docker-local /usr/bin/id

    Result:

    uid=1000(jaan) gid=1000(jaan) groups=1000(jaan),65534(nogroup),65534(nogroup),...
    

    The supplementary docker group (983) is missing.

    4. Test explicitly permitted Docker socket

    A named permissions profile was configured to allow /var/run/docker.sock.

    /usr/lib/chatgpt/resources/codex sandbox -P docker-local /usr/bin/docker ps

    Result:

    permission denied while trying to connect to the docker API at unix:///var/run/docker.sock
    

    5. Test approval-based execution

    Set local approval policy to OnRequest.

    Request execution of a simple id command outside the sandbox.

    The approval dialog opens, and the user clicks Allow. The operation then hangs indefinitely until manually cancelled.

    This also happens with docker ps.

    Additional diagnostics

    codex doctor reports:

    • Configuration successfully loaded.
    • Sandbox: restricted filesystem, network enabled.
    • Approval policy: OnRequest.
    • No critical installation failures.
    • User namespaces enabled.
    • AppArmor enabled.
    • No relevant kernel denial messages found during testing.

    Expected behavior

    The sandbox should either support explicitly authorized access to the Docker Unix socket or provide a functioning approval-based path for executing authorized commands outside the sandbox.

    Supplementary group permissions required for authorized socket access should be handled correctly.

    Actual behavior

    • Supplementary group IDs appear mapped to 65534 (nogroup).
    • Docker socket access fails even with an explicit permission profile.
    • Approval-based execution hangs after confirmation.
    • Regular host terminal Docker access works normally.

    Questions

    1. Is dropping supplementary Linux group permissions intentional?
    2. Is there a supported method to preserve the docker group inside the sandbox?
    3. Why does approved out-of-sandbox execution hang in the Linux ARM64 desktop environment?
    4. Is this a known regression in ChatGPT Desktop 26.1117.41037 or Codex CLI 0.171.0-alpha.13?

    No Docker socket permissions or host security settings were modified.

    The experimental permissions profile was removed, and the original configuration was restored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions