To prompt an AI agent well, state the goal, give the context it cannot guess, list the inputs it may use, define a checkable finish line, set boundaries, and say when it must stop and ask. Then review its plan before it starts.
An AI agent is not a smarter chatbot. It is a different way of using an AI assistant, and it needs a different kind of prompt. This guide explains what changes, how to structure a task so an agent can carry it out reliably, and which mistakes cost the most time. Every technique here works across Claude, ChatGPT, Gemini and Grok.
What an AI agent is
A chat assistant answers the message you send. You ask, it replies, and you decide what happens next. An AI agent is set up to work toward a goal across several steps. It may plan, look things up, read files, write and run code, call other software and revise its own work. Between your instruction and the final result, it makes many small decisions without asking you.
Whether a particular product offers these abilities, and how, depends on the product and your plan, and it changes often. Check the provider's documentation for what is available to you. The prompting principles below do not depend on any one feature. They apply whenever an assistant is asked to do more than answer one question.
A simple test. If the task can be finished by reading one reply, it is a chat task. If the assistant must choose a sequence of actions to get there, treat it as an agent task and brief it accordingly.
Why agents need different prompts
When you chat, mistakes are cheap. A weak answer is visible immediately, and you correct it in the next message. When an agent works for several steps, a wrong assumption at step one can carry through everything that follows. You may only notice at the end, after time, effort or something more costly has been spent.
Agents also face a problem that chat does not: they must decide when they are finished. If you do not say what "done" looks like, the agent either stops too early or keeps going. And if you do not say what it must not do, it may take an action that seems reasonable to it and is not what you wanted.
So an agent prompt carries more than a question. It carries a goal, the facts the agent cannot guess, the material it may use, a finish line, boundaries and a rule for when to ask. Each of those removes a place where the work could go wrong.
The five parts of a good prompt
Every good prompt, for a chat or for an agent, has the same five parts. The agent version simply makes each part stricter. The prompt formula guide covers them in depth, so here is the short version.
| Part | The question it answers | Example for an agent |
|---|---|---|
| Role | What perspective should it take? | A careful research assistant |
| Context | What does it need to know that it cannot guess? | The report is for a client meeting on Friday |
| Task | What exactly should it do? | Compare three suppliers on cost and delivery time |
| Format | What should the result look like? | A table and a three-sentence recommendation |
| Constraints | What are the limits? | Use only the pages I provide; ask before contacting anyone |
Leave out the role when it adds nothing. Never leave out the task, the format or the constraints.
How to structure a task for an agent
A task for an agent works best as a short brief with six parts. The task checklist walks through each one. Here is what they are and why they matter.
1. Goal. One sentence describing the outcome you want, not the activity. "Produce a one-page comparison of three tools" is a goal. "Look into some tools" is not.
2. Context. The background the agent cannot guess: who the result is for, what already exists, what has been tried and what you care about. If you would brief a new colleague on it, brief the agent on it.
3. Inputs. The files, links, data or notes the agent may use. Say what each one is. If nothing is provided, say "none" so the agent does not assume it should find its own sources.
4. Definition of done. Three to five criteria you can check. "The table has a row for every supplier and a column for cost, delivery time and risk" is checkable. "A good comparison" is not.
5. Boundaries. What the agent must not do, what it may do freely and what needs your approval. Include limits on time, length or the number of tool calls when they matter.
6. Stopping rule. When to stop and ask. A reliable line is: "If something essential is missing, ask me instead of guessing, and ask before any action that cannot be undone."
Add one more instruction at the end of every agent prompt: ask the agent to restate the goal and its plan before it starts. A plan takes seconds to read, and a wrong assumption is cheapest to fix at that moment.
A worked example
Here is a weak prompt, followed by the same task as a proper brief.
Weak:
Research project management tools and tell me which one to use.This leaves the agent to guess who the team is, what matters, how many tools to look at, where to look, how long the answer should be and when to stop. The result will usually be a generic list.
Stronger:
You are an autonomous agent working on the task below. Work independently, but stop and ask me before any irreversible action.
<goal>
Recommend one project-management tool for a remote team of ten.
</goal>
<context>
We are a small design agency. People work in different time zones. We currently use a shared calendar and email.
</context>
<inputs>
The pricing notes I pasted below. No other sources.
</inputs>
<definition_of_done>
- Three tools are compared on cost, ease of use and integrations.
- One tool is recommended, with reasons in five sentences or fewer.
- Anything you could not verify is listed.
</definition_of_done>
<constraints>
- Use only the pricing notes. Do not contact vendors.
- Ask me before assuming anything about a feature.
</constraints>
Before you start, restate the goal and your plan in three bullets. At the end, check your work against each item in definition_of_done.The stronger prompt is longer, but it is quick to write once you have a template. The Agent Task Brief template gives you this structure with variables to fill in.
Two kinds of instructions: system prompts and task briefs
Agents usually receive two kinds of instructions, and it helps to keep them apart.
A system prompt defines the agent's standing role: who it is, what it handles, what tone to use, which tools it has, what it must never do and when to hand over to a person. It applies to every task. If you set up an assistant that will run for many conversations, the system prompt guide shows how to write one.
A task brief describes one piece of work: its goal, inputs, finish line and limits. It changes with each task.
Putting standing rules in the system prompt and task details in the brief keeps both short. It also makes problems easier to fix: if the agent keeps ignoring a rule, change the system prompt once instead of repeating the rule in every message.
Common failure modes
Most disappointing agent results trace back to a small set of causes. Recognizing them speeds up the fix.
| What you see | Likely cause | Fix |
|---|---|---|
| The result is generic | The agent had no context | Add who it is for and what exists already |
| It stops too early | No definition of done | Add checkable finish criteria |
| It never seems to finish | No limit and no stopping rule | Add a time, length or step limit |
| It did something you did not want | Boundaries were not stated | List forbidden and approval-only actions |
| It states things that are not true | It filled a gap with a guess | Say "ask me or say you do not know" |
| The format is wrong | The output format was left open | Describe the format and give an example |
| It claims success without proof | No verification step | Ask it to check each criterion and report |
The common prompt mistakes guide covers ten of these in detail, with a before-and-after example for each.
How to review an agent's work
Even a well-briefed agent needs a review. Treat the result as a draft from a capable colleague who may be confident and wrong.
- Read the plan first. Before the work starts, check that the goal and steps match what you meant.
- Read the verification report. Ask the agent to say what it checked and what it could not. The unverified items are where to look first.
- Spot-check facts and numbers. Open sources and confirm figures, quotes and dates that matter. An agent can name a source that does not say what it claims.
- Check what changed. If the agent edited files or took actions, review each one before you accept it.
- Decide what to improve. If the result missed the mark, change the brief, not just the output. A better brief improves every later run.
The Self-Check Before Delivery template builds steps two and three into the prompt itself.
A short checklist before you run an agent
Before you press send, confirm that the prompt answers each of these:
- Is the goal one sentence and about the outcome?
- Does it include the context the agent cannot guess?
- Are the inputs listed and described?
- Can you check every item in the definition of done?
- Are forbidden actions and approval points stated?
- Is there a limit on time, length or steps?
- Did you ask for a plan and a final verification report?
If you can tick every line, you have removed most of the guesswork.
Where to go next
Start with the template that matches your work: the agents category has task briefs, system prompts, tool-use rules, self-checks and plans with checkpoints. To go deeper, read the guides in this order:
- The Prompt Formula for the five parts of any prompt.
- How to Write a System Prompt for an AI Agent for standing instructions.
- How to Give a Task to an AI Agent for a checklist and a ready brief.
- 10 Common Prompt Mistakes for the fixes that matter most.
If you use one product more than others, the pages for Claude, ChatGPT, Gemini and Grok explain how to adapt a prompt for each.
Try these templates
Agent Task Brief
Give an AI agent a clear goal, boundaries and a checkable definition of done.
Multi-Step Plan with Checkpoints
Ask an agent for a step-by-step plan with review points before it starts working.
Self-Check Before Delivery
Make the AI check its own work against your requirements before it hands anything back.
Frequently asked questions
What is the difference between an AI agent and a chat assistant?
A chat assistant answers a message. An agent works toward a goal over several steps, often using tools such as search, files or other software, and decides on its own what to do next. That autonomy is why agents need goals, boundaries and a finish line.
Do I need a different prompt for every AI product?
Usually not. The structure in this guide works across Claude, ChatGPT, Gemini and Grok. Small adjustments, such as how you label sections or attach files, are covered in the model notes on each template.
How long should an agent prompt be?
As long as it takes to state the goal, context, inputs, finish line and boundaries clearly. Many good briefs are 150 to 300 words. Length is not the goal; removing guesswork is.
How do I stop an agent from taking actions I did not want?
List the actions it may take freely, the ones it must never take and the ones that need your approval first. Ask it to restate its plan before it starts, and to stop and ask before anything that cannot be undone.
How do I know the agent actually did what I asked?
Write the definition of done as criteria you can check, and ask the agent to report on each one, including what it could not verify. Then spot-check the result yourself, especially facts, numbers and anything that changed.
Keep reading
10 Common Prompt Mistakes and How to Fix Them
Ten mistakes that make AI answers vague, wrong or unusable, each with what it looks like, why it fails and a before-and-after fix.
How to Give a Task to an AI Agent: A Checklist
An eight-point checklist for briefing an AI agent, a ready brief you can copy, and a method for reviewing what the agent hands back.
How to Write a System Prompt for an AI Agent
What a system prompt is, the seven sections to include, a complete worked example and a simple way to test and improve it with a few test cases.