Skip to content

Codex approvals are silently weaker when the bundled binary is unavailable #32

Open

Description

@anildukkipatty

The Codex adapter prefers the binary bundled with the pinned @openai/codex-sdk (0.155.1) and falls back to whatever codex is on PATH when that optional dependency is missing. The fallback is not capability-checked, and the two are not equivalent for approvals.

Measured on this machine, sandbox: read-only + approvalPolicy: "untrusted", same prompt through codex app-server:

binary shell command file change
0.155.1 (bundled) raises an approval raises an approval
0.135.0 (on PATH) runs with no approval raises an approval

So a user driven onto an older binary keeps the ask-permissions label and the "Approve each command and each file change" copy, while commands execute unprompted. The UI promises a gate that isn't there, which is the worst failure mode for a security control.

What to do

Probe once at init and cache per binary path:

  • Run the initialize handshake and keep the result. InitializeResponse.userAgent already carries the version ("gitbot/0.155.1 (Mac OS …)") and the client keeps it today for the v1 ReviewDecision spelling.
  • If the resolved binary cannot gate commands, either refuse to advertise per-tool approval (degrade the mode copy) or fall back to the SDK sandbox-only path — but say which, visibly, rather than downgrading in silence.
  • A probe that fails or times out must leave codex working, cached as failed, and not retried per session.

Also worth doing while in here: the SDK resolves its binary through @openai/codex/package.json → platform package → vendor/<triple>/bin/codex, and prepends vendor/<triple>/codex-path to PATH for the child. That directory holds the bundled rg. Omitting it degrades the agent's search with no visible symptom, so it is easy to get wrong and hard to notice.

Context and the full measurement set: docs/codex-permissions.md.

Activity

  1. added
    bug
    on Sep 29, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions