Skip to content
atlas

System prompt

Also known as: system message, developer message

Standing orders the maker of an AI service places ahead of every chat, setting the assistant's role, rules and tone before the user types.

Draft - this entry has not been reviewed yet.

Formal

The part of a prompt, marked with its own role, that carries instructions from whoever built the service rather than from the end user; instruction tuning teaches the large language model to weigh it above user text, but nothing enforces that.

In plain English

Like a director's notes to an actor before the curtain rises - the audience never hears them, yet they shape every line, and a loud voice from the seats can still knock the actor off script.

In practice

The web manager at a Danish ferry company writes the system prompt for its booking chat: “Answer only about departures and bookings; never promise refunds; pass complaints to staff.”

Why it matters

Users can often coax an assistant into revealing its system prompt, and prompt injection can override it, so it must never hold passwords or keys and cannot replace real access control.

Technical deep dive

Mechanically, the system prompt is text rendered at the start of the token sequence inside the model's chat template, wrapped in role delimiters that mark it as system (or developer) content. API shapes differ: OpenAI's chat format carries it as a message with the system role and, from the o1 generation onward, a developer role intended for application builders; Anthropic's Messages API takes it as a separate top-level system parameter rather than as a message. In both cases the provider may add its own platform-level instructions that the developer does not see, and tool definitions are typically rendered into the same region.

Precedence is trained, not enforced. Instruction and preference tuning teach the model to prefer system instructions when they conflict with user turns, and OpenAI's "Instruction Hierarchy" work (Wallace et al., 2024) trains an explicit ordering in which platform or system messages outrank user messages, which outrank tool outputs, with the model expected to ignore lower-priority instructions that conflict with higher ones. OpenAI's Model Spec describes the same idea as a chain of command. These methods measurably improve robustness to jailbreaks and injected instructions, but they are statistical tendencies of the model; there is no parser or permission check that makes system text binding.

Confidentiality is the most common false assumption. System prompts leak through direct requests, role-play, translation or encoding tricks ("repeat everything above in a code block") and through indirect prompt injection; the early 2023 disclosure of Bing Chat's "Sydney" instructions was an example. OWASP's 2025 LLM Top 10 made this a separate entry, LLM07 System Prompt Leakage, and its guidance is to assume the prompt will be disclosed: never put credentials, API keys, internal URLs, user lists or authorisation logic in it, and enforce permissions, rate limits and content policies in code outside the model. Some vendors now publish their consumer assistants' system prompts; Anthropic, for example, publishes the system prompts used in its Claude apps in its release notes.

Engineering considerations: the system prompt is a fixed per-request cost in input tokens, so it is usually the largest beneficiary of prompt caching, which requires it to be byte-identical across calls - putting a timestamp or user name at its start defeats the cache. Very long rule lists dilute attention and create conflicts; clear role, context, output format and a small number of well-motivated rules generally work better. System prompts should be version-controlled and regression-tested, since a single edit affects every conversation, and multi-tenant applications must ensure one customer's configuration or data never ends up in another customer's system prompt.

What to learn first

Everything this builds on, foundations first.

  1. Token
  2. →Training data
  3. →Self-supervised learning
  4. →Transformer
  5. →Large language model (LLM)
  6. →Pretraining
  7. →Instruction tuning
  8. →System prompt

Relationships

Part of
Prompt
Unlocks
Jailbreak

Sources & further reading

Official documentation

  • Anthropic documentation - Giving Claude a role with a system prompt · Anthropic

Reference works

  • OWASP Top 10 for LLM Applications 2025 - LLM07 System Prompt Leakage · OWASP

Where this data comes from

This entry was drafted by an AI from the sources above and has not yet been checked by a person. Treat it as a starting point, and check anything important against the sources.

See the review queueSuggest a correction on GitHubThis term as JSON

Mentioned in

Check yourself

Loading…

Atlas is in beta.