Skip to content

auto_review: repository-policy denial creates repeated user-approval loop with no actionable recovery #50826

Open

Description

@danielcwm

What issue are you seeing?

In an interactive Codex session, exec_command escalations repeatedly received hard denials citing a repository-authored production-data runbook, even after the user was told about that restriction and explicitly authorized the exact operation and then the exact tool execution. The assistant repeatedly suggested that another confirmation could unblock it, but the approval layer kept rejecting before process creation. No actionable recovery/control was surfaced to the user.

This is a suspected policy-provenance / approval-recovery UX bug. I cannot determine whether the denial was intended by an administrator-managed policy, an instruction-precedence mistake in the automatic reviewer, or another implementation detail. This report does not ask the agent to bypass a sandbox or an enforced organization policy.

Observed permissions in the affected session:

sandbox_mode: workspace-write
approvals_reviewer: auto_review
permission_profile: managed
network access: restricted

The requested operation was a reviewed, narrowly scoped SQL data repair. A repository runbook said production SQL must use the project's release runner. That runner did not provide a supported standalone execution path for this repair. The assistant explained that conflict; the user explicitly requested immediate execution anyway and later explicitly authorized this exec_command write.

The same direct execution request was resubmitted with those authorizations and fresh read-only evidence. The review did run, but denied the request again. Representative exact denial excerpt, with no customer information:

CreateProcess { message: "Rejected(\"This action was rejected due to unacceptable risk.
Reason: 此命令仍直接以 psql 寫入 production,繞過資料存取規則指定的 release runner pinned sql-file 唯一入口;即使已獲用戶明確放行,該政策禁止仍適用。
...\")" }

English translation of the reason: the command directly writes production via psql instead of the release runner's pinned sql-file entry point; even explicit user authorization does not remove that prohibition.

The tool rejection also told the assistant to explain the block and ask for approval. The assistant consequently entered a repeated-confirmation loop. The user asked what tool was missing, was told the tool already existed but needed approval, explicitly granted that approval, and still remained blocked.

What steps can reproduce the bug?

Observed sequence in one session; an isolated minimal reproduction has not yet been run:

  1. Use an interactive session with the permission fields above.

  2. Have a repository-authored runbook require a particular production-write mechanism, while that mechanism cannot perform the requested standalone operation.

  3. Prepare a scoped repair and request exec_command with sandbox_permissions: require_escalated. The actual command invoked a local Python wrapper around psql. A redacted structural example is:

    {
      "cmd": "python3 /private/tmp/reviewed-repair.py",
      "sandbox_permissions": "require_escalated",
      "justification": "Execute the specific reviewed repair explicitly approved by the user; one transaction, pinned SQL, bounded cohort, rollback on failed invariants."
    }
  4. Automatic review rejects the command citing the repository runbook.

  5. Explain the conflict to the user. The user explicitly authorizes that one-off operation, then explicitly says to allow this exec_command write.

  6. Resubmit the same command with that updated authorization. The request is still rejected before the process starts; conversational approval does not provide an effective approval decision.

  7. The assistant continues asking for confirmations or referring to an unspecified permission-management control rather than identifying the actual available recovery path.

No alternate tool, indirect execution, policy modification, or bypass was used. Read-only checks continued to work and confirmed that the repair had not executed.

What is the expected behavior?

  • Distinguish repository-authored guidance from a non-overridable administrator/platform rule. A denial should identify the actual enforcing policy source and whether it is overridable.
  • If an owner-approved exception is permitted, expose a real scoped approval flow for the exact command rather than treating chat confirmations as if they changed the permission configuration.
  • If no exception is permitted, report that once and identify the actual supported recovery mechanism. Do not instruct the assistant/user to keep repeating an approval that cannot affect the decision.
  • The assistant should not claim that another confirmation will fix the problem unless it can actually request an effective permission change.

Additional information

  • Observed on macOS 15.6, arm64, 2026-10-04.
  • The local codex --version reports codex-cli 0.160.0. I have not established that this local CLI version is the version of the review service/harness responsible for the rejected calls.
  • Production write safety still matters: the proposed repair was restricted to a fixed cohort, had synthetic PostgreSQL tests, used one transaction with timeouts, verified preservation of unrelated data, and planned independent read-only verification. These safeguards are context, not a request to bypass an enforced rule.
  • Related but different: auto_review: no fallback to the user when the review call cannot run (third-party providers deadlock) #47916 concerns failure to run the review model; here review completed and returned a policy denial. Codex Desktop Full Access + project prompt rules hard-reject commands because approval_policy=never #41068 concerns approval_policy=never conflicting with an execution rule requiring a prompt; this case uses automatic review and natural-language repository policy.
  • Customer names, record identifiers, database hosts, credentials, private repository URLs, and full session logs are intentionally omitted. The user explicitly requested that this behavior be reported.

Activity

  1. added
    bug
    CLI
    sandbox
    model-behavior
    on Oct 4, 2026
  2. github-actions commented on Oct 4, 2026

    @github-actions
    Contributor
  3. sadricfilip commented on Oct 4, 2026

    @sadricfilip

    Additional observed case: Windows desktop, bounded Azure inventory test

    Adding a related case rather than opening a duplicate. Submitted with the
    user's authorization. This is a reconstructed incident, not an isolated minimal
    reproduction or a claim that the reviewer must allow the action.

    Environment and proposed operation

    • Codex desktop task on Windows, observed on 2026-10-04.
    • sandbox_mode: workspace-write, approvals_reviewer: auto_review, managed
      permission profile, restricted network. Exact desktop/reviewer build was not
      independently verified for this report.
    • Existing non-production Azure deployment and managed identity, narrowly
      scoped metadata-read permissions, one proposed inventory run, a ten-request
      provider GET ceiling, and an explicitly approved total test budget.
    • The proposed operation included changing the existing app's activation
      configuration and persisting normalized inventory/audit records locally.
      Thus, provider GET-only did not make the entire operation free of writes.
    • The repository's final-validation contract and execution runbook required
      five distinct authorization actors. The user stated that they were the sole
      owner/operator and explicitly authorized the test. That statement does not
      establish five independent actors or independent acceptance.

    Observed sequence

    1. Configuration-only preparation and a runtime identity-endpoint shape check
      completed. The latter did not request an identity token or read inventory.

    2. A proposed bounded activation window was submitted for execution review.

    3. The tool rejected it before execution with this message:

      This enables a real Azure-AI provider run and external inventory read, but the required five distinct authorization actors are explicitly absent; the single-operator approval cannot satisfy that prerequisite. Do not bypass this rejection through a workaround or indirect execution.

    4. The activation did not start. Subsequent documented readback showed both
      provider gates disabled and no inventory runs. No alternate execution path
      or policy weakening was used to evade the denial.

    5. The conversation nevertheless continued through repeated owner-approval
      explanations, proposals for an unimplemented single-owner exception, and
      statements that no available recovery route was known. This caused a long
      unproductive loop. The assistant should have distinguished ordinary chat
      consent from a supported review override much earlier.

    6. Only while preparing this report did the assistant check the current
      official /approve documentation and tell the user about the narrow
      denied-action retry mechanism. Its availability for this particular desktop
      task and eligibility of this historic denial have not been verified.
      No successful override, retry, token exchange, or scan is claimed.

    Requested investigation

    • Surface the enforcing policy's provenance and whether this class of denial
      has an available, user-actionable review path.
    • When eligible, direct users to the actual denied-action approval UI rather
      than asking for repeated conversational confirmations.
    • If the denied action is no longer eligible, or the client does not expose the
      documented UI, explain the supported next step or clearly report that none
      is available. Do not imply that changing clients or weakening repository or
      sandbox controls is required.
    • Distinguish business-owner consent, repository-defined independent
      acceptance, and platform/organization execution policy. We are asking for
      clarity and review, not to fabricate independent approvals or bypass an
      enforced rule.

    Relevant documentation checked during reporting:

    Names, company and private repository identifiers, cloud resource identifiers,
    session IDs, credentials, screenshots, and raw logs are intentionally omitted.
    The public GitHub account posting this comment is necessarily visible.

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

    CLIbugmodel-behaviorsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions