System Prompts vs User Prompts

Almost every AI app sends the model two kinds of instruction. What belongs in the system prompt vs the user prompt, why the split matters for consistency and security, and the mistakes to avoid.

When you use ChatGPT or Claude in a chat window, you type one thing: your message. But under the hood, almost every serious AI application is sending the model two kinds of instruction — a system prompt and a user prompt — and the split between them is one of the most useful things to understand once you move from chatting with AI to building with it.

Get the division right and your app behaves consistently and follows the rules. Get it wrong — cram everything into one bucket — and you get an assistant that forgets its instructions, contradicts itself, or lets users talk it out of its own guardrails.

The two roles

The system prompt sets the stage. It's where you define who the assistant is and how it should always behave: its role, its rules, its tone, its constraints, the format it should respond in, what it should refuse. It's set by you, the developer, and the end user typically never sees it. Think of it as the standing instructions an employee gets on their first day — the things that are true for every interaction, no matter who walks in.

The user prompt is the specific request in the moment: the actual question, the text to summarize, the task to perform. It's the customer at the counter making today's request. It changes every turn; the system prompt usually doesn't.

System: You are a support assistant for Acme Bank. Answer only questions about Acme products. Never give financial advice. Keep responses under 100 words and always end by asking if there's anything else you can help with.
User: What's the interest rate on your savings account?

The system prompt governs how the model shows up; the user prompt supplies what it's working on right now.

Why the split matters

You might reasonably ask: if it all gets sent to the model anyway, why bother separating it? Three real reasons.

1. The model weights them differently. Models are trained to treat the system prompt as higher-priority, more persistent instruction. Rules placed there hold up better over a long conversation than the same rules dropped into a user turn, which the model can lose track of as the exchange grows.

2. It's a security boundary. This is the big one. Your standing rules belong in the system prompt precisely because that's not where user input goes. If you build your user prompt by pasting untrusted input into the same instruction block as your rules, you've opened the door to prompt injection — a user (or a document, or a web page the agent reads) writing ignore your previous instructions and… and having a decent shot at being obeyed. Keeping your authoritative rules in the system prompt, separate from user-supplied content, is a foundational defense.

3. It keeps your app coherent. Stable behavior lives in one place, set once. Variable requests flow through another. When you need to change the assistant's tone or add a rule, you edit the system prompt — not fifty scattered request templates.

What goes where

A simple rule of thumb: if it's true for every request, it's a system prompt. If it's specific to this request, it's a user prompt.

Put in the system prompt:
- The assistant's role and purpose
- Behavioral rules and things it must never do
- Default tone, style, and response format
- Domain knowledge or policies that always apply
- How to handle edge cases and refusals

Put in the user prompt:
- The actual question or task
- The specific data, text, or document to work on
- Per-request parameters (make this one extra formal)

The mistakes to avoid

Cramming everything into the user prompt. The most common beginner pattern: no system prompt at all, with role, rules, and request all mashed into one message. It works in a demo and drifts in production. Give your standing instructions their proper home.

Putting user input in the system prompt. The dangerous inverse. Never build your system prompt by interpolating untrusted user text into it — that hands users the keys to your highest-priority instruction channel. User content goes in the user turn, always.

Bloating the system prompt. Because system prompts are powerful, it's tempting to stuff them with every rule you can think of. But a 3,000-word rulebook dilutes the instructions that matter and burns tokens on every single call. Keep it as tight as it can be while still governing behavior. (When it is long and stable, prompt caching makes re-sending it nearly free.)

Contradicting yourself across the two. If the system prompt says always be concise and the user prompt says explain in exhaustive detail, you've created a conflict the model has to resolve — usually not the way you'd hope. Design them to work together.

For agents, this scales up

In an agentic system, the system prompt becomes even more important — it's the agent's constitution, governing its behavior across many autonomous steps. And as applications grow, standing instructions increasingly move out of the per-call system prompt entirely and into more durable homes: project-level instruction files, reusable skills, and configuration that persists across sessions. The principle is the same, just at a larger scale: separate the stable how from the changing what, and give the stable part an authoritative, protected place to live.

The takeaway

The system/user split is a small structural idea with outsized payoff. Stable behavior, rules, and identity go in the system prompt, where the model weights them heavily and users can't tamper with them. The specific, changing request goes in the user prompt. Keep them separate, keep untrusted input out of the system prompt, and keep the system prompt lean — and you've got an application that behaves the same way today as it did yesterday.

This is the structural layer beneath The Complete Guide to Prompt Engineering in 2026; for what goes inside each prompt, see Anatomy of a Great Prompt. As your context grows past a single prompt, context engineering picks up the story. Prompts to start from are in the prompt library.