# What is a system prompt?

Instructions the builder of an AI app gives the model before you type anything. It sets the role, the tone and the rules, and it outranks what users say.

- Page: https://tecyfy.com/concepts/system-prompt
- Subject: How AI works (https://tecyfy.com/concepts)
- Level: beginner
- Also called: System Message, Developer Message, Instructions
- Last checked: 2026-10-14

Every AI app you use has been briefed before you arrive. A support bot knows it works for one shop. A coding assistant knows to answer in code. That brief is the system prompt: text the app's builder puts in front of every conversation, usually out of your sight.

Anthropic calls it the system prompt. OpenAI calls the same thing developer messages, or instructions. The idea is identical.

## What goes in one

A system prompt usually covers:

- **A role.** "You are a helpful coding assistant who specialises in Python." Anthropic notes that even a single sentence like this changes the model's focus and tone.
- **Rules.** What to do, what not to do, and how to say no.
- **Context.** Today's date, the product, the customer's account level.
- **Format.** Short answers, plain language, no tables, always cite sources.

## Why it outranks you

Models are trained to give the builder's instructions more weight than the user's. OpenAI's documentation says it plainly: developer messages are prioritised ahead of user messages. That is what lets a bank's chatbot refuse to write your essay. It was told to stick to banking, and your request ranks below that.

It is also why a system prompt should say that text from web pages, files and tool results is information, not orders. That line is one of the defences against [prompt injection](https://tecyfy.com/concepts/prompt-injection).

## What it is not

A system prompt is not a safe. OWASP, the security group, says it should not be treated as a secret or used as a security control. Users do sometimes coax a bot into repeating its instructions, so builders should keep passwords and keys out of it and enforce real limits in code.

It also takes up room. The system prompt sits in the [context window](https://tecyfy.com/concepts/context-window) on every turn, so a long one costs tokens on every message.

## Using the idea yourself

You can write your own. If your chat app has a setting for custom or standing instructions, that is your system prompt. Keep it short and specific: who you are, what you want, what to avoid. Calm wording works better than capitals. Anthropic warns that "CRITICAL: you MUST" style prompts can make newer models overdo the thing you asked for.

## Related

- [Prompt](https://tecyfy.com/concepts#prompt): The input text given to a generative model.
- [Prompt Engineering](https://tecyfy.com/concepts#prompt-engineering): Crafting input prompts to steer generative models toward desired outputs
- [Prompt Injection](https://tecyfy.com/concepts/prompt-injection): An attack that hides instructions in text a model reads, such as a web page, an email or a file, so the model follows the attacker instead of you.
- [Guardrail](https://tecyfy.com/concepts/guardrail): Checks placed around a model that stop or change what goes in and what comes out, such as a filter on user messages or an approval step before an agent acts.
- [Context Window](https://tecyfy.com/concepts/context-window): Everything a model can see at once while it writes an answer, counted in tokens. When the window is full, something has to be left out.

## Sources

- [Prompting best practices](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/claude-prompting-best-practices), Anthropic, Claude API documentation, 2026-10-14. Setting a role in the system prompt focuses Claude's behaviour and tone, and even a single sentence makes a difference. The example system prompt is "You are a helpful coding assistant specializing in Python." Some models are more responsive to the system prompt than earlier ones, and aggressive wording in capitals, such as "CRITICAL" and "You MUST", can make them overtrigger.
- [Text generation](https://developers.openai.com/api/docs/guides/text), OpenAI API documentation, 2026-10-14. Developer messages are instructions from the application developer, prioritised ahead of user messages. User messages come from an end user and are prioritised behind developer messages. Instructions given in the instructions parameter take priority over the prompt in the input.
- [Mitigate jailbreaks and prompt injections](https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaks), Anthropic, Claude API documentation, 2026-10-14. System prompts can set ethical and legal boundaries and tell the model how to refuse. The system prompt should state that content returned from tools, documents or searches is untrusted and must never override the system prompt or the user's request.
- [LLM07:2025 System Prompt Leakage](https://genai.owasp.org/llmrisk/llm072025-system-prompt-leakage/), OWASP Gen AI Security Project, 2026-10-14. The system prompt should not be considered a secret, nor should it be used as a security control. Credentials and connection details should not be contained in the system prompt.
- [Context windows](https://platform.claude.com/docs/en/build-with-claude/context-windows), Anthropic, Claude API documentation, 2026-09-25. The question, instructions, tool definitions and tool results all count toward the context window.
