Skip to content

A glossary story9 chapters · 6 min read

System Prompt

The standing instructions an LLM receives before any customer message, setting a bot's role, scope, tone, rules, tools and reply format.

Also called: System message · System instructions · Bot instructions

Reviewed

Follow along

Walk through a WhatsApp bot's system prompt

6 / 6
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.

Step 6 of 6 · line 18

Hard limits, said out loud. Not a security control — the bot simply has no tools that change prices or orders.

Jump to
A real-shaped system prompt for a jewellery store's bot, and the code that sends it. Step through the highlighted lines to see what each section controls and why per-chat context goes last.

system-prompt.txt, step 6 of 6, line 18: Hard limits, said out loud. Not a security control — the bot simply has no tools that change prices or orders.

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.

— Rewriting the prompt for a Jaipur jewellery store

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?

  1. 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.

  2. 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.

  3. 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_status only for an order ID the customer gave, never a guessed one.

  4. 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.

  5. 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.

  6. 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 goesA separate system (or developer) message on every request
Visible to customersNo — but assume it can be extracted
Security roleGuidance only; enforce rules in code
WhatsApp text limit4,096 characters per text message
Formatting that renders*bold*, _italic_, ~strikethrough~ and monospace — not Markdown headings or tables
Scope ruleGeneral-purpose AI assistants barred as a core product since 15 January 2026

Chapter 9 · System Prompt FAQs

System Prompt FAQs

What is the difference between a system prompt and a user prompt?+
The system prompt is the developer's standing instructions; the user prompt is each message from the customer. The system prompt stays the same across the conversation and carries more weight, while user messages change every turn and are handled within its rules.
Can customers see or extract the system prompt?+
They cannot see it directly, but determined users can often get a model to repeat parts of it. Write it as if it may be published: no secrets, no internal URLs, nothing you would be embarrassed to see quoted.
How long should a system prompt be?+
As long as it needs to be and no longer — often a few hundred words for a support bot. Every token is sent with every message, so long prompts add cost and latency; move changing facts into tools or retrieval.
Is a system prompt better than fine-tuning?+
For most WhatsApp bots, start with the system prompt. It is instant to change and easy to test; fine-tuning is worth it only when prompting cannot reach the consistency, format or cost you need.

From definition to your first message

InfiQ is an official Meta Business Partner. Start a 7-day free trial — no card needed — and see this running on your own number.