Skip to main content
Back to Glossary (S)
Glossary · S

System Prompt.

A system prompt is the underlying instruction an AI model receives before a conversation and which applies throughout it. It sets out role, task, tone, rules and limits, for example 'You answer questions about our services, quote only prices from the price list and refer anything unclear to the team'. Users normally cannot see it.

Illustration of "System Prompt": Code editor showing system-prompt.md system-prompt.md1##Role2Customerservice,MusterAGdrinks3##Rules4-Pricesonlyfromthepricelist5-Nodeliverypromises6##Unsure?7Handovertotheteam,takeemailApplies to every chat

System Prompt — Explained in Detail

A conversation with a language model consists of messages with different roles. The user's messages and the model's replies are visible. Before them sits the system prompt, a message with special standing: the model is trained to treat it as an overriding instruction. Anyone building a chatbot, a voice agent or an internal assistant defines here who the assistant is and how it behaves.

A good system prompt reads more like a job description than a magic spell. It describes the role ('customer service for a joinery'), the task, the knowledge the assistant may rely on, the tone (formal or informal, Swiss spelling), the response format and, above all, the limits: what it should not do and when to hand over to a person. The techniques behind this belong to prompt engineering. For coding agents, project files such as CLAUDE.md and AGENTS.md play a similar role.

The system prompt takes up room in the context window and is sent with every request, so it costs tokens on every reply. Long system prompts packed with examples and documents make each answer more expensive and sometimes worse, because important rules get buried. Extensive knowledge such as a product catalogue therefore rarely belongs in the system prompt; it is better retrieved when needed, see retrieval-augmented generation.

A system prompt is not a security boundary. Cleverly crafted input can lead a model to ignore its rules or reveal the system prompt, see prompt injection. Nothing that must not become public belongs in it, such as credentials or internal margins. Important rules, for instance 'no order without confirmation', should also be enforced outside the model, through guardrails and permissions in the connected systems.

What belongs in a system prompt

A structure that works: role and goal in two sentences, audience, permitted knowledge sources, tone and language, response format (length, lists, links), fixed rules with reasons, behaviour when unsure and the handover to people. Rules work better when explained. 'Do not quote prices outside the price list, because quotes depend on effort' is followed more reliably than a bare prohibition.

A system prompt is not written once; it is tested against typical and awkward questions and improved continuously. Teams practise exactly this in our AI workshop. Finished assistants with a sound system prompt, knowledge sources and handover come out of chatbot development or AI agent development.

Example: a drinks wholesaler writes the system prompt for its website chat

A constructed example: a drinks wholesaler in Thun sets up a chat on its website. The first draft simply reads 'You are a friendly assistant'. In testing, the chat recommends products the firm does not stock and promises Sunday deliveries.

The second version is specific: role (customer service for private and business clients), knowledge source (current range and delivery terms only), tone (formal, brief), rules (no prices except from the price list, no delivery promises, refer corporate events to the team) and behaviour when unsure ('I'd be glad to check with the team; may I take your email address?'). Only this version passes the test questions. Delivery promises are additionally prevented technically, because the chat has no access to route planning.

Frequently Asked Questions About System Prompt

A prompt is any input to an AI model, usually the user's question. The system prompt is the overarching base instruction that precedes the conversation, applies throughout it and sets role, tone and rules.

Not directly, as a rule. Cleverly crafted input can, however, lead a model to reveal it in full or in part. That is why secrets such as credentials or internal terms never belong in a system prompt.

As short as possible and as long as necessary. It is sent with every request and costs tokens. Role, rules and behaviour when unsure belong in it; extensive knowledge such as catalogues is better retrieved on demand.

Ready for Your Project?

Apply this knowledge to your website — DLM Digital will help you.