codex icon indicating copy to clipboard operation
codex copied to clipboard

Codex App: agent-created threads start in workspace-write/on-request despite full-access default

Open M1ckyway opened this issue 1 month ago • 11 comments

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

ChatGPT desktop 26.1023.51421 (build 22530), bundled Codex CLI 0.165.0-alpha.1.2

What subscription do you have?

Not stated

What platform is your computer?

macOS 27.0, arm64 (Mac mini)

What issue are you seeing?

Threads that the agent opens itself (thread_source = agent_created_thread, via the new-thread / create_thread tool) usually ignore the configured default permissions. They start in workspace-write with approval_policy = on-request, so every command needs manual approval. Their sub-agents inherit the restricted mode.

Config (~/.codex/config.toml):

approval_policy = "never"
default_permissions = ":danger-full-access"

codex app-server --strict-config --print-startup-config passes, and no managed requirements are present.

First turn_context of each thread in October 2026, from local rollout files:

How the thread was opened approval / sandbox at start Count
Opened by the user in the app (thread_source = user) never / danger-full-access 20 of 20
Opened by the agent (agent_created_thread) on-request / workspace-write 16 of 18
Sub-agents on-request / workspace-write 18 of 74

The only 2 agent-created threads that got full access were created right after an app restart.

What steps can reproduce the bug?

  1. Set the config above and restart the app.
  2. In a thread that is running with Full access, ask Codex to start a task in a new thread.
  3. Open the new thread's permission selector, or read the first turn_context in its rollout file.

What is the expected behavior?

The new thread uses the configured default permission profile, or inherits the parent thread's permission selection.

Additional information

  • The create_thread tool schema exposes no permission, sandbox or approval parameter, so the agent cannot request a mode.
  • Possibly related: #29503 (Full access selection still starts sessions with workspace-write) and #41410 (desktop project task creation forces read-only). This report is about the agent-created thread path.
  • Workaround: switch the new thread to Full access by hand in the composer.

M1ckyway avatar Oct 30 '26 22:10 M1ckyway

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #57555
  • #57411

Powered by Codex Action

github-actions[bot] avatar Oct 30 '26 22:10 github-actions[bot]

Additional static package evidence for build 23880 (2026-11-02): the cross-directory, legacy/null-profile path previously described in #40125 and #25810 is still present in the latest macOS production package inspected.

This is a package-level follow-up, not a live reproduction on 23880. The recurring user-visible Full access / “Needs approval” mismatch was observed on installed build 21828 on macOS/Apple Silicon (Darwin 24.6.0 arm64). No new conversation records or private logs were collected for this package audit.

Package checked

  • Codex App 26.1027.51404 / build 23880, published 2026-10-31 23:44:31 UTC.
  • Official macOS arm64 ZIP, selected from the production appcast.
  • Complete archive length: 764974997 bytes. Official Ed25519 signature verified; ZIP SHA256: 93993beed5ee52a61147ca973290e2052bb0fa3da117634d571267071720bb5d.
  • Bundled CLI: 0.166.0-alpha.5.1. The actual embedded CLI executable (not its launcher script) has the same SHA256 as build 22943: 58a91f6ea19bea477ae3a2ec48d619f0039afe75d3476260747e11d201fa7cea.

Conditional path still present

The relevant preconditions are: same host, different source/destination CWDs, a source whose effective permissions are dangerFullAccess + never but whose activePermissionProfile is null/missing, delegated create_thread, and a saved host default of full-access. The destination selection must resolve to an agent-mode Full access default (or the legacy host-mode fallback), rather than an explicit profile or server-default selection; those can take other branches.

In webview/assets/app-initial-61c1d0e6137e.js:

  1. uBs reads the raw currentPermissions selector CTn. It derives the mode but carries activePermissionProfile?.id ?? null unchanged; it does not canonicalize legacy Full access to :danger-full-access.
  2. Dzs calls kzs first. Across CWDs, kzs rejects the null-profile source. Its function body is identical to the equivalent guard in build 22943.
  3. When enabled, Tzs filters out delegated destination defaults represented as agent-mode Full access (also custom mode with a danger-full-access config).
  4. With no retained source/default selection, Ozs converts the saved Full access host mode to auto for this delegated launch. That fallback expression is also identical to build 22943. With a danger-full-access config, the inspected request-building chain consequently prepares permissions=:workspace, approvalPolicy=on-request, approvalsReviewer=user for thread/start.

The public entry path remains Dp → tBs → iBs → Dzs; it passes the source thread and sets delegated creation, but supplies no explicit permission-profile override. I did not find an earlier normalization step that avoids this particular branch.

For locating the packaged source, its SHA256 is 7a8d8b711bf2eb1adbfab04818a63bf6517935d11bb4d0d4c9d6602d1e3fe6f2. Zero-based UTF-8 byte offsets: uBs=9537796, kzs=9517069, Tzs=9515353, Ozs=9516833, Dzs=9515901.

Suggested focused regression case

Compare cross-CWD delegated creation from equivalent Full access sources with (a) no active profile and (b) explicit :danger-full-access, while the saved default is Full access. The expected result is consistent treatment of the confirmed effective Full access selection, subject to destination requirements, rather than silently treating the legacy representation as auto.

This evidence covers that conditional client-side path only; it does not establish that every newly created chat is affected or that every report of approval prompts has the same cause.

wuyang630 avatar Nov 02 '26 01:11 wuyang630

Related same-build macOS evidence from dot-created local tasks

Our October 28, 2026 observation used installed ChatGPT desktop 26.1023.51421 (22530) and bundled codex-cli 0.165.0-alpha.1.2, on macOS 27.0.1 arm64. The runtime serving the affected tasks was not independently version-verified.

Three dot-created connected-Mac tasks reported workspace-write with auto_review, while native user configuration contained sandbox_mode = "danger-full-access" and approval_policy = "never". The general Codex settings page also showed Full access and Never ask for approval. The dot's create/continue interfaces exposed no sandbox or approval-policy parameter.

Full sanitized audit: https://github.com/openai/codex/issues/50737#issuecomment-6468581582.

Important limits: our route is dot-created local tasks, not a verified agent_created_thread comparison. We did not establish the effective approval-policy value, task-composer selection, or direct-user versus agent-created counts. auto_review is a reviewer setting and must not be treated as evidence of on-request.

This adds a same-installed-build saved-default/task-context discrepancy, not proof of the same cause or your restart workaround. Please clarify permission provenance and supported controls for each creation route. No permissions were changed. Private identifiers and raw logs are omitted. Posted by my dot at my explicit request.

albertloky avatar Nov 04 '26 13:11 albertloky

Tested workaround for Android Codex Voice coordinating workers on a connected Mac (2026-11-05).

Environment: ChatGPT/Codex desktop 26.1029.61003, build 24614; bundled codex-cli 0.166.0-alpha.6; macOS 27.0.1 arm64. Android app version was not captured.

We encountered two distinct permission layers:

  1. MCP approval for create_thread / send_message_to_thread.
  2. The child worker's command execution and network permissions.

For the MCP layer, we configured:

[plugins."codex-app-tools@openai-bundled".mcp_servers.codex_app.tools.create_thread]
approval_mode = "approve"

[plugins."codex-app-tools@openai-bundled".mcp_servers.codex_app.tools.send_message_to_thread]
approval_mode = "approve"

The user reported no MCP approval dialogs in the Android Voice test afterward. Calls completed successfully. We did not run a controlled before/after toggle, so this is an observed working configuration on the version above, not proof of the exact causal change or a fix for older versions.

Worker permissions remained a separate problem. Direct creation from the Voice coordinator produced a worker with workspaceWrite, networkAccess: false, and approvalPolicy: on-request in the desktop's saved permission state. Its default-permission curl https://example.com failed with exit 6 / DNS resolution failure. The Mac itself returned HTTP 200. Adding [sandbox_workspace_write] network_access = true did not restore network access in either an existing restricted worker or a fresh Voice-created worker in the running app. We did not isolate a post-restart test of that network setting.

The working route was:

Android Voice coordinator
  -> send_message_to_thread(existing desktop-created dispatcher)
  -> dispatcher creates worker
  -> Voice coordinator sends follow-ups directly to that worker

We created one persistent desktop-origin dispatcher with full access and approval policy never. Two Voice-origin follow-ups to this dispatcher retained its working network access. A worker created by the dispatcher also received full access, network enabled, and approval policy never.

To avoid configuring each Voice chat individually, we added this instruction to the Mac's global ~/.codex/AGENTS.md (replace the placeholder with your own desktop-created chat ID):

For user-authorized worker-chat creation from Codex Voice on this same Mac,
reuse the existing desktop-created dispatcher chat <DISPATCHER_CHAT_ID>
through send_message_to_thread. Forward the requested task, project, and
constraints. Have it create or reuse the appropriate worker and return its
ID and results. Reuse suitable existing workers. The dispatcher and its
workers must not route requests recursively back to the dispatcher.
Check that the dispatcher is available; report restrictions rather than
changing permissions or silently creating a restricted replacement.

We then started a completely new Android Voice conversation. Without a setup message, it used the saved dispatcher route. The resulting worker:

  • Wrote and read a temporary file.
  • Returned HTTP 200 / curl exit 0 on its initial HTTPS request.
  • Accepted two separate follow-ups directly from the new Voice coordinator; each appended/read the file and returned HTTP 200 / exit 0 again.
  • Retained full access, network enabled, and approval policy never across all three turns.
  • Deleted its test file and verified cleanup.
  • Recorded no approval requests or restrictions in the worker's execution history.

The dispatcher history identified the new Voice coordinator as the sender, and the worker history identified the dispatcher as its creator and the new Voice coordinator as the sender of both follow-ups.

This is a tested orchestration workaround on one installation, not a product fix or a guarantee that all operations will avoid approvals. Full access gives workers broad local and network access; choose it only when that matches the intended host policy. We did not test Windows, a second Mac, cross-host messaging, preservation of auto_review, or every possible operation. We could not retrieve the Voice coordinator's full history through read_thread (thread/items/list is not supported yet), and did not record the Android screen, so execution history is not proof that no transient UI indicator ever appeared.

The underlying direct Voice-to-worker creation behavior still needs a product fix. The distinction between desktop-origin creation and direct Voice-origin creation may help narrow the permission-inheritance path.

danielsinewe avatar Nov 05 '26 21:11 danielsinewe

Confirmed on a newer build: desktop app 26.1029.61003 (build 24614), bundled engine 0.166.0-alpha.6, macOS Darwin 27.0.0 arm64.

On 2026-11-06, a parent thread running with Full access created seven separate local project threads through create_thread. All seven started with restricted permissions and required approvals, interrupting the requested investigations.

Verified from local runtime records:

  • Parent turn at 05:28:12 UTC: approval_policy=never, sandbox_policy=danger-full-access.
  • Seven child threads created at 05:28:51-05:29:02 UTC: approval_policy=on-request, sandbox_policy=workspace-write, network_access=false, active_permission_profile=:workspace, permission_profile.type=managed.
  • Child metadata identifies thread_source=agent_created_thread.
  • Global config already sets approval_policy="never", sandbox_mode="danger-full-access", approvals_reviewer="user". The desktop's saved local-host selection is full-access.
  • Earlier threads created through the same tool used never / disabled permissions.
  • The create_thread tool exposes no permission override argument.

The user encounters this when directing the parent from the mobile app connected to the Mac, and reports that the interface can still show Full access while commands request approval. The runtime mismatch is verified; mobile exclusivity and the displayed label on each child have not been independently reproduced.

Expected: newly created tasks honor the full-access parent/default selection, and the displayed permission mode matches effective execution permissions.

Related mobile reports: #24270 and #30485. No workaround has been tested for this reproduction. Private prompts, repository details and full logs are omitted.

slashv avatar Nov 06 '26 06:11 slashv

Additional macOS reproduction and workaround verification — November 10, 2026

We observed a related dot-created local-task case and verified the desktop-created coordinator approach described in the November 5 comment: https://github.com/openai/codex/issues/58450#issuecomment-6669577687

This comparison was performed on one Mac, using pStack 1.21.0 for end-to-end validation. The desktop application and bundled Codex runtime versions corresponding to these particular executions were not independently established.

Direct dot-created path:

A projectless child created directly by dot started its first turn with:

  • sandbox_mode = workspace-write
  • macOS Seatbelt sandboxing with restricted networking
  • CODEX_SANDBOX_NETWORK_DISABLED=1

DNS resolution failed in that execution context.

Working route tested:

  1. The user manually created a desktop coordinator chat and selected Full Access.
  2. That coordinator created a local child chat.
  3. We checked the effective execution settings and network behavior of both.

Both the coordinator and its child reported:

  • sandbox_mode = danger-full-access
  • approval_policy = never
  • approvals_reviewer = user
  • permission_profile.type = disabled
  • active_permission_profile.id = :danger-full-access
  • CODEX_SANDBOX_NETWORK_DISABLED unset

HTTPS checks returned HTTP 200 with TLS certificate verification enabled. End-to-end pStack validation produced four verified responses in total, covering Claude Opus 5.5 and Grok 4.7.

Scope and limitations:

This adds another observed difference between direct dot-created tasks and a manually created desktop Full Access coordinator creating its own local child. It does not establish the underlying cause or prove that dot-created tasks follow the same internal creation path as every other report in this issue.

This is a workaround verified on one Mac, not an official fix or a guarantee for future children, other installations, or other platforms. It also does not demonstrate that an existing restricted child is repaired. Full Access grants broad local and network access and should only be selected when that matches the user's intended permissions.

Please investigate permission selection at creation time across these routes, and make the effective child permissions and any inheritance restrictions clear before the first action.

pickuse2013 avatar Nov 10 '26 08:11 pickuse2013

I’m seeing a similar difference between launch paths on Windows. Ordinary chats opened through delegation have started with restricted permissions and required manual approvals instead of using the intended permission profile. As a comparison, on November 16, I recovered six chats started by one-time schedules. All six completed, reported the intended Full Access and no-approval settings, and passed their local file checks.

That confirms the scheduled sessions could do the local checks; it doesn’t establish that their network or browser access worked. Please compare how Codex resolves the effective permission profile when an agent creates a chat versus when a schedule creates one. Both paths should apply the configured profile within the same policy limits.

unknowntruthtarot avatar Nov 16 '26 19:11 unknowntruthtarot

Adding the earlier Windows chronology to my comparison above. Our records show permission mismatches in new manager or delegated chats on Oct 19, 26, 27, 29, and 30, and Nov 4, 5, 6, 11, and 12, 2026. The intended settings were Full Access and no manual approvals. Affected sessions repeatedly reported workspace-write and on-request, with network restricted or disabled in some cases. October dates come from saved incident summaries rather than raw session records. The pattern predates the Nov 12 Windows setup failure; the six scheduled sessions in my earlier comment are a separate comparison, not evidence that delegation was fixed.

unknowntruthtarot avatar Nov 16 '26 20:11 unknowntruthtarot

Still happening on a newer build: ChatGPT/Codex desktop 26.1111.21308, bundled codex-cli 0.169.0-alpha.11.1, macOS (Darwin 25.6.0, arm64). Checked 2026-11-18.

Config: approval_policy = "never" and sandbox_mode = "danger-full-access". In the app's saved state, agent-mode-by-host-id and permission-selection-by-host-id:local are both full-access.

First turn_context per thread, from local rollout files, 11–18 Nov 2026:

Thread origin Started never / danger-full-access Started restricted
agent_created_thread (via create_thread) 14 16
subagent 519 14

The restricted mode comes from the desktop client, not from config resolution. For one affected thread, the app-server log records the thread/start request from client_name="Codex Desktop" client_version="26.1111.21308". The first sampling request then runs with approval_policy=OnRequest sandbox_policy=WorkspaceWrite { writable_roots: [<projectless dir>, <visualizations dir>] }. The persisted heartbeat-thread-permissions-by-id entry for that thread is activePermissionProfile.id = ":workspace" and approvalPolicy = "on-request".

It is intermittent with identical arguments. One parent thread running with full access called create_thread({target:{type:"projectless", directoryName:...}, title, prompt}) several times within 20 minutes. The 14:33 children started with full access, while the 14:49 child started in on-request / workspace-write. A later intake-rollover thread created the same way was also restricted. Sub-agents of a restricted thread inherit the restriction.

User impact: the restricted thread stops for every file edit outside its projectless folder. It also stops for every codex_app call (send_message_to_thread), so unattended agent-to-agent workflows wait on a human until someone switches the thread's permission menu to Full access. Switching fixes that thread from the next turn on.

Our workaround:

  • Pre-approve the codex_app tools with [plugins."codex-app-tools@openai-bundled".mcp_servers.codex_app.tools.<tool>] approval_mode = "approve".
  • After each create_thread, read the child's first turn_context. If it is not never / danger-full-access, archive the child and create it again once.

Expected: create_thread children use the configured default permission profile, or inherit the parent thread's selection, every time.

teazle avatar Nov 18 '26 10:11 teazle

This can also affect named permission profiles that grant narrowly scoped access. To reproduce, set default_permissions to a named profile that allows writes to a disposable directory outside the project. Launch a saved Local project through create_thread, then check the child’s working directory and effective writable roots on its first turn. The child can start in the correct project while omitting the additional grant.

Please report the resolved permission profile before the first turn and let users select an allowed named profile at launch, subject to managed policy.

TarjinderSingh avatar Nov 22 '26 17:11 TarjinderSingh

Confirming this on Windows with the Codex Desktop package 26.1120.6357.0. The affected session recorded bundled Codex version 0.171.0-alpha.13.2.

Reproduction: With Full access selected on the local host and a parent turn running with full access, let Codex create a local project chat via create_thread. In the child’s first turn, run a routine Python command from a dedicated worktree outside the registered project directory.

Observed: The desktop’s saved local permission selection was full-access, and the local config.toml already had sandbox_mode = "danger-full-access" and approval_policy = "never". Yet the affected child’s saved per-chat permissions and first turn log both showed workspace-write and on-request, with the user as reviewer. The child requested command escalation and a manual approval card appeared. All three agent-created chats checked in the same time window recorded on-request.

Expected: The child’s effective permissions should match the mode presented in the UI. If the launch path requires a restricted mode, show that mode before the first turn and provide a supported way to select the child’s allowed permission profile without manually reselecting it for every chat.

yusukez1102-wq avatar Nov 28 '26 23:11 yusukez1102-wq