Repository navigation
Apply access-control changes to the currently running turn #32612
Description
What variant of Codex are you using?
App
What feature would you like to see?
When the access-control or permissions setting is changed while an agent turn is already running, Codex should apply the new setting to that active turn rather than waiting until the next user turn.
At the moment, the UI allows the user to change the access-control mode during an active run, but the running agent continues using the permission context with which the turn originally started. The new setting only becomes effective when another user message starts the next turn.
Additional information
Current behavior
- Start an agent turn with a restricted access mode, such as read-only or workspace access.
- While the agent is still running, change the access-control setting to Full Access.
- The UI immediately shows the newly selected mode.
- The active agent nevertheless continues using the old access restrictions.
- The new setting only takes effect after the current turn finishes and the user sends another message.
The reverse direction appears to behave similarly: lowering access during an active turn does not immediately restrict the permissions already assigned to that turn.
Expected behavior
Changing the access-control setting during an active turn should update the effective permissions of that running turn.
For example:
- Changing from read-only or workspace access to Full Access should allow subsequent tool calls in the same turn to use Full Access.
- Changing from Full Access to a more restrictive mode should prevent subsequent tool calls in the same turn from using the previously granted permissions.
- The permission mode displayed in the UI should match the permission mode currently enforced by the runtime.
If applying the change immediately is not technically or safely possible, the UI should make this explicit, for example by displaying:
Applies starting with the next turn
Currently, the control looks like an immediate runtime setting even though it behaves as a next-turn setting.
Why this matters
Long-running Codex turns can last for several minutes or considerably longer. During such a run, the agent may discover that it needs permissions which were not granted when the turn started.
The user can already change the setting in the UI, so it is natural to expect that this unblocks the running agent. Instead, the user must currently:
- interrupt or wait for the active turn,
- send another message,
- ask the agent to resume the same work.
This interrupts the workflow, may lose execution continuity, and is especially inconvenient for long-running agent, Goal, orchestration, or background-command workflows.
It is also a security and trust issue in the opposite direction. If the user lowers permissions while an agent is running, the UI suggests that access has been reduced even though the active turn may retain its original permissions.
Suggested semantics
It may make sense to distinguish between permission reductions and permission increases.
Permission reduction
A reduction in access should ideally take effect immediately for all subsequent tool calls in the active turn.
Examples:
- Full Access → workspace access
- workspace access → read-only
Already-running processes may need separate handling, but no new privileged operation should begin after the restriction is applied.
Permission increase
An increase in access could either:
- update the active turn’s runtime permission context immediately, or
- pause the active turn at the next permission boundary and resume it with the new permission context.
Examples:
- read-only → workspace access
- workspace access → Full Access
The model may also need updated permission guidance so that it knows the newly available operations are permitted.
Possible implementation direction
The active turn appears to retain a permission or sandbox snapshot created when the turn starts, while settings changed through the UI are applied as next-turn thread settings.
A possible implementation could:
- update the active thread settings,
- propagate the new approval policy, reviewer, sandbox policy, and permission profile to the active turn,
- refresh the model-visible permission guidance where necessary,
- ensure that subsequent tool executions use the updated permission snapshot,
- emit a runtime event confirming that the active turn has adopted the new mode.
If active-turn mutation would introduce consistency problems, Codex could instead perform an internal pause-and-resume operation without requiring a new user message.
Acceptance criteria
- Changing access control during an active turn affects subsequent tool calls in that same turn.
- The effective runtime mode always matches what the UI displays.
- Reducing permissions prevents new operations that would violate the new setting.
- Increasing permissions allows the agent to continue without requiring a new user turn.
- Resumed, delegated, Goal, and compacted turns preserve the updated permission context.
- If active-turn updates are unsupported, the UI clearly states that changes apply only to the next turn.
Additional context
This is different from existing reports about stale or incorrect permission propagation across resumed turns or Goal continuations. In this case, the next turn receives the newly selected permissions correctly. The requested feature is specifically for applying a permissions change to a turn that is already running.
Activity
github-actions commentedon Jul 12, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
simon-ami commentedon Jul 12, 2026
Reviewed this, but it's not a duplicate
BGMLAI commentedon Jul 14, 2026
Applying a weaker or stronger policy mid-turn needs explicit semantics. The safe rule is monotonic restriction: tighter access takes effect immediately and cancels pending operations that no longer qualify; broader access applies only to future tool calls after the runtime acknowledges a new permission_context_id. Already-issued approval prompts should be invalidated when the context changes. The UI should show the active generation separately from the next-turn selection so users can see whether a running action is still governed by the old profile.
HuangYincan commentedon Oct 15, 2026
Observed the same behavior with Codex TUI reporting version 0.162.1 on macOS, using
/permissionson 2026-10-15. This also affects switching the approval reviewer to Approve for me, not just changing sandbox access.Observed sequence
The following is a sanitized summary of local session and runtime logs (all times UTC):
Messages sent while Turn A was running remained within that execution; they did not produce a new
turn_contextwith the updated permissions. The later fresh turn did record the updated Full Access settings.This supports the interpretation that the setting change was received, but the active turn continued using its earlier approval context. It is evidence from one observed session, not a controlled reproduction or confirmation of the underlying implementation. We did not test reducing permissions mid-turn.
User impact / expected behavior
The permissions control lets the user select “Approve for me” or “Full Access,” yet the running task can continue asking for manual command approval. This makes a successful settings change look broken.
Ideally, subsequent tool calls should adopt the updated settings at a defined safe boundary. If changes only apply to a new turn, the UI should explicitly show “Applies to the next turn; the current turn still uses [previous mode]”, and offer a stop-and-resume action. Pending approval requests should also clearly identify which permission context they use.
rqas-git commentedon Oct 17, 2026
Confirmed the CLI reviewer-switch case on Codex 0.163.0, macOS arm64 (Darwin 25.4.0). The backend already supports a live reviewer update; the CLI does not send it.
A sanitized runtime sequence from October 17 (UTC):
thread_settingswith reviewerAutoReview.auto_review; Guardian subsequently approves the escalation.The source trace narrows the cause:
sync_override_turn_context_settingssends onlythread/settings/update. The profile-selection path inconfig_persistence.rsalso calls only that endpoint.turn/settings/updateAPI supports changing the active turn's reviewer for subsequent settings captures, while preserving already captured steps and pending approvals.A proposed CLI fix is available in commit bda6d98: persist defaults, then publish the reviewer to the originally captured active turn. Both CLI selection paths are covered; a finished target is harmless, and live-update errors explain that the setting was saved for future turns.
Validation: 9 relevant CLI tests and 2 backend integration tests passed with
RUST_MIN_STACK=8388608, including reviewer changes in both directions, idle chats, omitted reviewer fields, and a stale active-turn ID. Formatting and whitespace checks passed.This addresses the reviewer-switch portion of this issue. It does not implement live changes to sandbox boundaries or the approval policy.