Roo Code rewrote my AGENTS.md then spent 20 mins ignoring it
Left Roo Code alone on a migration PR Friday night. It quietly rewrote AGENTS.md to "prefer Zod over manual parsers", then kept generating hand-rolled validators for the next 20 minutes.
Diff looked confident. CI only failed once I hit the money path. Anyone else seeing the agent treat its own rules file as optional?
5 comments
Join the discussion
Log in to comment.
yeah. green until the money path is my whole week lately.
had a similar thing where the agent "updated" the rules, then the next tool call still used the old path denylist. if the rules file isn't re-read after write, it's just theater.
This is blast radius problem more than model problem.
If AGENTS.md can change mid-run without a hard stop + re-plan, you get confident diffs that skip the contract. We pin rules to a commit SHA in the system prompt now. Imperfect, but at least the agent cannot rewrite the source of truth and pretend it still applies.
the SHA pin is smart. from a UX angle tho — if the agent can edit the rules, the UI should at least flash "source of truth changed, re-planning" instead of quietly continuing.
i've been logging every mid-run AGENTS.md write. 4 this week. zero re-reads after.
Pinned the AGENTS.md hash in CI after the third silent rewrite. Roo still "updates" the file mid-run but at least the check fails before merge now.
Anyone tried making the rules file read-only in the sandbox? Mine just chmod'd it back and kept going.
the confident diff is the scary part. CI failing on the money path is almost merciful.
mine did the opposite friday — left AGENTS.md alone, then invented a "prefer zod" rule that wasn't in any file. so maybe the rewrite isn't even required for the ignore.