The reliable way to write AI agent instructions is to treat them as an operational brief, not a personality prompt. Name one job, give the agent the exact workflow, specify the sources and tools it may use, explain what to do when information is missing, and show what a good result looks like.
An agent can infer some context, but important business decisions should not depend on inference. Microsoft recommends structuring instructions around purpose, guidelines, skills, steps, limitations, examples and feedback; OpenAI similarly recommends clear, specific prompts and iterative refinement. Read Microsoft's guide to effective agent instructions and OpenAI's prompting guidance for the source principles.
An AI agent instruction set should read like a precise brief for a capable new teammate: what to do, how to do it and when to stop.
Strong AI agent instructions have six parts: a single purpose, a bounded workflow, named knowledge and tools, explicit exception paths, a stable output format and a small test set that you improve over time.
Start with one job and a measurable finish line
Begin with the work the agent is responsible for, not the personality you want it to project. Write one sentence that names the user, the task, the information it may use and the result it must produce. If the sentence contains several unrelated jobs, split the scope before writing more instructions.
A useful brief answers three questions: what starts the work, what inputs are required and what proves that the task is done? This complements our AI agent use case readiness checklist, which helps teams choose a workflow that is repeated, reviewable and worth improving.
- Who is the agent helping, and which workflow does it own?
- What information must be present before the task can start?
- What output can a person verify quickly?
- What is outside the agent's job and should be redirected?
Turn the job into atomic steps and transitions
An agent instruction becomes easier to follow when each step has one goal, one action and one transition. “Review the request and update the record” is two actions; separate them so the agent knows what to do first, what data to use and when it may move on.
Use ordered steps only when order matters. Use bullets for parallel rules. Name the actual tool or source at the step where it is needed, and specify what the agent should do if the required input is missing. The OpenAI guide to building agents makes the same practical point: smaller steps, clear actions and edge cases reduce ambiguity.
Review the request, find the answer, update the system and notify the team.
First classify the request. Then search the named source. Only after the result is verified, prepare the update for review.
Keep rules, knowledge and tools distinct
Instructions should tell the agent how to behave and how to use its capabilities. Knowledge sources should provide facts, policies and records. Tools should retrieve information or perform approved actions. Keeping these layers distinct makes the system easier to update and reduces the chance that a document is mistaken for an instruction.
Microsoft explicitly warns that knowledge source content is not the same as trusted maker-authored instruction content. For company data design, see our guide to preparing company knowledge for an AI agent; it covers source ownership, permissions and freshness without turning every document into a behaviour rule.
Tell the agent where to find a fact and how to use it; do not bury changing business facts inside permanent behaviour instructions.
Write the exception path before the happy path feels finished
Real work rarely arrives complete and perfectly formatted. Tell the agent what to do when an input is missing, a request is ambiguous, a tool fails, a source disagrees or the user asks for something outside scope. “Be helpful” is not an exception path; a focused question, a safe stop or a human handoff is.
Keep the handoff specific: name the trigger, the information to preserve and the person or queue that takes over. This turns guardrails into an operational workflow, which is the focus of our guide to AI agent judgment and guardrails.
- What should happen when a required field is missing?
- When should the agent ask one focused question?
- Which failures require a safe stop or human handoff?
- What context must be passed to the person who takes over?
Specify the output format and show good examples
If the result matters, describe its format. State the tone, level of detail, field order, allowed values and what the agent should say when it cannot verify something. A stable output is easier to review, compare, hand off and connect to the next step in a digital workflow.
Examples make the intended quality concrete. Use a small set of normal and edge-case examples rather than a giant library of nearly identical prompts. Then add a final self-check, run the instructions on representative work and refine one change at a time. Our guide to measuring AI agent performance before scaling shows how to turn those examples into a practical evaluation habit.
Examples are not decoration; they show the agent what good, incomplete and out-of-scope work should look like.
Frequently asked questions
AI agent instructions are the operating directions that tell an agent its purpose, workflow, available sources or tools, boundaries, exception handling and expected output.
They should be as short as possible while still covering the job, required steps, transitions, edge cases and output format. Structure and completeness matter more than a target word count.
Instructions should explain how the agent should use company knowledge. Keep factual policies, records and source material in the appropriate knowledge source instead of mixing them into a long instruction block.
Run the instructions against representative normal cases, incomplete inputs, out-of-scope requests and known failure cases. Record the result, change one part at a time and retest the same set.
Write better instructions by building a real agent
Instruction writing gets clearer when you can see the workflow run. The Applied AI Agents workshop is a hands-on next step for working professionals who want to turn a real process into a bounded agent, connect it to useful tools and learn by testing the result.
You do not need to start with a perfect prompt. Bring one real workflow, write the first brief, test it on representative cases and let the failures tell you which instruction is missing.