AI glossary

What is System prompt?

Also called System message, Developer message, System instructions ·

A system prompt is the set of instructions an application gives a language model before the user's messages, defining its role, rules, tone, tools and output format for the whole conversation, usually hidden from the end user.

How it works

Chat models receive a conversation as a list of messages with roles. The system prompt sits at the start and is treated as higher-priority guidance than ordinary user turns. Providers expose it differently: Anthropic's Messages API has a top-level system parameter, while OpenAI's APIs use a system or developer message. Either way, the model reads it on every request, so it shapes every reply.

A typical system prompt contains:

  • Role and audience: "You are a support assistant for an accounting software company."
  • Rules: what to do, what never to do, when to hand off to a human.
  • Knowledge or context: product facts, policies, today's date.
  • Tool guidance: when to call which tool.
  • Output format: length, tone, Markdown or JSON.

Why it matters

The system prompt is the main lever a developer has over a model's behaviour without fine-tuning. It is also where most product personality and policy lives in ChatGPT-style assistants, coding agents and customer bots.

Two cautions:

  • It is not a security boundary. Users can often coax a model into revealing or ignoring its system prompt (prompt injection and jailbreaks). Never put secrets in it, and enforce critical rules in code and guardrails, not only in text.
  • It costs tokens on every call. A long system prompt adds latency and cost to each request, although prompt caching from most providers reduces this for a fixed prefix.

Example

A bank's chatbot uses a system prompt such as: "You are the help assistant for Example Bank. Answer only questions about our accounts, cards and app. Never ask for passwords or full card numbers. If the user reports fraud, give the 24/7 fraud line and stop. Keep answers under 120 words." Every user message is then answered within those rules.

Sources

  1. Prompting best practices: give Claude a role, Anthropic
  2. Text generation and prompting, OpenAI

Back to the AI glossary