Skip to content

Changing /permissions to Ask for approval leaves sandbox_approval=false #52458

Open

Description

@adamducken

Summary

Selecting /permissions → Ask for approval in an active session prints
Permission selection requested: Ask for approval, but subsequent sandbox
escalation requests still fail immediately with sandbox_approval: false.
No approval prompt appears. Selecting Approve for me also leaves the same
effective granular policy in the rejection.

This may be a live permission-update issue or an enforced execution-host policy;
the latter has not been ruled out. It would help if the permission picker showed
when a requested profile cannot become the effective execution policy.

Environment

  • Codex CLI: 0.162.0 (confirmed by the user with codex --version).
  • Agent execution host: Linux 6.1.0-53-amd64.
  • Shell: zsh.
  • Initial session sandbox: workspace-write.
  • No approval/sandbox override found in the accessible user config.toml.
  • No /etc/codex/requirements.toml found on the agent execution host.
  • Other managed policy sources and client/server configuration have not been inspected.

Steps to reproduce

  1. In an existing session where shell escalation is rejected by a granular policy,
    run /permissions.
  2. Select Ask for approval.
  3. Observe Permission selection requested: Ask for approval.
  4. Ask the agent to fetch Rust dependencies using cargo fetch with
    sandbox_permissions: "require_escalated" and a user-facing justification.
  5. Observe the immediate rejection below, without an approval prompt.
  6. Select Approve for me and retry: the same effective granular policy is reported.

Expected behavior

If the selected profile is allowed, it should apply to subsequent tool calls in
the active session. Ask for approval should surface a request for an eligible
sandbox escalation. If a managed or host policy blocks that profile, the client
should clearly say it was not applied and identify the effective restriction.

Actual behavior

The tool reports the original granular policy and refuses to request approval:

approval policy is Granular(GranularApprovalConfig { sandbox_approval: false, rules: false, skill_approval: false, request_permissions: true, mcp_elicitations: true }); reject command — you cannot ask for escalated permissions if the approval policy is Granular(GranularApprovalConfig { sandbox_approval: false, rules: false, skill_approval: false, request_permissions: true, mcp_elicitations: true })

The rejected tool call was:

{
  "cmd": "cargo fetch",
  "sandbox_permissions": "require_escalated",
  "justification": "May I download GPUI Kit and the remaining Rust dependencies to build the prototype?",
  "prefix_rule": ["cargo", "fetch"]
}

Ordinary shell calls remain restricted: crates.io DNS resolution fails, and
connecting to the Docker daemon socket returns operation not permitted.

Additional context

Official documentation says /permissions changes the active permissions profile
and that approval_policy.granular.sandbox_approval = true allows sandbox
escalation prompts:

Restarting/resuming with explicit on-request flags has been suggested but has
not yet been tested. No fresh-session reproduction or session diagnostics are
available yet.

Activity

  1. added
    bug
    CLI
    sandbox
    on Oct 9, 2026
  2. etraut-openai commented on Oct 9, 2026

    @etraut-openai
    Contributor

    (response from codex)

    Thanks for the report. We need logs to determine why the selected permissions didn’t take effect.

    The next time this occurs, please run /feedback immediately after the failed escalation and mention this issue (#52458). Please also note whether the retry happened during the same running turn or after starting a new one.

  3. shokobeeee commented on Oct 16, 2026

    @shokobeeee

    I am seeing similar symptoms: selecting “Ask for approval” shows “Permission selection requested”, but escalation requests are rejected with sandbox_approval:false without an approval prompt. The cause is not yet confirmed.

    Codex CLI version: 0.163.0. App-server version: 0.163.0.

    /feedback confirmed “Feedback uploaded”. Uploaded thread ID: 01a14476-eaaa-75c3-bedb-26664581c48f.

  4. manwhatcanisay11 commented on Oct 16, 2026

    @manwhatcanisay11

    Additional Windows desktop evidence related to #52458.

    Classification: execution-host approval capability blocker, not a newly observed USB/HID failure.

    Observed in this session

    • The user reports selecting Ask for approval in the desktop's native permissions menu and seeing it selected.
    • Subsequent platform-provided instructions still specify approval_policy=granular, with sandbox_approval=false, rules=false, skill_approval=false, request_permissions=true, and mcp_elicitations=true.
    • The available request_permissions API exposes filesystem/network grants, not an approval for the existing sandbox-escalated device-read command.
    • Ordinary shell execution works. A read-only host check returned Windows 10.0.26200, X64, and a bundled codex-primary-runtime/dependencies/native/powershell/pwsh.exe executable. The local Windows project and original desktop session transcript are readable. This is not the Linux execution host described in the original issue.
    • Current desktop/runtime version and the complete client-to-executor routing have not been independently established. The original transcript's session-start version must not be treated as the current runtime version.
    • No new escalated hardware command has been submitted after the current granular restriction was received. We deliberately did not repeatedly reproduce the rejection or bypass it.

    Separate earlier event
    An earlier sandbox-escalated request to run the existing read-only CMSIS-DAP script was rejected by Auto-review at CreateProcess, before Python started. Its rationale was that a required device-access-restoration prerequisite had not been established. That earlier review rejection is distinct from the later effective granular policy, and from an even earlier actual Windows HID WinError 5. We are not claiming a new HID-open failure.

    The proposed operation would only inspect probe identity, STM32 identity, TIM1 output state and firmware identity; no flash, reset, halt, PWM enable, or motor start. All hardware actions are currently stopped. No policy, driver, ACL, firmware, or experiment budget was changed.

    Expected
    If Ask for approval is permitted, eligible requests should be routed to an actual human prompt. If a higher-priority policy prohibits this, the UI should explicitly show that the selection did not become effective and identify the restriction.

    Questions for maintainers

    1. Which policy layer is supplying granular.sandbox_approval=false here: desktop selection, task/session override, app-server/executor configuration, managed policy, or another layer?
    2. Why does the native UI show Ask for approval selected without exposing manual sandbox-execution approval?
    3. What supported diagnostic/feedback can identify the effective policy's provenance and the actual execution host?
    4. What supported reconciliation/recovery is appropriate without disabling the sandbox or weakening approval policy?

    No full session transcript, personal filesystem paths, hostname, hardware data, or project source is included. These are observations, not a confirmed root cause or a claim that this report exactly reproduces every aspect of #52458.

  5. yannleretaille commented on Nov 5, 2026

    @yannleretaille

    Just experienced the same issue, execute_tool kept failing. Codex claimed the command was rejected as the sessions policy does not allow the approval prompt. Switching /permission back and forth fixed it.

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

    CLIbugsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions