Skip to content

AGENTS.md files resolve hierarchically as conversation context

AGENTS.md content no longer goes into the system prompt. The agent instructions capability resolves the configured files hierarchically, from the filesystem root to the working directory, with deeper files winning and sibling directories out of scope. The result is inserted as the leading user-role message of each turn, behind a header that marks it as workspace content.

This keeps untrusted repository instructions below harness safety instructions and keeps the system prompt stable for caching. Resolution is bounded to 16 files, 32 KiB each and 128 KiB in total.

See Agent instructions and Use AGENTS.md. #3501