Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): full access no longer stops on dangerous command prompts #39044

ClosedRhysSullivan(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/39044/headopened View on GitHub

Problem

Since #37104, Full access starts Codex turns with a granular approval policy (only mcp_elicitations on) instead of never. Codex still sends item/commandExecution/requestApproval under that policy for commands its heuristic flags as dangerous, such as rm -rf <dir>: with sandbox_approval: false it lets a dangerous-command prompt through instead of rejecting it (allow_dangerous_command_prompt in codex-rs/core/src/exec_policy.rs). T3 shows that as a pending approval, so a Full access thread, including delegated child tasks, stops and waits for a person. Under never, Codex refused these commands outright.

Fix

When a turn runs with the Full access defaults (no approvalPolicy or sandboxPolicy override), the command approval handler answers accept at once and creates no approval request. This matches how the MCP elicitation handler already treats Full access. A turn with an explicit override still shows the prompt. File change and permission requests are unchanged: Codex does not send them to T3 under this policy.

Verification

  • Found on the nightly: a Full access Codex child ran git, tar and bun install without prompts, then stopped on an approval request for rm -rf of its own temporary directory. Its provider log showed the granular approvalPolicy with sandboxPolicy: dangerFullAccess.
  • New test in CodexAdapterV2.test.ts: with the Full access defaults it expects an immediate accept and no pending request. On main it fails with Full access must not wait for a command approval. With an on-request override, the prompt is still presented.
  • vp run check:changed passes (format, lint, knip, graphql, typecheck, tests).
  • Runtime transcript against a real Codex 0.169 app-server, sending the exact turn policy T3 sends:
-> turn/start {"approvalPolicy":{"granular":{"mcp_elicitations":true,"request_permissions":false,"rules":false,"sandbox_approval":false,"skill_approval":false}},"approvalsReviewer":"user","sandboxPolicy":{"type":"dangerFullAccess"}}
<- item/commandExecution/requestApproval command="/bin/bash -lc 'rm -rf /tmp/codex-probe-XXXX/scratch'"
-> {"id":0,"result":{"decision":"accept"}}
<- item/completed commandExecution status=completed exitCode=0
<- turn/completed status=completed
scratch directory still exists: false
    1. tanstack-source added labelsbug

    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. This has been a draft with no activity for more than three days, so it is being closed: the open pull requests are kept to work that is ready to be looked at.

      Nothing is lost, the branch stays. When the work is ready, open a new pull request for it; this one will not be reopened.

    4. juliusmarminge closed this

Sign in to join this conversation.