Skip to content

Allow sub-agent escalation requests to inherit parent auto-approval policy #23324

Open

Description

@thomast8

What problem are you trying to solve?

When Codex uses delegated sub-agents, a child agent can hit a sandbox escalation prompt, for example while running a safe verification command such as uv run .... In the main agent loop, the auto-approval mechanism can classify and approve safe recurring commands with narrow prefix rules, so the workflow remains autonomous.

For sub-agents, the same kind of escalation can block indefinitely because the parent agent does not appear to receive an actionable approval event, and the user is not necessarily watching the child thread. This makes review/exploration sub-agents less reliable, especially for long-running code review gates.

Desired behavior

Sub-agent escalation requests should be handled by the same approval policy available to the parent agent, or routed through the parent agent as an approval broker.

A useful behavior would be:

  • Child agent requests escalation for a command.
  • The request is evaluated by the inherited auto-approval classifier and existing approved prefix rules.
  • If approved, the sub-agent continues without user intervention.
  • If denied or ambiguous, the request is surfaced to the parent/main thread with the exact command, justification, and suggested prefix rule.
  • The child should not silently block in a place where neither the parent nor the user can keep the task moving.

Why this matters

Delegated review agents are most valuable when they can run in parallel and stay autonomous. Today, a parent agent can preflight common commands, but it cannot predict every verification command a sub-agent may discover while reviewing. When that happens, the sub-agent may stall instead of returning useful partial findings.

This pushes users toward brittle prompting rules like "sub-agents must never request escalation," which avoids deadlocks but also reduces verification quality.

Possible implementation

Consider one of these models:

  1. Inherit the parent thread's auto-approval policy and approved prefix rules into child agents.
  2. Route child escalation requests to the parent agent loop for classification.
  3. Add a sub-agent setting such as approval_policy = inherit | parent_brokered | never.

The key requirement is that sub-agent escalation should not create an unobserved blocking approval prompt.

Environment

Codex App with delegated sub-agents and sandboxed command execution.

Activity

  1. added
    enhancement
    app
    subagent
    sandbox
    on May 18, 2026
  2. github-actions commented on May 18, 2026

    @github-actions
    Contributor

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

    Powered by Codex Action

  3. 1Ghasthunter1 commented on Jul 9, 2026

    @1Ghasthunter1

    Plz

  4. ShadowTheFrog commented on Aug 22, 2026

    @ShadowTheFrog

    Adding a Windows Codex Desktop reproduction that shows why parent-brokered escalation matters for terminal callback workflows.

    Environment

    • Codex Desktop: 26.818.4152.0
    • Bundled CLI: codex-cli 0.147.0
    • Windows 11 build 26200
    • Multi-agent/subagent workflow with workspace-write sandboxing

    Reproduction shape

    1. A parent/orchestrator spawned one fresh, single-use subagent for a tiny callback canary.
    2. The parent deliberately ended its turn and became idle, avoiding status polling.
    3. The child was required to make one workspace-local write to a canonical callback journal, then send a native completion message to the idle parent.
    4. All task/repository preconditions matched, but the child hit Permission denied on the workspace-local journal write.
    5. No actionable approval/escalation event was surfaced to the parent. Consequently, the child could not create the callback or attempt the completion send, and the parent remained idle until a user message resumed it.
    6. A single bounded owner readback identified the permission failure; repeated polling was not used.

    This is not a pure parent-wake reproduction of #15723 because the send was never reached. It is an example of this issue's core problem: a subagent's missing/inapplicable write authority or escalation path can silently strand an autonomous parent workflow.

    Expected

    • The child should inherit the parent's effective approval/auto-review policy for a monotonic in-workspace operation, or
    • the escalation should be surfaced as an actionable parent event with the exact command/path and requested delta.

    A subagent should not fail or wait invisibly while the parent has no event that can resume the workflow.

    Current workaround
    We are adding an explicit launch preflight that proves the child can write the exact callback store (or can request controlled escalation) before the parent enters passive wait. This reduces the symptom but does not replace a runtime-level inherited or parent-brokered approval path.

  5. NaturalMatchaKing commented on Oct 6, 2026

    @NaturalMatchaKing

    Strong +1 for the parent-brokered option. Both the user and a coordinating assistant would value an opt-in way to delegate bounded approval decisions: the assistant could approve or deny routine child-task escalations within an explicit, revocable user-defined scope, instead of the user clicking every prompt. The request and decision should be visible in an audit trail. Out-of-scope actions and mandatory human security confirmations would still go to the user.

    It would also help to expose structured pending-approval status to the coordinating assistant: which thread is requesting approval, the proposed action, and whether execution is blocked. Clear approval lifecycle notifications would let the assistant identify the right task and promptly tell the user what is needed, even when approval must remain human-only.

    Related visibility request: make project-associated threads that run with a connected computer visible in Codex web as well, including their execution state and pending approvals. This would help the coordinating assistant and user follow the same task across desktop and web.

  6. zhangheyong commented on Oct 16, 2026

    @zhangheyong

    Adding a related user experience from ChatGPT dot on 2026-10-16 (main conversation on mobile, delegated work on a connected Mac). I cannot confirm that this has the same underlying cause as the original Codex sub-agent issue.

    I delegate a task and explicitly approve a bounded action in the main conversation. The assistant passes that approval to a desktop task, but the task can still reject the forwarded authorization. I then have to locate the child conversation and repeat the instruction or approval. In some cases there is only a denial, with no actionable approval request that the main assistant can surface. This makes the user coordinate the agents instead of the assistant coordinating them.

    Requested improvement:

    1. Carry verifiable, narrowly scoped user authorization from the main conversation to the delegated task, preserving the action, target, limits, and any later revocation.
    2. When a new approval is genuinely required, return a structured pending request to the main conversation, with the exact action, target, impact, and originating task.
    3. Let the user approve or deny that original request in the main conversation, including on mobile, and resume the correct task once without duplicate prompts.
    4. Clearly distinguish missing approval, a changed scope, unavailable permissions, and a non-overridable denial. Do not leave tasks silently blocked or require users to search child threads.

    This is not a request to bypass safety checks or grant blanket access. The goal is to preserve meaningful, action-specific confirmation while removing repeated authorization and conversation switching. A related dot report appears in #45167.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appenhancementsandboxsubagent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions