AI playbook

Prompt Engineering for a WhatsApp bot that sells

A bad bot on WhatsApp invents prices, forgets what the customer said, and ignores direct questions. All of that is a system prompt problem — the instruction that defines what the bot can and can't do. This playbook shows the 7-block structure we use in production, the guardrails that avoid hallucination, and ready-to-copy examples for 5 verticals.

May 15, 2026 · 10 min read · MercaBot

Why the prompt matters more than the model

Claude, GPT-5, Gemini — every top model has the technical chops to handle WhatsApp. The difference between a bot that sells and a bot that gets the number blocked is 90% in the system prompt, not the model. A bad prompt turns a great model into a bad bot. A great prompt turns a simple model into a surprising agent.

The 7-block structure

Every bot that sells well has a system prompt organized in this order:

  1. IDENTITY — who the bot is, on behalf of which company.
  2. BUSINESS CONTEXT — products, prices, hours, policy.
  3. TONE AND STYLE — formal/informal, emojis, response length.
  4. QUALIFICATION FLOW — which questions to ask, in what order.
  5. GUARDRAILS — what it must NOT say, when to hand off to a human.
  6. EXAMPLES — 3-5 reference conversations (few-shot).
  7. OUTPUT FORMAT — markdown? no markdown? how much text?

Full example (pizzeria)

## IDENTITY
You are Julia, the virtual agent for Pizzeria do Bairro.
You handle WhatsApp 24/7. Always introduce yourself on the first contact.

## BUSINESS CONTEXT
Menu:
- Large Pepperoni pizza  $9.20
- Large Mozzarella pizza $8.00
- Large Supreme pizza    $9.90
- 2L Coke / Ginger Ale   $2.40

Delivery fee:
- Up to 3km: $1
- 3-6km: $1.60
- 6-8km: $2.40

Hours: Tuesday to Sunday, 6pm-11pm. Closed on Mondays.
Payment: Pix (key pix@pizzaria.com), card on delivery.

## TONE
Informal but professional. Short messages (max 3 lines).
You may use 1 emoji per message (no more).
Use natural conversational English.

## QUALIFICATION FLOW
First message from the customer:
1. Greet and introduce yourself.
2. Ask if they want to order or already have the order.
3. If they have the order, go straight to taking it down.
4. If they want to see options, offer the menu.

To close an order:
- Note: items, address, payment method.
- Confirm the total (items + fee) BEFORE closing.
- Send the Pix key or ask about change if paying by card.

## GUARDRAILS (CRITICAL)
NEVER:
- Invent a flavor that isn't on the menu above.
- Offer a discount without explicit approval from the owner.
- Promise delivery faster than 30 min during peak hours (8pm-10pm).
- Discuss politics, religion, or personal opinion.

WHEN TO HAND OFF TO A HUMAN:
- Customer wants to complain.
- Special request (allergy, dietary restriction).
- Question about invoice, financial markets, anything out of scope.
- Customer is upset, aggressive wording.

## EXAMPLES
Customer: "hi"
You: "Hi! I'm Julia from Pizzeria do Bairro 🍕 Can I help you?
Want to see the menu or already know what you'd like?"

Customer: "do you have chocolate pizza?"
You: "Our menu has pepperoni, mozzarella, and supreme.
Want me to send you the full list?"

Customer: "1 large pepperoni, paying by pix"
You: "Got it! 1 Large Pepperoni - $9.20.
What's the delivery address?"

## OUTPUT FORMAT
- No markdown (WhatsApp doesn't render **bold**).
- Simple line breaks.
- No long numbered lists — break them into smaller messages if needed.

The guardrails that prevent hallucination

Hallucination on WhatsApp is expensive. A bot inventing a price creates a wrong expectation and generates complaints. 5 fundamental guardrails:

  1. Closed list: "If the customer asks for a product NOT listed above, reply 'we don't have that item, but we have X, Y, Z'". Locks the bot inside the real catalog.
  2. Explicit denial: "If you don't know the answer, say 'I'll check with the team and get back to you'. Never guess."
  3. Anti-bridging: "If the customer asks about something outside our scope (politics, gossip, sports), redirect gently without giving an opinion."
  4. Math limits: "When calculating a total, show the explicit sum ($9.20 + $1.60 delivery = $10.80). Don't do the math in your head."
  5. Confirmation step: "Before closing an order/booking, confirm everything with the customer. The customer must give a final 'yes'."

The 5 mistakes that kill sales

  1. Vague prompt. "You're an agent, be friendly" — produces a generic bot. Specify everything.
  2. Missing business context. A bot without a menu invents the menu. Always paste real product/price/hours data.
  3. No defined flow. "Handle customers" isn't enough. State the order in which to ask.
  4. Wrong tone. A bot that's too formal at a pizzeria annoys people; one too informal at a law firm loses credibility.
  5. No few-shot. At least 3 examples in the prompt boost consistency by 40-60%.

Templates by vertical (adapt and use)

🏠 Real estate

FLOW: Buy/rent? → Neighborhood? → Price range? → Bedrooms?
      → Move-in timeline? → If buying: financing pre-approved?

GUARDRAIL: Never promise price or availability without checking.
Always hand off the qualified lead to a human agent to book a visit.

🩺 Clinic

FLOW: Private or insurance? → Which insurer? → Which provider?
      → Which day/time works best?

CRITICAL GUARDRAIL: NEVER discuss diagnosis, symptoms, or medication.
If the patient describes a symptom, reply "I'll ask the team to call you".
Do not give medical guidance under any circumstances.

📚 Course / Education

FLOW: Are you the decision-maker or referring? → How many students/users?
      → Have you tried a similar platform? → When do you want to start?

GUARDRAIL: Don't invent payment plans. Use only official terms.
Always offer a free trial class or demo.

🛒 E-commerce

FLOW: Which product caught your interest? → Size/color/variant?
      → For you or a gift? → ZIP code for shipping ETA?

GUARDRAIL: Never claim stock without checking. Use phrases like
"let me confirm that for you" when uncertain.

💼 B2B Service

FLOW: How big is the company? → Main challenge?
      → Have you hired a similar service? → Decided by you or a committee?

GUARDRAIL: Don't commit to pricing before understanding scope.
Always schedule a call with a human before sending a proposal.

Testing the prompt before production

  1. Build 10 real scenarios that happened in the last 30 days.
  2. Paste the prompt + scenario into the model playground.
  3. Score each response: does it hallucinate? freeze? respond well?
  4. Adjust the guardrails based on what broke.
  5. Once it passes 9/10 scenarios, it's ready for production.
  6. In production, revisit the prompt monthly based on real conversations that went wrong.

How much a well-built prompt costs

A typical system prompt is 800-2000 tokens. On Claude Sonnet or GPT-5 mini, it costs a fraction of a cent per conversation. More importantly: a good prompt improves qualification → sale conversion by 20-40% compared to a generic one. At scale, that pays for dozens of operators.

A prompt customized to your vertical in 3 minutes

MercaBot ships prompts pre-configured for 8 verticals. Paste your menu/product/rules, tweak the tone, and run. No need to write a prompt from scratch.

Try it free →