codex - 💡(How to fix) Fix Add option to require my approval before changing files [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#17460Fetched 2026-04-12 13:28:22
View on GitHub
Comments
2
Participants
3
Timeline
6
Reactions
0
Timeline (top)
labeled ×3commented ×2closed ×1

Fix Action

Fix / Workaround

  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:

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.

Code Example

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.
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

To require approval before changing files, add an AGENTS.md file to the repository root with a rule that specifies waiting for explicit user approval before making any file edits.

Guidance

  • To achieve audit-first behavior, use one of the provided phrases, such as "Do not edit anything until you show me the exact patch" or "Read-only first; wait for my approval before applying changes", on a per-request basis.
  • For a more permanent solution, add an AGENTS.md file to the repository root with a rule that targets specific types of changes, such as wording or structural changes, and requires approval before editing.
  • Consider using a constraint at the start of a task, such as "Analyze first. Do not modify files yet. Show me 1-3 candidate rewrites, explain the tradeoff, and wait for my choice before applying anything", to change the workflow from "execute by default" to "propose, then apply".
  • Use a shorter version, such as "Proposal mode only. No edits until I approve the exact wording", for ad hoc requests.

Example

No explicit code snippet is provided, but an example of an AGENTS.md rule is given in the issue body:

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.

Notes

The provided solution is specific to the Codex cli variant and may not apply to other variants or versions.

Recommendation

Apply workaround: Add an AGENTS.md file to the repository root with a rule that specifies waiting for explicit user approval before making any file edits, as this provides a durable fix for controlling the decision before any edit happens.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Add option to require my approval before changing files [2 comments, 3 participants]