# How to write good instructions for an AI agent (with templates)

- Link: https://thejusgrow.com/how-to-write-instructions-for-ai-agents/
- Published: 2026-09-27T17:03:15-07:00
- Author: Varun Sharma

Short answer Good AI agent instructions read like a brief for a capable new colleague:
say what the goal is and why, give the context the agent can't guess, set limits(
budget, sources, dates, what not to touch), describe what "done" looks like, and
say which steps need your approval before it acts. OpenAI, Anthropic and Google 
all publish guidance along these lines. Vague requests such as "handle my inbox"
are the most common cause of disappointing results.

An AI agent is only as useful as the instructions it's given. Ask a chatbot a loose
question and the worst outcome is a loose answer. Give an agent a loose instruction,
and it may spend twenty minutes clicking through websites, booking the wrong thing,
or stopping halfway to ask what you meant.

The good news is that writing clear instructions is a learnable skill, and the companies
building these agents have published fairly consistent advice about it. This guide
pulls together that official guidance from OpenAI, Anthropic and Google, and turns
it into a practical method with templates you can copy. It's based on publicly documented
guidance as of September 2026, not on our own testing.

If you're new to agents, our [beginner's guide to AI agents](https://thejusgrow.com/beginners-guide-to-ai-agents/)
explains what they are and how they differ from chatbots.

## Why do AI agent instructions matter more than chatbot prompts?

A chatbot answers. An agent, on the other hand, acts. It may browse the web, fill
in forms, read your email, update a spreadsheet or run for a long time without checking
in. That changes the stakes of an ambiguous instruction in three ways:

 * **Errors compound.** A wrong assumption in step one carries through every later
   step.
 * **Actions can be hard to undo.** A sent email or a completed booking can't simply
   be regenerated.
 * **You're often not watching.** Agents are designed to work while you do something
   else, so they can't read your reaction and adjust.

OpenAI's help page for its former ChatGPT agent mode made the point directly, advising
users to avoid vague requests like "Check my email and handle everything." Anthropic's
prompting guide offers a helpful framing: treat the AI as a "brilliant but new employee"
who lacks context on your norms and workflows. The more precisely you explain what
you want, the better the result.

## The six parts of good AI agent instructions

Across the official guides, the same ingredients keep appearing. So we've grouped
them into six parts. Not every task needs all six, but anything that involves the
agent taking actions on your behalf usually benefits from each one.

| Part | What it answers | Example | 
| 1. Goal | What are you trying to achieve? | "Find a hotel for two nights in Lisbon" | 
| 2. Why and context | What's it for, and what does the agent need to know? | "It's for a work conference at the FIL venue; I don't have a car" | 
| 3. Constraints | What are the limits? | "Under €180 a night, free cancellation, walkable to the venue" | 
| 4. Steps or approach | Is there an order or method to follow? | "Check at least three booking sites and compare" | 
| 5. Output | What should the result look like? | "A table of three options with price, distance and cancellation terms" | 
| 6. Checkpoints | Where should it stop and ask? | "Don't book anything; show me the options first" |

### 1. Start with the goal, stated plainly

Google's Gemini API documentation says instructions can range from a simple question
to a step-by-step task. Either way, what matters is being explicit. Anthropic's 
guide adds a point that's particularly relevant to agents: if you want action, ask
for action. "Change this" gets different results from "Can you suggest changes?"
With an agent, decide whether you want it to _research and report_ or to _actually
do the thing_, and say which.

### 2. Explain why, and give the context it can't guess

This is the step most people skip. Anthropic's guide recommends explaining the reason
behind an instruction rather than just stating a rule, because the AI can then apply
the reason to situations you didn't anticipate. Its example: rather than "never 
use ellipses," explain that the response will be read aloud by a text-to-speech 
engine that can't pronounce them.

The same applies to everyday tasks. "Find a restaurant" is a guess waiting to happen."
Find a restaurant for my parents' 40th anniversary; my dad uses a wheelchair and
my mum is vegetarian" gives the agent what it needs to make sensible choices on 
its own.

Google's Workspace guidance lists "provide context" among its core tips, and its
developer documentation suggests including reference material where relevant, so
the answer is tailored rather than generic.

### 3. Set constraints: budget, dates, sources, boundaries

Constraints are what stop an agent drifting. Google's documentation gives the example
of specifying a precise length for a summary, but the principle scales up: price
ceilings, date ranges, preferred or banned websites, brands to avoid, locations,
deadlines.

For agents with access to your accounts, add boundaries on _scope_. OpenAI's agent
guidance recommends enabling only the apps a task needs. You can reinforce that 
in the instruction itself: "Only look in my Work calendar" or "Don't open any emails
older than a month."

A tip from Anthropic's guide: say what to do rather than only what not to do. "Write
in flowing paragraphs" works better than "don't use bullet points." Positive instructions
give the agent a target instead of just a fence.

### 4. Break big jobs into steps

Both Google and Anthropic recommend breaking complex requests into smaller pieces,
either as numbered steps in one instruction or as a sequence of separate prompts.
Anthropic suggests numbered lists when the order matters.

For an agent, steps also make the work easier to check. If step two produces something
odd, you can stop there rather than discovering the problem at the end.

### 5. Describe the finished product

Tell the agent what "done" looks like. Google's documentation notes that you can
ask for a table, a bulleted list, a short pitch, keywords, a sentence or a paragraph.
For agents, add the practical details: should it include links? Prices with the 
date checked? A short summary at the top? A note of anything it couldn't find?

If you have an example of what you want, include it. Google calls these "few-shot"
examples and says they help control formatting, phrasing and scope. Anthropic recommends
three to five varied examples for more complex tasks.

### 6. Say where it must stop and ask

This is the most important part for anything involving money, messages or deletion.
Anthropic's guidance for agentic systems suggests encouraging the AI to take reversible
actions freely, but to ask before actions that are hard to undo, affect other people
or could be destructive, such as deleting files or sending messages.

Most consumer agents already pause for some high-impact actions. OpenAI says ChatGPT
Work, which replaced ChatGPT agent, asks for approval on important actions. But 
built-in checkpoints vary between products, and you know better than the agent where
your own lines are. Stating them costs one sentence: "Don't buy, send or delete 
anything; stop and show me first."

## AI agent instructions before and after: three worked examples

### Shopping

> Before: Find me a good vacuum cleaner.

> After: I'm looking for a cordless stick vacuum for a two-bedroom flat with hard
> floors and one long-haired cat. Budget up to £250. Look at manufacturer pages 
> and at least two retailers. Give me a table of three options with price, battery
> life as claimed by the maker, weight and where you found the price, with the date
> you checked. Note any common complaints you find in professional reviews. Don't
> add anything to a basket.

The second version sets the use case (hard floors, pet hair), the budget, the sources,
the output and a clear stopping point. It also asks for the date on prices, which
matters because prices change. For more on shopping agents, see [can AI agents find better prices?](https://thejusgrow.com/can-ai-agents-find-better-prices/)

### Email and calendar

> Before: Sort out my calendar for next week.

> After: Look at my Work calendar for Monday 5 to Friday 9 October. List any double
> bookings and any day with more than five hours of meetings. For each clash, suggest
> which meeting to move, based on this rule: client meetings take priority over 
> internal ones. Draft, but don't send, a short polite message for each meeting 
> that would need moving. Don't change any calendar events.

This version limits scope to one calendar and one week, gives the agent a rule for
decisions, and separates drafting from sending.

### Research

> Before: Tell me about new laws on AI.

> After: I run a small online shop in Ireland and use an AI chatbot for customer
> questions. Find official EU or Irish government sources explaining whether I need
> to tell customers they're talking to an AI, and from what date. Quote the relevant
> line and link to the source. If sources disagree or the answer isn't clear, say
> so instead of guessing. Keep it under 300 words.

Asking the agent to say when something is unclear, rather than filling the gap, 
is one of the most useful lines you can add to any research task.

## A copyable template for AI agent instructions

Paste this into your agent and fill in the brackets:

> Goal: [what you want done]. Context: [why, who it's for, anything the agent can't
> guess]. Constraints: [budget, dates, locations, sources to use or avoid, accounts
> it may use]. Steps: [any order to follow]. Output: [format, length, what to include,
> e.g. links and dates checked]. Checkpoints: before you [buy / send / book / delete/
> change anything], stop and show me. If something is unclear or you can't find 
> it, tell me rather than guessing.

It's longer than most people are used to typing, and that's the point. Google's 
Workspace guidance encourages writing to Gemini in natural language, as you would
to a colleague. A few extra sentences at the start tend to save time later.

## How do you test and improve AI agent instructions?

OpenAI's ChatGPT guidance describes prompting as iterative: try an instruction, 
look at the result, then refine the wording, add context or simplify. For agents,
a few habits help:

 * **Use Anthropic's "colleague test."** Its guide suggests showing your instruction
   to someone with little context on the task. If they'd be confused, the AI probably
   will be too.
 * **Run it once while watching.** Before you schedule a task or leave an agent 
   unattended, run it manually and see where it hesitates or goes wrong. This is
   especially relevant for [scheduled AI tasks](https://thejusgrow.com/how-scheduled-ai-tasks-work/).
 * **Save what works.** When an instruction produces good results, keep it. Many
   assistants now let you save instructions for reuse, as projects, skills or plugins.
 * **Change one thing at a time.** If results are poor, adjust one element (the 
   context, a constraint, the output format) so you can tell what made the difference.

## What instructions can't fix

Clear instructions improve results, but they don't make an agent infallible. Agents
can still misread websites, work from outdated information, or be misled by content
they encounter. A particular risk is [prompt injection](https://thejusgrow.com/what-is-prompt-injection/),
where text on a web page or in an email tries to give the agent its own instructions.
OpenAI's agent documentation acknowledges that its protections reduce this risk 
but don't eliminate it.

So treat your instructions as one layer of protection, not the only one. Keep sensitive
actions behind your own approval, connect only the accounts a task needs, and check
the output, especially facts, prices and anything the agent says it has done.

## Common mistakes in AI agent instructions

 * **Assuming shared context.** The agent doesn't know your budget, your city or
   that your "work calendar" is the second one.
 * **Bundling unrelated jobs.** "Plan my trip, clear my inbox and update the budget"
   is three tasks. Run them separately.
 * **Only saying what not to do.** Give a target, not just a list of prohibitions.
 * **No definition of done.** Without one, agents tend to either stop early or keep
   going longer than you wanted.
 * **No stopping point for irreversible actions.** One sentence prevents most expensive
   mistakes.
 * **Not asking for uncertainty.** Tell it to flag what it couldn't verify.

Key takeaways

 * Treat an AI agent like a capable new colleague: give it the goal, the reason 
   and the context it can't guess.
 * Set constraints (budget, dates, sources, accounts) and describe exactly what 
   the finished result should look like.
 * Break big jobs into numbered steps so problems are caught early.
 * Always say where the agent must stop and ask, especially before buying, sending
   or deleting.
 * Test an instruction while watching, refine one thing at a time, and save versions
   that work.

## AI agent instructions: FAQs

**How long should instructions for an AI agent be?**

Long enough to cover the goal, context, constraints, output and checkpoints. For
a real task that is often a short paragraph or a few numbered steps, rather than
a single line.

**Should I tell an AI agent what not to do?**

Set clear limits, especially on irreversible actions, but where possible phrase 
instructions positively. Anthropic's guidance says telling the model what to do 
works better than only saying what to avoid.

**Do the same instructions work in ChatGPT, Gemini and Claude?**

Largely, yes. OpenAI, Google and Anthropic publish similar advice: be clear and 
specific, give context, specify the format and break complex tasks into steps. Results
can still differ between products.

**Can good instructions stop an agent making mistakes?**

They reduce mistakes but can't prevent them all. Keep approval steps for purchases,
messages and deletions, and check important output yourself.

## Sources

 * [Anthropic, "Prompting best practices" (Claude Platform documentation, accessed September 2026)](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices)
 * [Google AI for Developers, "Prompt design strategies" (updated September 17, 2026)](https://ai.google.dev/gemini-api/docs/prompting-strategies)
 * [Google Workspace Learning Center, "Tips to write prompts for Gemini" (accessed September 2026)](https://support.google.com/a/users/answer/14200040)
 * [OpenAI Help Center, "Prompt engineering best practices for ChatGPT" (accessed September 2026)](https://help.openai.com/en/articles/10032626-prompt-engineering-best-practices-for-chatgpt)
 * [OpenAI Help Center, "ChatGPT agent" (updated September 2026)](https://help.openai.com/en/articles/11752874-chatgpt-agent)
 * [OpenAI Help Center, "ChatGPT Work and Codex" (accessed October 2026)](https://help.openai.com/en/articles/20001275-chatgpt-work-and-codex)
