Desktop automations can start in workspace-write and switch to danger-full-access after chat interaction

Resolved 💬 2 comments Opened Mar 13, 2026 by KValim Closed Mar 28, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

Codex Desktop / VS Code-backed local app flow

Observed locally in session metadata with cli_version 0.115.0-alpha.4.

Which model were you using?

gpt-5.4 and previously gpt-5.3-codex in automation runs

What platform is your computer?

Windows 11

What steps can reproduce the bug?

  1. Configure Codex Desktop with global full access enabled.
  2. In local state, confirm the app is in full access mode. In my case .codex-global-state.json contains:
  • "agent-mode":"full-access"
  • "skip-full-access-confirm":true
  1. Create a recurring automation that needs Git access (git pull, branch creation, commit, PR) and runs in a local workspace.
  2. Let the automation start on its own from the scheduler/background runner.
  3. Inspect the generated rollout JSONL and/or local threads state.
  4. Then interact with the automation thread in the chat UI after it has already started.

What is the expected behavior?

If the app is configured for full access, a Git-capable automation should start with the same effective sandbox policy from the beginning.

A scheduled automation should not require a user to enter the chat before it can use the intended permission level.

What do you see instead?

Some automation runs start as background threads with:

  • sandbox_policy.type = "workspace-write"
  • network_access = false

This causes failures in normal Git automation steps such as writing .git/FETCH_HEAD or creating branch lockfiles under .git/refs/heads.

After the thread is interrupted/re-entered via the chat UI, the same thread/session can then receive danger-full-access permissions and the Git commands start working.

This makes scheduled automations unreliable and appear to "fix themselves" only after manual user interaction.

Additional information

I found strong local evidence that the sandbox differs between the automatic/background creation path and the later interactive chat path.

Evidence from local state/logs:

  1. Global app state already indicates full access:
  • .codex-global-state.json includes agent-mode = full-access
  • .codex-global-state.json includes skip-full-access-confirm = true
  1. A scheduled automation run started with restricted sandbox in its first turn context:
  • rollout file: rollout-2026-03-12T20-52-02-019ce476-e43e-7de1-bdb6-9db0d759c68f.jsonl
  • first turn_context shows sandbox_policy.type = workspace-write
  • same turn context shows network_access = false
  1. Later in the same conversation history, after turn_aborted / re-entry through the chat UI, new developer permissions were injected with danger-full-access.
  1. The local threads table in state_5.sqlite shows mixed sandbox policies for the same automation title:
  • several runs recorded as {"type":"danger-full-access"}
  • some runs recorded as {"type":"workspace-write", ... "network_access":false}

This suggests the automation scheduler/background runner may sometimes ignore or fail to inherit the current interactive full-access mode.

Related but not identical:

  • There are other issues about inconsistent sandbox/approval behavior in the extension/app, but this report is specifically about scheduled automations starting with a different sandbox than the app's configured full-access mode, then effectively recovering only after user interaction.

Impact:

  • breaks unattended Git automations
  • causes false Permission denied failures on .git
  • forces manual intervention in workflows that should be autonomous

If helpful, I can provide a sanitized excerpt of the rollout JSONL showing the initial workspace-write turn context and the later danger-full-access developer instructions in the same conversation history.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 5 months ago

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

  • #14423
  • #14053
  • #12919
  • #12996

Powered by Codex Action

jnorthrup · 5 months ago

Adding another repro from Codex Desktop on macOS with the same automation class, but surfaced through a networked worker (qwen -y) instead of Git commands.

What I found locally:

  • Automation: cpp2-scanner-hourly
  • App binary: /Applications/Codex.app/Contents/Resources/codex app-server

Exact on-disk evidence:

  1. Older blocked automation run recorded restricted sandbox in its first turn context:
  • file: /Users/jim/.codex/archived_sessions/rollout-2026-03-14T07-20-06-019cec4a-1f6a-7970-a7f5-08e5acc1d40d.jsonl
  • line 5 turn_context.sandbox_policy = {"type":"workspace-write", ..., "network_access":false}
  1. Current thread started restricted, then later switched inside the same rollout file after chat interaction / interruption:
  • file: /Users/jim/.codex/sessions/2026/03/19/rollout-2026-03-19T17-34-02-019d083b-fe9f-7a31-bd95-9a8d483e7613.jsonl
  • line 5: sandbox_policy = {"type":"workspace-write", ..., "network_access":false}
  • line 77: sandbox_policy = {"type":"danger-full-access"}
  • line 250: sandbox_policy = {"type":"danger-full-access"}
  1. SQLite thread state mirrors the later unrestricted value for that same thread:
  • db: /Users/jim/.codex/state_5.sqlite
  • table: threads
  • thread id: 019d083b-fe9f-7a31-bd95-9a8d483e7613
  • sandbox_policy = {"type":"danger-full-access"}
  1. Automation linkage:
  • db: /Users/jim/.codex/sqlite/codex-dev.db
  • table: automation_runs
  • automation_id = "cpp2-scanner-hourly" maps to the affected thread ids

Observed symptom:

  • In the restricted turn, qwen -y -p "Reply with exactly PING" failed with Error: [API Error: Connection error.]
  • After the same thread received later danger-full-access turn contexts, the exact same command on the same machine/config returned PING

So this is not only a Git-automation problem. Any automation that depends on outbound network can start in a false-failure state when the scheduler/background path gives workspace-write + network_access:false, then appear to recover after a manual chat interaction flips the thread to danger-full-access.

One more detail: the compiled app-server binary contains the permission-profile strings and templates (PermissionProfile, NetworkPermissions, workspace-write, danger-full-access, the Filesystem sandboxing... text), so this definitely looks like a host/session policy transition issue rather than repo-specific state.