Chapter 1 · The scenario
Example: Rewriting the prompt for a Jaipur jewellery store
A Jaipur jewellery store's first bot prompt said only "You are a helpful assistant for our store." The bot answered general-knowledge questions, wrote 300-word replies with Markdown headers that arrived as rows of hash signs, and quoted gold rates from memory. The rewritten prompt scoped it to orders, store visits, repairs and custom designs; set a 60-word limit and WhatsApp formatting; told it to answer in Hindi, English or Hinglish to match the customer; banned quoting prices without the get_gold_rate tool; and listed three handoff triggers. Off-topic chats dropped and agents stopped correcting the bot's price quotes.
Chapter 2 · What is a system prompt?
A system prompt is the block of instructions a developer gives a large language model (LLM) before any user input, framing every reply in the conversation. In a WhatsApp bot it says who the bot is ("the support assistant for a Jaipur jewellery store"), what it may and may not help with, how it should sound, which language and script to answer in, how long replies should be, which tools it can call and when to hand over to a person. Customers never see it; it travels with every request.
It is distinct from the user messages, which change every turn, and from fine-tuning, which changes the model itself through training. The system prompt is the cheapest and fastest lever: edit a line and the next reply changes. APIs pass it as a separate system (or developer) message, and models are trained to give it more weight than user text — more weight, not absolute authority.
That limit is why a system prompt is not a security control. Prompt injection — a customer or a retrieved document telling the model to ignore its instructions — can override it, and anything written in it may be repeated back to a user. Rules that must hold, such as who may see an order or whether a discount exists, belong in code and in AI guardrails; the system prompt explains the rules so the model behaves well, and the system around it enforces them.
Key takeaways
- A system prompt is the standing set of instructions an LLM reads before every turn of a conversation.
- It defines the bot's role, scope, tone, language, reply length, tools and escalation rules.
- It is guidance, not a security boundary: prompt injection can override it, so enforce limits in code.
- Write it for WhatsApp: short replies, WhatsApp formatting instead of Markdown headings, and the customer's language and script.
- Version and test it like code, and keep static text first so provider prompt caching can reuse it.
Chapter 3 · Why it matters
Why does a system prompt matter?
The system prompt decides much of what customers experience: whether the bot answers in Hinglish when they write Hinglish, whether replies fit on a phone screen, whether it promises refunds it cannot give, and whether it hands over at the right moment. It matters for compliance too: since 15 January 2026 the WhatsApp Business Solution Terms bar general-purpose AI assistants as a core product on the platform, while AI used for a business's own customer service is unaffected — so a bot should be scoped to your business, and the system prompt is where that scope is written down.
Chapter 4 · How it unfolds
How does a system prompt work?
Role and scope first
Open with who the bot is, whom it serves and what it covers — orders, returns, store timings — and what it must decline or hand off, such as medical advice or account changes.
Language, length and format
Tell it to reply in the customer's language and script (Hinglish in Latin script if that is what they typed), keep replies to two or three short paragraphs, and use WhatsApp text formatting such as
*bold*and_italic_— never Markdown headings or tables.Tools and when to use them
List each tool with one line on when to call it and what not to do with it — for example, call
get_order_statusonly for an order ID the customer gave, never a guessed one.Escalation and refusals
Spell out handoff triggers — a request for a person, repeated failure, anger, payment disputes — and a short, fixed refusal for off-scope requests, so behaviour is predictable.
Context last
After the static instructions, add per-conversation context: today's date, the customer's first name, the branch, whether the 24-hour window is open. Static text first lets prompt caching reuse it and keeps the context window budget predictable. When a reply must feed buttons or fields, ask for structured output (JSON mode) instead of describing a format in prose.
Version and evaluate
Keep the prompt in source control, review changes like code and run LLM evaluation on a fixed test set — including injection attempts — before every release.
Chapter 5 · In code
A system prompt in code
You are the WhatsApp assistant for {STORE_NAME}, a jewellery store in Jaipur.SCOPE- Help with orders, store visits, repairs and custom-design enquiries.- Politely decline anything else and offer the main menu.STYLE- Reply in the customer's language and script: Hindi, English or Hinglish.- Max 60 words. Use *bold* sparingly. No headings, tables or invented links.TOOLS- get_order_status(order_id): only for an ID the customer typed. Never guess IDs.- get_gold_rate(): always use it for prices. Never quote rates from memory.HANDOFF- Hand off if the customer asks for a person, is upset, or raises a payment dispute.You cannot change prices, apply discounts or edit orders. Never claim you did.
Short sections, concrete rules and a tool list. {STORE_NAME} is filled in per deployment.
Chapter 6 · Where it goes wrong
Common mistakes with a system prompt
Treating it as a secret or a lock
Anything in the system prompt can be extracted with enough prodding, and its rules can be argued away. Keep secrets out, and enforce permissions in tool code.
Writing for a web chat, not WhatsApp
Long answers, Markdown headings and tables render badly on a phone. Set a word limit and allow only WhatsApp formatting.
Contradictory or buried rules
"Always be detailed" in one paragraph and "keep it short" in another makes behaviour random. Group rules under headings, state priorities and delete stale lines.
Pasting changing facts into the prompt
Prices, stock and policies written into the prompt go stale silently. Fetch them with tools or retrieval at answer time instead.
Editing in production without tests
A one-word change can shift tone or break tool use across thousands of chats. Run your evaluation set before deploying any prompt change.
Chapter 7 · What good teams do
Best practices for a system prompt
- Include two or three short example exchanges in the target tone — models imitate examples more than adjectives.
- Say what to do, not only what not to do: "offer the main menu" beats "don't go off-topic".
- Give the current date and time zone; models do not know today's date on their own.
- Keep one prompt per bot and language policy, rather than a slightly different copy per customer segment.
Chapter 8 · The facts
A system prompt: key facts and limits
| Where it goes | A separate system (or developer) message on every request |
|---|---|
| Visible to customers | No — but assume it can be extracted |
| Security role | Guidance only; enforce rules in code |
| WhatsApp text limit | 4,096 characters per text message |
| Formatting that renders | *bold*, _italic_, ~strikethrough~ and monospace — not Markdown headings or tables |
| Scope rule | General-purpose AI assistants barred as a core product since 15 January 2026 |
Chapter 9 · System Prompt FAQs