What is a system prompt?
1 Answer
A system prompt is a set of instructions given to an AI model before the conversation starts. It sets the model's role, behaviour, tone and rules for everything that follows. Users usually do not see it, but it shapes every answer they get.
In a typical AI conversation, there are different types of messages. The user prompt is what you type. The assistant's reply is the model's answer. The system prompt sits above both as a background briefing. If a user prompt is like a customer asking a shop assistant a question, the system prompt is the shop's training manual that the assistant read before the shop opened.
Companies use system prompts all the time. When a bank builds a customer support chatbot on top of a model like GPT or Claude, its system prompt might say: "You are a support assistant for XYZ Bank. Answer only questions about our savings accounts, cards and app. Never ask customers for their PIN, OTP or password. If a question is about a complaint, give the grievance helpline number. Be polite and keep answers under 100 words." Every customer conversation is shaped by these rules without the customer seeing them.
Developers set the system prompt through the API, usually in a dedicated field for system instructions. Everyday users have a simpler version of the same idea. Custom instructions in ChatGPT, project instructions in Claude and Gems in Gemini all work like a personal system prompt, applying your preferences to every chat.
A good system prompt usually covers:
1. Role and purpose: who the AI is and what it is for.
2. Audience: who it is talking to and their level of knowledge.
3. Tone and style: formal, friendly, concise or detailed.
4. Rules: what it must always do and must never do.
5. Format: how answers should be structured.
6. Handling edge cases: what to do when a question is outside scope or information is missing.
Some tips help too. Explain the reasons behind rules, because models follow instructions better when they understand why. Keep it clear and organised. Test it with tricky questions, not just easy ones.
Do not rely on a system prompt to keep secrets. Determined users can sometimes get a model to reveal its instructions, so never put passwords, API keys or confidential data in one.