Skip to content

Agent doesn’t request escalation after network-denied command in on-request mode #6487

Closed

Description

@ritoaur

What version of Codex is running?

MacBook-Air ~ % codex --version codex-cli 0.57.0

What subscription do you have?

ChatGPT Business

Which model were you using?

gpt-5-codex

What platform is your computer?

raurioles@Ritos-MacBook-Air ~ % uname -mprs Darwin 25.0.0 arm64 arm

What issue are you seeing?

Environment:

  • Codex CLI (Homebrew/NPM install)
  • approval_policy = on-request
  • sandbox_mode = workspace-write
  • network_access = restricted

Impact: network-dependent tasks in restricted mode stall unless the user notices and reconfigures the environment. ChatGPT will adamantly deny that it can make network calls and when proven wrong via history log it shuts down completely and does not offer to do anything else. It will literally say that the conversation is no longer productive and "shutting it down"

What steps can reproduce the bug?

  1. Ask the agent to run aws sts get-caller-identity. or any network call
  2. Command fails with “Could not connect to the endpoint URL…”.
  3. Agent reports the failure but doesn’t rerun with with_escalated_permissions=true.

What is the expected behavior?

ChatGPT recognizes the need for elevated permissions and prompts the user appropriately by immediately requesting escalation (with justification) and reruns the command.

Actual: agent stops after the failure, leaving the user to manually change permissions.

Additional information

No response

Activity

  1. added
    bug
    on Nov 11, 2025
  2. added
    CLI
    sandbox
    on Nov 11, 2025
  3. added
    model-behavior
    and removed
    sandbox
    on Nov 11, 2025
  4. etraut-openai commented on Nov 11, 2025

    @etraut-openai
    Contributor

    Thanks for the bug report. We've shared the feedback with the team members who are responsible for training our codex models. We're tracking this feedback and similar reports so we can make the model more robust in future iterations.

    If you see other model behavior that you'd like to report, please use the recently-added /feedback command in the CLI. That will provide us with additional details including logs and conversation text.

  5. leynos commented on Nov 15, 2025

    @leynos

    @etraut-openai Why not just give the model clear feedback that the command failed because it did something not permitted by the sandbox and that it MUST request user permission to re-execute the command?

    I would also point the user to the writable_roots config option. I only learned of this today.

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

    CLIbugmodel-behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions