Windows Codex App still asks for approval even with approval_policy=never and danger-full-access

Open 💬 3 comments Opened May 28, 2026 by htazq

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

OpenAI.Codex 26.519.11010.0 OpenAI.Codex_26.519.11010.0_x64__2p2nqsd0c76g0

What subscription do you have?

ChatGPT Pro 20x

What platform is your computer?

10.0.26200 Build 26200

What issue are you seeing?

I am using the standalone Windows Codex App, not the VSCode extension.

The Windows Codex App still asks for manual command approval even though the local rollout session metadata shows that the effective runtime context is already no-approval and full-access:

"approval_policy":"never"
"sandbox_policy":{"type":"danger-full-access"}
"permission_profile":{"type":"disabled"}
"originator":"Codex Desktop"
"source":"vscode"
"cli_version":"0.133.0"

Note: the rollout log contains source:"vscode", but I am not using VSCode. I am using the standalone Windows Codex App.

The standalone PowerShell CLI reports:

codex-cli 0.131.0

but the Windows Codex App session log reports:

cli_version: 0.133.0

So this may involve the embedded Windows Codex App runtime rather than only the standalone CLI installed on PATH.

Expected behavior:

When the effective runtime context is:

approval_policy=never
sandbox_policy=danger-full-access
permission_profile=disabled

Codex should not ask for manual approval for normal shell commands or file edits.

Actual behavior:

The Windows Codex App still shows command approval prompts. For example, it asks whether to approve a command such as:

cargo test ...

The prompt offers buttons such as:

Approve
Approve for session
Decline

This is unexpected because the session metadata already says approval_policy=never and sandbox_policy=danger-full-access.

This does not appear to be a case where the session was downgraded to:

approval_policy=on-request
sandbox_policy=workspace-write

The log shows the opposite: the runtime context is already no-approval and full-access.

Therefore the issue appears to be one of these:

  1. The Windows Codex App approval UI is ignoring the effective runtime permission context.
  2. Tool execution still routes through an approval gate even when approval_policy=never.
  3. There is a mismatch between rollout session metadata and the actual approval enforcement path.
  4. The embedded Windows Codex App runtime differs from the standalone CLI on PATH.

Steps to reproduce:

  1. Open the standalone Windows Codex App.
  2. Start or continue a local repository session.
  3. Grant Full Access.
  4. Confirm that the local rollout JSONL contains:
approval_policy=never
sandbox_policy=danger-full-access
permission_profile=disabled
  1. Ask Codex to run a command or make file edits.
  2. Observe that the Windows Codex App still asks for command approval.

Local rollout log path, redacted:

C:\Users\<redacted>\.codex\sessions\2026\05\28\rollout-2026-05-28T23-32-29-019e6f37-21d0-7630-af93-aba31d1b0dc9.jsonl

I can provide more redacted rollout JSONL excerpts if needed, but I will not attach full logs because they may contain local paths, prompts, commands, or repository-specific content.

What steps can reproduce the bug?

  1. Open the standalone Windows Codex App.
  2. Start or continue a local repository session.
  3. Grant Full Access in the Codex App.
  4. Confirm that the local rollout JSONL contains the following effective runtime context:
"approval_policy":"never"
"sandbox_policy":{"type":"danger-full-access"}
"permission_profile":{"type":"disabled"}
  1. Ask Codex to run a normal command or make file edits.
  2. Observe that the Windows Codex App still shows a command approval prompt, with options such as:
Approve
Approve for session
Decline

For example, the app still asks for approval before running commands such as cargo test ... or pnpm ....

This happens even though the session metadata already says approval_policy=never and sandbox_policy=danger-full-access.

What is the expected behavior?

When the effective runtime context is:

approval_policy=never
sandbox_policy=danger-full-access
permission_profile=disabled

the Windows Codex App should not ask for manual approval for normal shell commands or file edits.

If Full Access is active, command execution should proceed without showing approval prompts.

If the app intentionally requires approval despite this metadata, the UI should clearly show the effective permission mode and explain why approval is still required.

Additional information

I am using the standalone Windows Codex App, not the VSCode extension.

Redacted rollout JSONL excerpts show:

"approval_policy":"never"
"sandbox_policy":{"type":"danger-full-access"}
"permission_profile":{"type":"disabled"}
"originator":"Codex Desktop"
"source":"vscode"
"cli_version":"0.133.0"

Note: the rollout log contains source:"vscode", but I am not using VSCode. I am using the standalone Windows Codex App.

The standalone PowerShell CLI reports:

codex-cli 0.131.0

but the Windows Codex App session log reports:

cli_version: 0.133.0

So the issue may involve the embedded Windows Codex App runtime rather than only the standalone CLI installed on PATH.

This does not appear to be a simple downgrade to:

approval_policy=on-request
sandbox_policy=workspace-write

The local session metadata shows the opposite: the session is already no-approval and full-access, but the approval UI is still triggered.

Local rollout log path, redacted:

C:\Users\<redacted>\.codex\sessions\2026\05\28\rollout-2026-05-28T23-32-29-019e6f37-21d0-7630-af93-aba31d1b0dc9.jsonl

I can provide more redacted rollout JSONL excerpts if needed, but I will not attach full logs because they may contain local paths, prompts, commands, or repository-specific content.

View original on GitHub ↗

3 Comments

JunJieLiu51520 · 3 months ago

Root cause analysis

I traced two distinct issues that together explain the behavior.

Finding 1: --session-source defaults to "vscode" in app-server

File: codex-rs/app-server/src/main.rs (~line 35)

#[arg(
    long = "session-source",
    default_value = "vscode",   // ← hardcoded default
    value_parser = SessionSource::from_startup_arg
)]
session_source: SessionSource,

The SessionSource::VSCode is also the #[default] variant in codex-rs/protocol/src/protocol.rs. This explains why the rollout JSONL shows "source": "vscode" — the Windows Desktop app launches the same app-server binary used by the VS Code extension, and if --session-source is not explicitly passed, the default is always "vscode". This is a logging/diagnostic issue but not itself the cause of the approval prompts.

Finding 2: Likely cause — Constrained<AskForApproval> silently overriding never

In codex-rs/core/src/config/mod.rs (~line 3296), there is a config-requirements validation that can silently reject approval_policy=never:

"`approval_policy = \"never\"` cannot be used because requirements do not allow `sandbox_mode = \"danger-full-access\"`"

If managed config requirements (e.g. from MDM or cloud policy) restrict approval_policy to on-request, then the session's Constrained<AskForApproval> field silently falls back to on-request even though the JSONL metadata records the requested value "never". The metadata reflects what was asked for, not necessarily what was enforced.

Finding 3: Windows-specific path in exec_policy

File: codex-rs/core/src/exec_policy.rs (~line 653)

let environment_lacks_sandbox_protections = cfg!(windows)
    && profile_is_managed_read_only(permission_profile, ...);

With danger-full-access (PermissionProfile::Disabled), profile_is_managed_read_only() returns false, so this path should NOT be triggered. But it is worth confirming the PermissionProfile value is correctly propagated to the exec policy evaluation.

Suggested investigation path

  1. Check whether any managed config requirements (MDM, cloud policy, TOML config layers) constrain approval_policy — if so, the Constrained wrapper would silently reject never while the JSONL still shows "never" as the requested policy
  2. Add a log line at the Constrained::set call site for approval_policy to surface silent fallbacks
  3. The Windows Desktop app launcher should pass --session-source desktop (or a new SessionSource::Desktop variant) to improve diagnostic accuracy

Happy to contribute further analysis or a fix if the team would like to invite a PR.

Community-AI-tools · 1 month ago

I can reproduce the same class on Windows Desktop: the visible per-chat mode is Full Access, but worker chats still transition to a waiting-for-approval state for routine local actions.

Observed impact:

  • orchestration/quality/support worker chats stop instead of continuing their assigned local work;
  • recreating or restarting a chat does not reliably preserve the intended no-approval behavior;
  • this makes unattended local development unreliable even when Full Access has been deliberately selected.

Expected behavior:

  • when the effective thread context is Full Access / no-approval, routine local shell and workspace actions should run without a new manual prompt;
  • if an action is intentionally excluded, the UI should show the effective policy and the specific reason before the worker is paused;
  • a newly created replacement thread should inherit the selected permission mode consistently.

No repository paths, source content, credentials, user data, or external endpoints are included.

YukiWorks432 · 14 days ago

I encountered what appears to be the same issue on Codex Desktop for Windows.

Environment

  • OS: Microsoft Windows 11 Home 25H2, version 10.0.26200, build 26200.9168, x64
  • Codex Desktop app package: OpenAI.Codex 26.803.10989.0 (x64)
  • Bundled Codex runtime recorded in the session: 0.147.0-alpha.6.6
  • Standalone Codex CLI on PATH: codex-cli 0.145.0
  • PowerShell: 7.6.4
  • Git for Windows: 2.55.0.windows.2
  • Locale: ja-JP
  • Time zone: Tokyo Standard Time
  • Workspace: a local Git repository on the system drive

The relevant session metadata was:

originator = Codex Desktop
source = vscode
cli_version = 0.147.0-alpha.6.6
approval_policy = never
sandbox_policy = danger-full-access
permission_profile = disabled
filesystem = unrestricted

I am using the standalone Codex Desktop app, not the VS Code extension. The source = vscode value above came from the Desktop-created session metadata.

Permission state after restart

One potentially relevant detail is how Full Access was enabled:

  1. I had selected Full Access previously.
  2. Codex Desktop was later restarted; the PC had also been restarted.
  3. When Codex started again, Full Access was already selected automatically because the previous setting had been restored.
  4. I did not manually reselect or toggle Full Access immediately before reproducing the problem.

Therefore, this was not a permission upgrade made during the active turn. The task started with the app already displaying the previously persisted Full Access state.

Observed behavior

While continuing ordinary repository work, Codex attempted to stage changes with git add. The command was rejected with:

approval required by policy, but AskForApproval is set to Never

Other shell and repository inspection commands in the same task succeeded, so this was not a general failure to start PowerShell or Git.

Expected behavior

When the effective runtime context is approval_policy = never, sandbox_policy = danger-full-access, and permission_profile = disabled, git add should run without requesting approval.

Possible relevance

This may indicate that, after an app or PC restart, the persisted Full Access selection and the permission context visible to the agent are restored, while a separate command-approval or execution-policy component retains or reconstructs an incompatible state.

It may be useful to check whether permission state restored during application startup is applied atomically to all execution-policy components, rather than only to the UI and thread context.