A system prompt is the set of instructions a model gets before the conversation starts. It sets the role, rules, tone and output format that apply to every reply in the conversation. OpenAI calls it the developer message or the instructions parameter, Anthropic calls it the system prompt, and Google calls it a system instruction. In the consumer apps, the same idea appears as custom instructions, project instructions and Gemini skills.

This guide covers what each vendor’s documentation says about system prompts, how to write one, and where to set it in ChatGPT, Claude and Gemini.

On this page

How a system prompt differs from a regular prompt

A regular (user) prompt asks for one thing: “Summarize this email.” A system prompt says how to handle every request in the session: “You are a support agent for a software company. Answer in plain English, in under 150 words, and link to the help article you used.”

OpenAI’s prompt engineering guide describes the split with an analogy: “developer messages provide the system’s rules and business logic, like a function definition,” while “user messages provide inputs and configuration to which the developer message instructions are applied, like arguments to a function.”

Priority is the other difference. OpenAI says developer messages are “prioritized ahead of user messages”, and instructions passed in the instructions parameter “will take priority over a prompt in the input parameter.”

System prompt vs user prompt vs assistant message

Role Written by Holds Priority
System (developer in OpenAI’s API) The app builder, or you through custom instructions Standing rules, persona, output format Highest
User The person chatting The request for this turn and its inputs Behind the system prompt
Assistant The model Replies; you can also write sample replies as examples Not an instruction

The role names and priority order come from OpenAI’s prompt engineering guide, which says messages generated by the model “have the assistant role”.

System prompts in the OpenAI, Anthropic and Gemini APIs

OpenAI: instructions and developer messages

In the Responses API you pass a system prompt in two ways: the instructions parameter, or a message with the developer role in the input array. OpenAI’s example uses this instruction:

Talk like a pirate.

One catch from the same page: instructions only apply to the current request. If you chain turns with previous_response_id, earlier instructions are not carried over, so send them again.

OpenAI suggests a developer message usually contains these sections, in roughly this order:

  1. Identity: the assistant’s purpose, communication style and high-level goals
  2. Instructions: rules, what to do and what never to do
  3. Examples: sample inputs with the desired outputs
  4. Context: extra data the model needs, usually placed near the end

It also recommends Markdown headers and XML tags to mark where each section starts and ends.

Anthropic: the system parameter

Claude takes the system prompt in the system parameter of the Messages API. Anthropic’s prompting best practices say that “setting a role in the system prompt focuses Claude’s behavior and tone for your use case. Even a single sentence makes a difference.” Its example system prompt is one line:

You are a helpful coding assistant specializing in Python.

The same page shows system prompts doing other jobs, such as removing preambles. Anthropic suggests this instruction:

Respond directly without preamble. Do not start with phrases like 'Here is...', 'Based on...', etc.

Google: system instructions in the Gemini API

The Gemini API takes a system_instruction parameter. Google’s text generation docs say “you can guide the behavior of Gemini models with system instructions” and give this example:

You are a cat. Your name is Neko.

Google’s prompt design strategies page also uses a system instruction to set the answer style:

All questions should be answered comprehensively with details, unless the user requests a concise response specifically.

A full system prompt example

OpenAI’s prompt engineering guide shows a complete developer message with Identity, Instructions and Examples sections. This one labels product reviews:

# Identity

You are a helpful assistant that labels short product reviews as
Positive, Negative, or Neutral.

# Instructions

* Only output a single word in your response with no additional formatting
  or commentary.
* Your response should only be one of the words "Positive", "Negative", or
  "Neutral" depending on the sentiment of the product review you are given.

# Examples

<product_review id="example-1">
I absolutely love this headphones — sound quality is amazing!
</product_review>

<assistant_response id="example-1">
Positive
</assistant_response>

<product_review id="example-2">
Battery life is okay, but the ear pads feel cheap.
</product_review>

<assistant_response id="example-2">
Neutral
</assistant_response>

<product_review id="example-3">
Terrible customer service, I'll never buy from them again.
</product_review>

<assistant_response id="example-3">
Negative
</assistant_response>

The review to label goes in the user message. For more ready examples by job, from coding rules to grounded answers, see our prompt library and AI prompts examples by task.

How to write a good system prompt

The vendors’ advice lines up on a few points:

  1. Give the model a role. One sentence about who it is and who it serves already changes the output, per Anthropic.
  2. Explain why a rule exists. Anthropic’s example: rather than “NEVER use ellipses”, say the response “will be read aloud by a text-to-speech engine”, so the model can generalize.
  3. Say what to do, not only what to avoid. Anthropic suggests “Your response should be composed of smoothly flowing prose paragraphs” over “Do not use markdown.”
  4. Add examples. OpenAI lists examples as a standard section, and Google recommends including few-shot examples in prompts.
  5. Separate sections clearly. Use Markdown headings or XML tags, as both OpenAI and Anthropic suggest.
  6. Keep task details out. The system prompt holds what stays the same; the user message holds what changes. Google’s prompting strategies put “role definitions (persona), and output format requirements” in the system instruction and the specific question “at the very end of the prompt”.

Where to set a system prompt in ChatGPT, Claude and Gemini

You don’t need the API to use a system prompt. Each app has a place for standing instructions.

ChatGPT custom instructions. On web and desktop, open Settings, select Personalization, make sure Enable customization is on, and type in the Custom Instructions field (OpenAI help). On iOS and Android the menu is Customize ChatGPT. They apply to all your chats.

ChatGPT project instructions. Open a project, click the three dots in the upper right, choose Project settings and add instructions. OpenAI’s Projects article notes that project instructions apply only inside that project and “will override your global custom instructions.” Its example:

Act like my marketing mentor. Be concise. Use bullet points. Ask clarifying questions.

Claude instructions and project instructions. For account-wide rules, click your initials, select Settings and fill in Instructions for Claude (Claude help). For one project, click Set project instructions on the project page (Claude help); Claude uses them in every chat in that project.

Gemini skills (replacing Gems). On September 30, 2026 Google announced skills: saved instructions you call by typing / and the skill’s name, which Gemini can also run on its own when a prompt matches. Google says it will remove Gems for personal accounts starting November 2026 and move existing Gems into skills. Until then, a Gem is still created on gemini.google.com with Explore Gems → New Gem (Google help). How to write a skill Gemini picks up is in our Gemini skills update.