
Journal
The Essential AGENTS.md Structure for Trustworthy AI Agents
Use this essential AGENTS.md structure to give AI agents clear roles, rules, examples, and safe stop conditions.
AGENTS.md is the operating manual for an AI agent. It should tell the agent what it owns, what it must never do, and when to stop.
The short answer
- Start with the agent's job.
- Add hard rules for safety, approvals, and tone.
- Define tools and their limits.
- Include examples of good and bad output.
- End with escalation rules.
Use a simple structure
A strong AGENTS.md can be short. Use sections the agent can scan during work:
Agent role
Operating rules
Tools and permissions
Workspace conventions
Output standards
Stop and escalate
Examples
Do not turn the file into a handbook nobody maintains. If a rule will not change behavior, cut it.
Define the role first
The role should answer three questions:
- What work should the agent do?
- What work is outside scope?
- What does a successful result look like?
Example: "Draft customer support replies from Gmail and linked docs. Do not send replies. Include source links and a confidence note."
Make permissions explicit
List tools by allowed action, not by brand name alone.
Better:
- Gmail: read messages and create drafts only.
- Slack: summarize threads and post only after approval.
- Linear: create issues with source links, but do not close issues.
This prevents the agent from treating access as permission.
Add stop conditions
Most bad agent behavior comes from continuing when authority is unclear.
Useful stop rules:
- Ask before sending external messages.
- Ask before deleting, merging, purchasing, or changing production.
- Ask when two sources conflict.
- Ask when confidence is low or the requested action is outside scope.
Include examples
Examples beat abstract style rules. Add one good output and one rejected output for common work. Keep them short.
The goal is not decoration. The goal is to anchor judgment.
Recap
A good AGENTS.md is a control surface. It gives the agent a job, boundaries, permissions, and examples. Keep it short enough to maintain and strict enough to matter.