AI and agents

How to write the instructions for your AI agent so it answers well

By tumarcaviral.com 3 min read

A woman's hands typing on a laptop on a white desk

An AI agent answers only as well as its instructions. The practices Anthropic recommends: clarity, context, examples, tags and a defined role.

You hire a new sales rep and on day one you only tell them: “Handle the WhatsApp messages”. Without explaining the products, the prices, how to greet people, what to do if someone complains or when to pass the case to a supervisor. How well do you think they will do?

Exactly the same happens with an AI agent. The model can be brilliant, but without good instructions it improvises. The good news: writing effective instructions has a technique, and Anthropic, the company behind Claude, documents it in detail.

Why do instructions matter so much?

Because they are your agent's training manual. According to Anthropic's prompt engineering overview, adjusting the prompt is much faster than other methods of controlling model behavior and often delivers big improvements in little time.

Before writing, be clear about what your agent does; if you do not have one yet, read what an AI agent for WhatsApp is.

Hand writing with an orange pen in an open notebook
An agent's instructions are its training manual. Photo: Unsplash

Which techniques does Anthropic recommend?

Five, ordered from the most broadly effective to the most specific:

TechniqueWhat it means for your agent
Be clear and directSay exactly what to do, without assuming it will guess
Give examplesShow two or three model conversations
Let it reasonAsk it to think before answering in complex cases
Use XML tagsSeparate instructions, data and examples with clear markers
Assign a roleDefine who it is: “sales advisor for a clinic in Bogotá”

According to Anthropic's best practices guide, XML tags help the model interpret prompts that mix instructions, context, examples and variable data without ambiguity.

What does a good set of instructions look like?

A practical structure for a WhatsApp agent:

  1. Role: who it is and who it represents.
  2. Goal: what it must achieve (answer questions, qualify, book).
  3. Business information: products, current prices, hours, coverage areas.
  4. Rules with their reason: “do not promise delivery dates, because they depend on the day's inventory”.
  5. When to hand over to a person: complaints, payments, cases outside its information.
  6. Examples: two or three well-handled conversations.
  7. Format: short messages, a single message per reply, informal tone.

Common mistake: writing only prohibitions (“do not do this, do not say that”). It works better to say what to do instead and explain why: that way the agent applies judgment in cases you did not foresee.

Colorful chat bubbles on a translucent screen
Two or three example conversations teach more than ten rules. Photo: Unsplash

Why ask for answers in a single message?

For customer experience and for cost. An agent that splits each idea into five bubbles tires the customer and, since October 2026, every reply through the WhatsApp API counts toward charges; we explain it in WhatsApp's new charges.

How do I know if my instructions work?

By testing them with real conversations and fixing what fails.

  • Review a sample of conversations every week.
  • Note where it answered badly, made things up or did not hand over the case in time.
  • Adjust the instruction or add an example that covers that case.
  • Keep the business information up to date: an old price in the instructions is an old price in every answer.

Watch out: instructions do not replace data. If the agent needs to check inventory or availability in real time, it must connect to those systems, for example with MCP or with n8n workflows.

In short

An AI agent is only as good as its instructions: a clear role, a goal, business information, explained rules, examples and a defined format. It is the same onboarding you would give a new sales rep, written so the AI follows it every time. We design, test and fine-tune your agent's instructions in our AI agents service.

Frequently asked questions

What is a system prompt?

It is the permanent set of instructions an AI agent receives: who it is, who it serves, what it can and cannot do, and how it should respond.

Does it help to give the agent example conversations?

Yes. Anthropic lists using examples among the most effective techniques to guide responses.

What are XML tags in a prompt?

They are markers like <instructions> or <example> that separate the parts of the prompt. According to Anthropic, they help the model interpret prompts that mix instructions, context and examples without ambiguity.

How often should I review the instructions?

Every time you find answers that fail. Reviewing real conversations every week at the beginning is good practice.

Do not stop at the theory: apply it to your business

We implement AI agents end to end, with your real operation. The first conversation is free.

Keep reading