Context

System prompt

Also called: system message

The system prompt is the standing instruction placed at the very start of the context that sets the model’s role, rules, and tone before the conversation begins. It shapes every reply without being part of the back-and-forth.

James Phoenix
Understanding Data Updated July 2, 2026

Every request to a model can carry a system prompt: a block of instructions that comes before the user's messages and frames how the model should behave. It is where a coding tool says things like "you are a careful senior engineer, prefer small diffs, never invent file paths." The model treats it as the ground rules for the whole exchange.

How it differs from a normal message

A system prompt is set by the application, not typed by you turn to turn, and it stays in place for the life of the session. In the messages sent to the model, it is marked separately from user and assistant turns:

TypeScript
const messages = [
  {
    role: 'system',
    content: 'You are a careful coding assistant. Make minimal changes and never guess file paths.',
  },
  { role: 'user', content: 'Add input validation to the signup form.' },
]

That first entry is doing a lot of quiet work: it steers tone, sets guardrails, and often lists the tools the model is allowed to use.

Why it matters to you

In most coding agents you do not write the system prompt directly, but it explains a lot of the tool's "personality" and its limits. When two agents behave very differently on the same task with the same model, the system prompt is usually why. And when a tool lets you add your own project instructions, you are effectively extending the system prompt, so keeping those instructions short, clear, and non-contradictory pays off on every single request.

Related terms

Building with AI agents?

This dictionary is part of how I think about agentic engineering. If you want the same thinking applied to your codebase, that is what I do.

See how I can help