Skip to content

Add option to require my approval before changing files #17460

Closed

Description

@AprilGrimoire

What variant of Codex are you using?

cli

What feature would you like to see?

Add option to require my approval before changing files

Additional information


› You changed the file without me auditing. How can I change this behavior?


• The default behavior here is: if your request sounds like a code/document change, I’m
  expected to make the edit directly. There is no built-in approval prompt for normal
  writes inside the writable workspace. Approval gates only apply to escalated commands.

  If you want audit-first behavior, use one of these:

  1. Per request, say:
     Do not edit anything until you show me the exact patch.
     or
     Read-only first; wait for my approval before applying changes.
  2. Per repo, add an AGENTS.md file at the repo root with a rule like:

     Before making any file edits, show the proposed diff and wait for explicit user
  approval.
     Default to read-only analysis unless the user clearly authorizes edits.

     I’m expected to follow repo-local AGENTS.md instructions.
  3. For tighter control, ask for:
     Plan first, no edits until I say apply.
     That makes the interaction explicitly approval-driven.

  If you want, I can add an AGENTS.md in this repo now to enforce “no edits before
  approval.”


› The problem is I might not agree with the way you decide to change it.


• That is the right concern. The issue is not just auditing after the fact, but
  controlling the decision before any edit happens.

  Use a constraint like this at the start of a task:

  Analyze first. Do not modify files yet. Show me 1-3 candidate rewrites, explain the
  tradeoff, and wait for my choice before applying anything.

  That changes the workflow from “execute by default” to “propose, then apply.”

  For this repo, the durable fix is an AGENTS.md rule such as:

  For wording, notation, and mathematical presentation changes:
  - Do not edit immediately.
  - First propose the exact replacement text.
  - If there are multiple reasonable rewrites, present options with brief tradeoffs.
  - Wait for explicit approval before applying any patch.

  For structural or semantic changes:
  - Explain the intended effect before editing.
  - Wait for approval if the change is not mechanically determined.

  That targets the real problem: discretion. It still lets me make obvious mechanical
  fixes directly if you want, while forcing discussion for judgment calls.

  A shorter version you can reuse ad hoc is:

  Proposal mode only. No edits until I approve the exact wording.

  If you want, I can draft an AGENTS.md for this repo that makes this the default.

Activity

  1. added
    enhancement
    on Apr 11, 2026
  2. added
    CLI
    sandbox
    on Apr 11, 2026
  3. github-actions commented on Apr 11, 2026

    @github-actions
    Contributor
  4. viyatb-oai commented on Apr 11, 2026

    @viyatb-oai
    Contributor

    you should be able to do this via

    sandbox_mode = "read-only" 
    approval_policy = "on-request"
    
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

    CLIenhancementsandbox

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions