How to Write AI Agent Instructions That Actually Work
Use goal, inputs, process, output, tool rules and stop conditions to make reusable instructions more reliable.
The short answer
Agent instructions are a specification for a job, not a magic role label. A long persona with many adjectives is usually less useful than a clear task contract. Say what the assistant should produce, what information it must request, how to handle missing evidence, and what it may not do. For a tool-using system, define its allowed actions and required confirmation outside the prompt as well. A prompt cannot replace technical permission controls.
How to get started
- Describe the role and the finished output in one sentence.
- List required inputs and a sequence of checks. Include a fallback for missing or contradictory evidence.
- Specify the output format, a stopping rule and actions requiring your approval; test with both a normal and difficult input.
Help me review a product listing. Ask for the exact model and budget. Compare three sources by delivered price, warranty and return policy. Label any unavailable facts. Return one table and a recommendation; never purchase.
What to check
Check that the assistant does not invent a third source when only two exist. If it misses a requirement, revise the instruction and re-run the same test instead of adding vague warnings.
Try the related free AIBin resource. Use instructions in a supported AI chat or run the available browser tool.
Open the prompt generator →References & further reading
- OpenAI — A practical guide to building agents
- Anthropic — Building effective agents
- OWASP GenAI Security Project — Prompt injection
Examples are illustrative. Access, pricing and feature availability vary by provider. Read the original documentation before relying on a capability.