Skip to content

Generative AI & LLMs

System Prompt

In shortA system prompt is the set of standing instructions given to a language model before a task, defining its role, tone, rules and output format.

Updated 25 Oct 2026· 2 min read

A system prompt is the set of standing instructions given to a language model before the conversation or task starts, telling it what role to play, how to behave and which rules to follow. The application or person then sends separate user messages, and the model applies the system instructions to each one. Providers name it differently: Anthropic calls it the system prompt, Google’s Gemini API calls it system instructions, and OpenAI uses developer messages and an instructions parameter.

How it works

In an API call, the system prompt goes in its own field, apart from the user’s input:

  • Anthropic’s Messages API has a system parameter. Its documentation says setting a role in the system prompt focuses Claude’s behaviour and tone, and that even a single sentence makes a difference.
  • The Gemini API takes a system_instruction parameter to configure the model’s behaviour.
  • OpenAI’s instructions parameter and developer messages carry the rules. OpenAI says these take priority over the prompt in the input, and compares developer messages to a function definition and user messages to its arguments.

The system prompt is still text in the model’s context window, so it uses tokens on every call and works alongside other settings such as temperature.

How it’s used in SEO and marketing

  • Brand voice and style: tone, spelling conventions, banned phrases and length limits for drafted copy. Our meta description notebook uses its system prompt to keep a curiosity gap in each description.
  • Classification: the allowed labels, their definitions and a strict output format live in the system prompt, and each keyword or page goes in as a user message. Add few-shot examples for tricky labels.
  • AI agents: the system prompt sets working rules. In our SERP analysis agent it tells the model never to state a ranking or citation it has not looked up, and to flag weak evidence.

Example

A system prompt for intent labelling might read: “You are an SEO analyst. Classify each search query as informational, commercial, transactional or navigational. Reply with the label only. If the intent is unclear, reply unclear.” Each user message is then a single query, such as “best running shoes for flat feet”, and the model replies “commercial”. Because the rules stay fixed, the output is consistent enough to load straight into a spreadsheet.

Limitations and things to watch

  • Prompt injection. OWASP ranks it first among LLM risks: text in user input, or hidden in a web page, file or email the model reads, can override your instructions. Keep permissions and spending caps in code, and treat model output as untrusted.
  • Prompts can leak. Assume users can extract a system prompt, and never put API keys or private data in it.
  • Scope. OpenAI notes its instructions parameter applies only to the current request, so resend it on each call.
  • Long, conflicting rule lists get followed unevenly. Test your prompt on a small labelled set before running it at scale.

Learn it on MLforSEO

Where System Prompt shows up on MLforSEO

Sources and further reading

Other terms from Generative AI & LLMs

See all 25 Generative AI & LLMs terms →