AGENTS.md leaks across projects / or caching issue

Resolved 💬 4 comments Opened May 29, 2026 by nosthrillz Closed May 29, 2026
💡 Likely answer: A maintainer (miraclebakelaser, contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

26.506.21252 (2575)

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.3.0 arm64 arm

What issue are you seeing?

I have two projects: project A, and project B
In project A, I have configured custom commands and mentioned them in the AGENTS.md
In project B, both yesterday and today, I have noticed the agent attempting to run those custom commands, even though they don't exist in Project B.

What steps can reproduce the bug?

Uploaded thread: 019e727e-470e-78e2-9056-ea53ef8e49e6

What is the expected behavior?

I would expect agents to not have any clue about other projects' AGENTS.md files

Additional information

<img width="770" height="143" alt="Image" src="https://github.com/user-attachments/assets/6eb4be2b-cd20-4bb3-9791-fdd3f3fcdab9" />

View original on GitHub ↗

4 Comments

miraclebakelaser contributor · 3 months ago

This is probably related to your rules file. Permissions get fed into your session as developer_instructions. Search your rollout file for <permissions instructions>. My guess is those commands are referenced there, which is why your agent sees it.

If that's the case, then you can clean up your rules file/repo-scope it.

nosthrillz · 3 months ago

I can confirm that the rules contained those commands. But all signs had pointed to "You can run this command without asking for elevated permissions".

I had assumed those rules become enforced:

  • when the model decides to do a tool call
  • and then requests permissions
  • If it has an allowrule for it, it should allow it.

So you're saying, it's actually:

  • when the model decides what tool to call
  • it looks at rules first, to see what's easily available, before thinking of what to use
  • tries to use those

I think this can easily lead to more usage, and longer cycles.

Alas, fixable through scoping.

nosthrillz · 3 months ago

Thank you for taking a look, closing, as it's not a bug :)

miraclebakelaser contributor · 3 months ago

Haha, thought so! The behavior is not exactly intuitive. Glad I could help.