How to Write Instructions AI Agents Actually Follow

Clear, practical techniques for writing agent instructions that get followed — with examples of vague versus precise wording.

Published 2026-09-26 · 6 min read

Most agent failures are instruction failures. When an agent does the wrong thing, skips a step, or confidently improvises, the usual cause is not a broken model — it is an instruction that was vague, contradictory, or buried. Agents follow instructions literally and without the common sense a person would apply to fill the gaps. That makes writing instructions a skill worth developing: precise instructions turn a flaky agent into a reliable one. Here is how to write instructions agents actually follow.

Describe the outcome, not just the activity

Vague instructions describe an activity and leave the agent to guess what "done" looks like. Precise instructions describe the finished result so clearly that you could check it in seconds. Compare "research competitors" with "produce a table of our five closest competitors with columns for price, main feature, and one weakness, saved as a markdown file." The first invites improvisation; the second is checkable. Whenever you write an instruction, ask yourself: could a stranger tell whether the job was done right just by looking at the output? If not, you have not finished writing the instruction.

State the constraints up front

Agents do not know your boundaries unless you state them. The things you would never do — sending an email without review, spending money, deleting files — are all things an agent will happily do if the task seems to require it. Put constraints at the top of your instructions, before the task itself, because agents weight early instructions more heavily. "Do not send anything. Drafts only. Do not open attachments. If a step requires a password, stop and ask." Four sentences like these prevent the majority of agent mishaps.

  • What the agent must never do: send, publish, pay, delete, or share externally.
  • What it must always do: cite sources, show its work, or ask before proceeding past a checkpoint.
  • Budget limits: maximum steps, maximum cost, or a time box for the task.
  • Scope limits: which folders, accounts, or systems are in bounds — everything else is off limits.

Show one good example

A single concrete example is worth paragraphs of abstract description. If you want summaries in a particular format, paste a short example of that format. If you want a certain tone in drafted emails, show one email written the way you like. Agents are pattern-matchers: an example calibrates them faster than any amount of adjectives like "professional" or "concise," which mean different things to different people. Keep a small library of examples for tasks you repeat, and reference them in your instructions.

Tell it what to do when stuck

An agent with no stuck-procedure will do the worst possible thing: guess quietly and keep going. Every instruction set needs an explicit rule for uncertainty. The safest default is "stop and ask," but that can be too cautious for long tasks. A better pattern is a tiered rule: try one reasonable alternative, and if that fails, stop and report exactly where it got stuck and what it needs from you. This keeps the agent moving through minor hiccups while guaranteeing you hear about real problems.

  • Never invent missing information. Mark unknowns clearly instead of filling them in.
  • If a tool call fails twice, stop and report the error rather than trying a third variation.
  • When a choice affects cost, timing, or other people, ask instead of deciding.
  • End every task with a short summary of what was done and what was skipped.

Keep instructions short enough to be followed

Long instruction documents get skimmed — by agents as well as people. If your instructions run past a page, the agent will start dropping constraints halfway through a long task. Split the difference: keep a short core instruction set of the five to ten rules that always apply, and add task-specific details per job. Review your core set every month or so. Every rule should have earned its place by preventing a real mistake; rules that never matter are noise that drowns out the ones that do.

A reusable template

Use this structure as a starting point for any agent task, and adapt it as you learn where your agent needs more guidance:

  • Goal: one sentence describing the finished result.
  • Constraints: what it must never do, stated first.
  • Steps: the sequence to follow, numbered.
  • Format: exactly what the output should look like, with an example.
  • Stuck rule: what to do when something is unclear or fails.
  • Done rule: how it should report completion and what to include in the summary.

Keep reading