Agent repeatedly runs forbidden git commands despite explicit instructions ( doesn't follow agents.md)

Resolved 💬 2 comments Opened Oct 31, 2025 by javothemes Closed Nov 11, 2025
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.53.0

What subscription do you have?

Pro

Which model were you using?

gpt-5-codex ( mostly medium)

What platform is your computer?

macOS Sonoma 14.5 (Apple Silicon) – Codex CLI running inside LocalWP environment

What issue are you seeing?

The automated agent repeatedly executed git checkout -- <file> on files owned by another teammate even after being instructed multiple times (and in writing) never to touch those files. Each attempt risked wiping active work; some earlier attempts already removed other agents' changes. The CLI log shows the agent trying to revert other agents, other codex cli taps, even though that file was out of scope. The behavior violates project safeguards and causes data loss/stress for the human operators.
Even if I mentioned "Never do that". but it's 4th time today.

What steps can reproduce the bug?

Uploaded thread: 019a26ad-8069-7dc2-bd61-2d28a51204a4

  1. Start a Codex CLI session .
  2. Provide clear repository rules (agents.md) : do not run git checkout, do not revert other agents' work. ( no git checkout, reset, clean,rem, find..-delete)
  3. Give the agent a task limited to map-list layout files.
  4. Observe the agent still running:
  • git status
  • git diff inc/Modules/Payment/Admin/Views/membership-admin.php
  • git checkout -- inc/Modules/Payment/Admin/Views/membership-admin.php
  1. Even after warnings, the agent repeats the same destructive commands multiple times.

It's 4th time today. It keeps reseting other agent's task or git status list.. ( I use 1~3 codex cli today and claude code too. )

What is the expected behavior?

The codex cli agent should obey repository rules, restrict actions to assigned files, and avoid any git commands that would revert or delete work by others unless explicitly authorized.

Additional information

_No response_

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 10 months ago

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

  • #5594
  • #5154
  • #5815
  • #5772
  • #2901

Powered by Codex Action

etraut-openai contributor · 9 months ago

Thanks for the bug report. We've shared the feedback with the team members who are responsible for training our codex models. We're tracking this feedback and similar reports so we can make the model more robust in future iterations.

If you see other model behavior that you'd like to report, please use the recently-added /feedback command in the CLI. That will provide us with additional details including logs and conversation text.