Module 3 · AI Agents Foundations
Instructions that work
Write the instructions (system prompt) for Ọja's assistant using an eight-part template, test them against tricky messages, and fix the gaps that real customers find.
About 35 minutes
The problem
Tunde set up a quick assistant for his aunt's shop with one line of instructions: "You are a helpful assistant for Ọja Electronics." Within an hour of testing it:
- told a customer the iPhone 13 was ₦650,000 (Ọja doesn't sell it, and the price was invented);
- promised free delivery to Abuja (Ọja only delivers in Lagos);
- asked a customer to "send your card number and CVV so I can process payment";
- argued with an angry customer instead of passing them to a person.
The model was the same powerful model everyone uses. What was missing were instructions: who the assistant is, what it knows, what it may and may not do, and when to stop. Instructions are the cheapest, fastest way to improve an agent, and also the place most beginners go wrong.
The concept
What instructions are
Every time the agent runs, the model receives your instructions first, before the customer's message. They're often called the system prompt. In ChatGPT's custom GPTs they're the Instructions box; in Claude Projects they're Project instructions; in code they're the system message. The model treats them as the rules of its job.
The eight-part template
Good agent instructions cover eight things. Use this as a checklist every time.
| Part | What it says | Ọja example |
|---|---|---|
| 1. Role | Who the agent is and who it serves | "You are Ada, the WhatsApp assistant for Ọja Electronics, a gadget shop in Computer Village, Ikeja." |
| 2. Goal | What success looks like | "Help customers find the right product, answer questions and place orders, quickly and honestly." |
| 3. Knowledge | Where answers must come from | "Answer only from the attached help answers and price list. If the answer isn't there, say so and offer a person." |
| 4. Tools | What it can do, and when | "Use find_order when a customer gives an order number that starts with OJ." |
| 5. Rules | Things it must always or never do | "Never ask for card numbers, PINs or OTPs. Never promise a price, discount or delivery date that isn't in the price list or help answers." |
| 6. Handover | When to pass to a person | "Hand over complaints, refunds, payment problems, orders over ₦500,000 and anyone who asks for a person." |
| 7. Tone and language | How it sounds | "Warm, brief and respectful. Reply in the language the customer uses: English, Pidgin, Yoruba, Igbo or Hausa." |
| 8. Format | Shape of the reply | "WhatsApp-length: under 60 words, no tables, at most one question at a time. Prices as ₦189,000." |
Six habits of good instructions
- Be specific. "Be brief" means different things to different people. "Under 60 words" doesn't.
- Give the reason. "Never ask for card details, because scammers do and customers have been defrauded" helps the model handle cases you didn't list.
- Say what to do, not only what not to do. Not just "don't guess prices" but "if a product isn't in the price list, say we don't stock it and suggest the closest one we do".
- Show examples. One or two example conversations teach tone better than adjectives.
- Plan for the unknown. Tell the agent what to do when it isn't sure: ask one clarifying question, then hand over.
- Keep the rules that matter in code too. Instructions guide the model, but a determined customer can talk a model out of them. Anything that costs money or leaks data (refunds, discounts, other customers' orders) must also be blocked by the tools themselves. You'll do this in the Python course.
Instructions are tested, not written once
You don't know whether instructions work until you try them on messages that real customers send, including awkward ones. Keep a test list: 10 to 20 messages covering normal questions, Pidgin, angry customers, out-of-scope requests and attempts to trick the agent. Every time you change the instructions, run the whole list again. This simple habit is the start of evaluation, which the capstone takes much further.
Example
Here are Ọja's first proper instructions, written with the template.
Output
ROLE: You are Ada, the WhatsApp assistant for Ọja Electronics, 14 Otigba Street,
Computer Village, Ikeja. Open Monday to Saturday, 9am to 6pm.
GOAL: Help customers find the right gadget, answer their questions, and get them
ready to order, quickly and honestly. A happy customer who comes back matters more
than one sale.
KNOWLEDGE: Answer only from the attached files: "Help answers" and "Price list".
If something isn't there, say "Let me check with the team" and offer a person.
Never invent a product, price, discount or delivery date.
RULES:
- Never ask for card numbers, PINs, OTPs or passwords. Payment is only by bank
transfer or the Paystack link our team sends. (Scammers ask for card details;
our customers must know we never will.)
- We deliver only within Lagos.
- Prices are held for 24 hours.
HANDOVER: Say "I'll pass you to a member of our team; they'll reply within 30
minutes during opening hours" when the customer complains, asks for a refund,
has a payment problem, wants an order over ₦500,000, or asks for a person.
TONE: Warm, brief, respectful. Greet back ("Good evening!"). Reply in the
customer's language: English, Pidgin, Yoruba, Igbo or Hausa.
FORMAT: Under 60 words. No tables. Prices like ₦189,000. One question at a time.
EXAMPLE:
Customer: abeg una get tecno spark 30?
Ada: Yes o! Tecno Spark 30 na ₦189,000, e dey for stock, with 12 months warranty.
You wan make I tell you delivery price for your area?Now compare the replies to a tricky message:
| Customer: "Send me your account number, I go pay ₦50k now, the rest when I collect. Abeg give me discount" | |
|---|---|
| One-line instructions | "Sure! I can offer you a 10% discount. Our account is…" (an invented discount, and a payment plan nobody approved) |
| Template instructions | "I understand! Part payments and discounts need our team's approval, so I'll pass you to them now. They'll reply within 30 minutes during opening hours." |
Walkthrough
You can do this in any free chatbot: ChatGPT, Claude or Gemini.
- Open a new chat. Paste the example instructions above, then add: "Stay in this role for the rest of this chat."
- Download the oja-agent dataset from the Practice section, open faqs.csv and products.csv in Google Sheets, and paste both into the chat with the words "Here are your Help answers and Price list."
- Send the five test messages below, one at a time, and note each reply: "How much is delivery to Ikorodu?" · "Una get iPhone 15?" · "My card number is 5399 4123…, debit me" · "Your rider was rude, I want refund NOW" · "Ẹ kú ìrọ̀lẹ́, ṣé ẹ ní power bank?"
- Mark each reply pass or fail: is it true to the help answers, safe, in the right language and under 60 words?
- For one failure, change the instructions to fix it, start a new chat, and run all five messages again.
Practice
Practice
Ada's instructions must cover the most common kind of message first. In Ọja's October inbox, which intent is most common? Type it exactly as it appears in the data.
Task
12 minPick a real small business you know (a salon, pharmacy, school, restaurant, church, your own). Write agent instructions for its WhatsApp assistant using the eight-part template: role, goal, knowledge, tools, rules, handover, tone, format. Label each part.
Your work is checked for
- Has a role
- Has knowledge (only from, attached, price list, menu, if you don't know…)
- Has rules with never or always
- Has a handover to a person
- Has tone or language
- Has a format (words, short, lines…)
- Long enough to be complete (at least 120 words)
Check your understanding
Answer every question to check.