Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Codex Desktop 26.707.51957 (bundle 5175), bundled codex-cli 0.144.0-alpha.4.
What subscription do you have?
Pro
What platform is your computer?
macOS / Darwin arm64
What issue are you seeing?
In a newly created projectless Codex Desktop task, selecting Ask for approval silently replaces the configured approval_policy = "on-request" with a granular policy that has sandbox_approval = false:
GranularApprovalConfig {
sandbox_approval: false,
rules: false,
skill_approval: false,
request_permissions: true,
mcp_elicitations: true
}
This is a regression from the previous interactive approval behavior: the agent can still see and attempt the normal exec_command escalation interface, but sandbox_permissions = "require_escalated" is rejected before an approval prompt can be created. This has effectively broken existing chats/workflows that previously let Codex ask for approval and retry a blocked tool call.
The alternative request_permissions mechanism is not an adequate transparent replacement in the current product contract:
- the UI still calls the mode Ask for approval and says it will “Always ask to edit external files and use the internet”;
- the effective policy and the reason ordinary shell escalation is disabled are not shown;
- the agent still has an
exec_commandschema containingsandbox_permissions = "require_escalated"; - existing prompts, workflows, and user requests naturally direct the agent to use that interface;
- the user's explicit
approval_policy = "on-request"is overridden; - neither the user nor apparently the agent is told how all previously approval-gated command cases should be translated into a separate pre-grant request.
This creates a user-visible contradiction: Approve for me supports the ordinary escalation path, while Ask for approval rejects it before the user can be asked.
Deterministic A/B reproduction
The same task and same harmless command were used for both modes:
curl --max-time 2 --silent --show-error http://127.0.0.1:9229/json/list
The tool call included:
{
"sandbox_permissions": "require_escalated",
"justification": "May I run the same read-only localhost probe to verify the effective approval behavior?"
}With Ask for approval, Desktop injected the granular policy above and rejected the call before prompting:
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 })
With Approve for me, the effective state changed to approval_policy = "on-request" with an automatic reviewer. The identical escalated command executed successfully and returned the local Electron Node inspector entry.
Switching back to Ask for approval restored the granular policy and reproduced the exact pre-prompt rejection.
Local configuration
Relevant ~/.codex/config.toml:
approval_policy = "on-request"
approvals_reviewer = "user"
sandbox_mode = "workspace-write"
[sandbox_workspace_write]
writable_roots = [
"~/.npm",
"~/.cache/clang/ModuleCache",
]The Desktop task host overrides this approval policy when Ask for approval is selected.
Desktop bundle source trace
The installed archive was extracted read-only for inspection:
/Applications/Codex.app/Contents/Resources/app.asar
SHA-256: 26708d5be316b43786ba00ea8581317426e44ff508e0d5cce40f53181582e027
Size: 195,064,103 bytes
Because the production renderer chunks are minified to one physical line, line numbers are not useful. The table below gives the exact archive member, complete SHA-256, file size, and zero-based byte offset for every cited symbol/string.
| Evidence | Exact archive member under app.asar |
SHA-256 | Size | Byte offset |
|---|---|---|---|---|
Projectless tasks select granular: function Z1t(...) |
webview/assets/app-initial~app-main~new-thread-panel-page~appgen-library-page~hotkey-window-thread-page~ho~iufn7mg3-k1satKyX.js |
4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac |
8,856,468 | 2,685,902 |
Permission override construction: function a1t(...) |
same ...k1satKyX.js member |
4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac |
8,856,468 | 2,676,285 |
Turn-start permission resolution: function svt(...) |
same ...k1satKyX.js member |
4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac |
8,856,468 | 2,204,506 |
“Ask for approval” click handler: let Ge=()=>{...} |
same ...k1satKyX.js member |
4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac |
8,856,468 | 8,287,625 |
| “Ask for approval” displayed label | same ...k1satKyX.js member |
4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac |
8,856,468 | 8,285,540 and 8,291,885 |
| “Always ask to edit external files and use the internet” description | same ...k1satKyX.js member |
4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac |
8,856,468 | 8,291,630 |
Agent-mode-to-policy mapping: function nS(...) |
webview/assets/app-initial~app-main~projects-index-page~hotkey-window-thread-page~local-environments-setti~jjjs6eag-De99_ILj.js |
b557f54f16bbb4d4e2176d63ded3fd310ca38d91f9d32124a55d96a5e477e6c1 |
443,446 | 347,743 |
Hard-coded granular policy: hS={granular:...} |
same ...De99_ILj.js member |
b557f54f16bbb4d4e2176d63ded3fd310ca38d91f9d32124a55d96a5e477e6c1 |
443,446 | 349,527 |
The offsets can be reproduced after extracting the archive with commands such as:
rg --byte-offset -o 'function Z1t\(' '<extracted-asar>/webview/assets/app-initial~app-main~new-thread-panel-page~appgen-library-page~hotkey-window-thread-page~ho~iufn7mg3-k1satKyX.js'
rg --byte-offset -o 'hS=\{granular:' '<extracted-asar>/webview/assets/app-initial~app-main~projects-index-page~hotkey-window-thread-page~local-environments-setti~jjjs6eag-De99_ILj.js'The renderer source shows that projectless tasks deliberately default to granular rather than auto:
function Z1t({isProjectless:e,requirements:t}) {
return e && sr(`granular`,t) ? `granular` : `auto`
}The Ask for approval click handler selects that computed default (se):
let Ge = () => {
Ve(se)
Se(null)
W(se)
L(!1)
}The renderer hard-codes the granular policy:
hS = {
granular: {
sandbox_approval: false,
rules: false,
skill_approval: false,
request_permissions: true,
mcp_elicitations: true
}
}and maps that mode to a workspace sandbox with the explicit granular override:
case `granular`:
return Qx(workspaceRoots, void 0, hS)Relevant extracted chunks:
webview/assets/app-initial~app-main~projects-index-page~hotkey-window-thread-page~local-environments-setti~jjjs6eag-De99_ILj.js
SHA-256: b557f54f16bbb4d4e2176d63ded3fd310ca38d91f9d32124a55d96a5e477e6c1
webview/assets/app-initial~app-main~new-thread-panel-page~appgen-library-page~hotkey-window-thread-page~ho~iufn7mg3-k1satKyX.js
SHA-256: 4bd5e9614579174f1d612786cc693a3f1babd3dd1884d8949c6fea59091e19ac
Runtime source trace
The upstream references below are pinned to repository commit 9e552e9d15ba52bed7077d5357f3e18e330f8f38, rather than floating main links:
| Evidence | Repository file | Git blob SHA-1 | Size | Lines |
|---|---|---|---|---|
Explicit shell escalation rejection outside OnRequest |
codex-rs/core/src/tools/handlers/shell.rs |
87a9301093453a5c3ab4545cc3f62e0a861e7c98 |
8,738 | 122–138 |
Granular prompt/category and request_permissions routing |
codex-rs/prompts/src/permissions_instructions.rs |
1c19d008cf33833e1c7d509e6f32e61ddb8a6499 |
15,555 | 332–400 |
Current Codex runtime source explicitly rejects a fresh shell sandbox override under every policy other than OnRequest:
codex/codex-rs/core/src/tools/handlers/shell.rs
Lines 122 to 138 in 9e552e9
| // Approval policy guard for explicit escalation in non-OnRequest modes. | |
| // Sticky turn permissions have already been approved, so they should | |
| // continue through the normal exec approval flow for the command. | |
| if effective_additional_permissions | |
| .sandbox_permissions | |
| .requests_sandbox_override() | |
| && !effective_additional_permissions.permissions_preapproved | |
| && !matches!( | |
| turn.approval_policy.value(), | |
| codex_protocol::protocol::AskForApproval::OnRequest | |
| ) | |
| { | |
| let approval_policy = turn.approval_policy.value(); | |
| return Err(FunctionCallError::RespondToModel(format!( | |
| "approval policy is {approval_policy:?}; reject command — you should not ask for escalated permissions if the approval policy is {approval_policy:?}" | |
| ))); | |
| } |
if effective_additional_permissions
.sandbox_permissions
.requests_sandbox_override()
&& !effective_additional_permissions.permissions_preapproved
&& !matches!(
turn.approval_policy.value(),
codex_protocol::protocol::AskForApproval::OnRequest
)
{
// reject before creating an approval
}The permission-instruction generator confirms that granular mode exposes direct shell permission requests only when sandbox_approval is enabled, while this Desktop policy instead enables request_permissions:
codex/codex-rs/prompts/src/permissions_instructions.rs
Lines 332 to 400 in 9e552e9
| fn granular_prompt_intro_text() -> &'static str { | |
| "# Approval Requests\n\nApproval policy is `granular`. Categories set to `false` are automatically rejected instead of prompting the user." | |
| } | |
| fn request_permissions_tool_prompt_section() -> &'static str { | |
| "# request_permissions Tool\n\nThe built-in `request_permissions` tool is available in this session. Invoke it when you need to request additional `network` or `file_system` permissions before later shell-like commands need them. Request only the specific permissions required for the task." | |
| } | |
| fn granular_instructions( | |
| granular_config: GranularApprovalConfig, | |
| exec_policy: &Policy, | |
| exec_permission_approvals_enabled: bool, | |
| request_permissions_tool_enabled: bool, | |
| ) -> String { | |
| let sandbox_approval_prompts_allowed = granular_config.allows_sandbox_approval(); | |
| let shell_permission_requests_available = | |
| exec_permission_approvals_enabled && sandbox_approval_prompts_allowed; | |
| let request_permissions_tool_prompts_allowed = | |
| request_permissions_tool_enabled && granular_config.allows_request_permissions(); | |
| let categories = [ | |
| Some(( | |
| granular_config.allows_sandbox_approval(), | |
| "`sandbox_approval`", | |
| )), | |
| Some((granular_config.allows_rules_approval(), "`rules`")), | |
| Some((granular_config.allows_skill_approval(), "`skill_approval`")), | |
| request_permissions_tool_enabled.then_some(( | |
| granular_config.allows_request_permissions(), | |
| "`request_permissions`", | |
| )), | |
| Some(( | |
| granular_config.allows_mcp_elicitations(), | |
| "`mcp_elicitations`", | |
| )), | |
| ]; | |
| let prompted_categories = categories | |
| .iter() | |
| .flatten() | |
| .filter(|&&(is_allowed, _)| is_allowed) | |
| .map(|&(_, category)| format!("- {category}")) | |
| .collect::<Vec<_>>(); | |
| let rejected_categories = categories | |
| .iter() | |
| .flatten() | |
| .filter(|&&(is_allowed, _)| !is_allowed) | |
| .map(|&(_, category)| format!("- {category}")) | |
| .collect::<Vec<_>>(); | |
| let mut sections = vec![granular_prompt_intro_text().to_string()]; | |
| if !prompted_categories.is_empty() { | |
| sections.push(format!( | |
| "These approval categories may still prompt the user when needed:\n{}", | |
| prompted_categories.join("\n") | |
| )); | |
| } | |
| if !rejected_categories.is_empty() { | |
| sections.push(format!( | |
| "These approval categories are automatically rejected instead of prompting the user:\n{}", | |
| rejected_categories.join("\n") | |
| )); | |
| } | |
| if shell_permission_requests_available { | |
| sections.push(APPROVAL_POLICY_ON_REQUEST_RULE_REQUEST_PERMISSION.to_string()); | |
| } | |
| if request_permissions_tool_prompts_allowed { | |
| sections.push(request_permissions_tool_prompt_section().to_string()); |
let shell_permission_requests_available =
exec_permission_approvals_enabled && sandbox_approval_prompts_allowed;
let request_permissions_tool_prompts_allowed =
request_permissions_tool_enabled && granular_config.allows_request_permissions();So the runtime rejection is internally consistent with the policy Desktop selected. The regression/product bug is the Desktop mapping and resulting contract: a UI mode named Ask for approval silently stops supporting the established shell approval flow, overrides explicit on-request configuration, and leaves both users and agents facing an exposed escalation interface that cannot work.
What steps can reproduce the bug?
-
Set the relevant config values:
approval_policy = "on-request" approvals_reviewer = "user" sandbox_mode = "workspace-write"
-
Create a fresh projectless task in Codex Desktop.
-
Select Ask for approval in the composer permission menu.
-
Inspect the effective developer permission instructions or rollout context. Observe
GranularApprovalConfigwithsandbox_approval: false. -
Ask Codex to perform a harmless command using
sandbox_permissions = "require_escalated". -
Observe that the runtime rejects it before displaying an approval prompt.
-
Switch the same task to Approve for me.
-
Retry the identical call. Observe that the effective policy becomes
on-requestwith automatic review and the escalation path works. -
Switch back to Ask for approval and observe the granular pre-prompt rejection again.
What is the expected behavior?
Ask for approval should preserve the established interactive approval behavior and the user's configured approval_policy = "on-request", including allowing Codex to request approval for a blocked command and retry it.
If projectless tasks must use granular permissions instead, the product needs a complete and unambiguous contract:
- clearly distinguish granular permission grants from ordinary command approval in the UI;
- do not expose or recommend
sandbox_permissions = "require_escalated"when it is guaranteed to fail; - ensure the agent reliably translates every relevant blocked filesystem/network operation into
request_permissionsbefore retrying; - explain why explicit
approval_policy = "on-request"configuration is being overridden; - provide a migration path for existing chats and workflows that relied on interactive shell escalation.
Regression impact
- Existing chats that previously escalated blocked commands now fail before prompting.
- The agent may repeatedly choose an escalation interface that the host has made unusable.
- Users cannot tell from the Ask for approval label that the underlying approval model has changed.
- Per-command approval is important because it lets the user inspect the exact requested action; silently replacing it with a different capability-grant workflow changes the security and UX contract.
- The behavior makes projectless Desktop chats feel broken even though the UI still advertises approval-based operation.
Related issues
- Granular approval policy prompts model to use sandbox_permissions that runtime rejects unless OnRequest #23359 — same lower-level granular/tool-schema mismatch, but does not cover Desktop's projectless-only UI mapping, explicit config override, or this A/B mode reproduction.
- Codex beta permission restrictions are not disabled after asking for escalation #31270 — related problems with permission-profile escalation, but concerns restrictions remaining after approval rather than approval being impossible to request.
- Automations ignore configured approval_policy = "on-request" and run with effective approval = never #27575 — related Desktop approval-policy inheritance drift in automations.
Activity
claell commentedon Jul 19, 2026
I filed #34182 for a distinct existing-task lifecycle variant of this policy failure.
On Windows Desktop
26.715.4045.0, the same general-chat/projectless task first started a turn withrequestApprovalPolicy=null, resolved toon-request, and successfully produced ordinary approval prompts. A later turn, without a permission-mode change, was started by the renderer with an explicit granular policy containingsandbox_approval:falseanduseAppServerPermissionDefault=false. The runtime then rejected every shell escalation before prompting.Restarting Desktop restored
on-requesttemporarily, but the same existing task later regressed to the granular profile again. #34182 contains the renderer and rollout timestamps. This appears to share the lower-level mapping problem reported here while adding a persistence/resume transition that is not covered by the fresh-task reproduction.SeanEricKnight commentedon Oct 9, 2026
Adding a macOS reproduction from October 9, 2026.
Environment
workspace-writeapproval_policy.granular.sandbox_approval = falseReproduction / impact
In an existing local Codex task, I asked the agent to migrate GitHub CLI to Homebrew and perform validation. Homebrew bottle extraction failed inside the sandbox with:
Codex then tried the supported unsandboxed/escalated execution request. It was rejected before the command ran or an approval prompt appeared:
The agent identified the active
granularpolicy as the blocker. The user tried the app's permission-mode settings and updated Codex to 26.1007.21159, but the effectivesandbox_approval=falsebehavior persisted. Filesystem/network grants did not permit escalated execution. We did not disable SIP or macOS sandbox controls or enable Full access.Result
The Homebrew
ghmigration remains incomplete:/opt/homebrew/bin/ghwas not created andbrew liststill showed onlyuv. The existing GitHub CLI at/usr/local/bin/ghremains functional and authenticated. The agent verified that the preexisting Python installation, shell profile, GitHub executable and credential/configuration files had not changed.Expected: With Ask for approval, Codex should be able to present a user approval request for the specific command requiring execution outside the sandbox, rather than rejecting the request before prompting.
This appears consistent with the issue's reported mismatch between the visible approval mode and the effective granular policy. I have not isolated whether the projectless-task condition described in the original report is necessary for this reproduction.
sayam commentedon Oct 13, 2026
Additional Linux impact report from 2026-10-13: local Incus access is blocked, and this session has no exposed permission-request path.
Follow-up (same date): The user resumed the same conversation from a host terminal with
codex -C /home/adminu/Documents/projects/codex/review-asked-twice --sandbox danger-full-access --ask-for-approval never resume 01a133e1-3faf-74a3-86f6-97120efae40a. The new command executor successfully connected:incus versionreturned client and server version 6.0.3 (exit 0), andincus query /1.0returnedauth: trusted,auth_user_method: unix,server_version: 6.0.3(exit 0). This confirms that the same host and Incus daemon are reachable from Codex with the unrestricted execution setting; the permission-request gap described below remains specific to the prior restricted session. No instances were changed.Environment and scope
codex-cli 0.162.1; the frontend/app-server build and UI permission mode were not independently captured.workspace-writesandbox and a managed permissions profile.sandbox_approval: false,rules: false, andskill_approval: false. A directrequire_escalatedrequest made after this report was first posted returned the complete effective policy:sandbox_approval: false,rules: false,skill_approval: false,request_permissions: true,mcp_elicitations: true.exec_commandschema still acceptssandbox_permissions: "use_default" | "require_escalated". There is no exposedrequest_permissionstool. A separatecodex features listinvocation reportsrequest_permissions_toolandexec_permission_approvalsas under development and false; these are CLI defaults, not proof of live app-server feature overrides.Read-only reproduction
All probes below ran through the current session's ordinary command executor, with default sandbox permissions:
A Python socket probe creates
socket(AF_UNIX, SOCK_STREAM)successfully, butconnect("/var/lib/incus/unix.socket")fails with errno 1 (EPERM). An independent curl Unix-socket probe also fails, exit 7, reportinggetsockname() failed with errno 1: Operation not permitted. Curl's message is included literally; it is not being described as the same syscall as the Python failure.The command process has
NoNewPrivs: 1,Seccomp: 2, andSeccomp_filters: 1. The socket exists with mode 0660. Supplementary groups and socket owners appear asnobodyinside the user namespace; that display alone does not establish dropped host groups or a DAC failure.Impact and limits
The user supplied same-host guides recording Incus server 6.0.3 access from other agent applications. Those are comparison reports, not an independently repeated host-terminal control in this session.
The user explicitly authorized trying Incus and reporting the failure upstream. The current session cannot perform even a minimal daemon API read, cannot request ordinary shell escalation under its supplied policy, and has no exposed alternative permission-request tool.
I then submitted exactly one read-only
incus versioncall withsandbox_permissions: "require_escalated", after the user explicitly reconfirmed authorization. Codex rejected it before the command ran or any user approval prompt appeared:A separate fresh Codex task using the same available permissions also returned
Server version: unreachableand the sameEPERMonincus query /1.0. There was no UI A/B test, so this does not establish the original report's projectless-task trigger or Desktop mapping on this host.Current documentation also describes
permissions.<name>.network.unix_sockets. I have not activated or verified that alternative on this Linux runtime, and it should not be presented as an already tested fix.Requested clarification/fix
Please ensure that a session disabling shell escalation either exposes a usable, policy-compliant permission-request mechanism or clearly identifies that access cannot be requested. Please also clarify the supported Linux path for an explicitly approved local daemon socket such as Incus while retaining workspace filesystem restrictions.
No instances were enumerated, created, or modified; no daemon, group, socket, or host configuration was changed.
Setup prompt: three fixed first messages (approvals, city, clubs); th…
Setup prompt: three fixed first messages (approvals, city, clubs); th…
rine1898 commentedon Oct 25, 2026
Additional Windows report, observed 2026-10-25. The user explicitly asked the assistant to report this problem.
Environment:
Observed behavior:
Rejected("approval required by policy, but AskForApproval::Granular.sandbox_approval is false").Configuration/UI observations:
approval_policy = "on-request"andapprovals_reviewer = "user"at the root of the local config.toml; the resulting file was validated with Python tomllib.blocked by policy; that generic error does not establish which policy layer rejected them.Expected behavior:
An explicitly approved per-directory grant should provide a usable execution path for a command within that scope. If another capability is required, identify the missing scope/category and provide an available approval mechanism. The UI should make the effective policy and config override source visible, and troubleshooting should not direct users to a missing Custom option.
The internal cause is unconfirmed. This Windows case adds a successful request_permissions grant followed by a rejection of a non-escalated exec_command, rather than only the explicit escalation failure in the original report.
Privacy: personal directory names, usernames, account details, complete config files, and session logs are omitted. The obsolete directory was not deleted by the rejected command.