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:
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
Context
Context is all the text a model can see for a single request: the system prompt, your message, the conversation so far, and any files or tool output the agent has pulled in. It is the only thing the model knows about your specific situation.
Read definition →Agent
An agent is a language model wrapped in a loop that lets it call tools, read the results, and decide what to do next. The model supplies the judgement; the loop and the tools give it hands.
Read definition →Tool
A tool is a named action, with a typed input schema, that a model is allowed to call. Tools are how a model that can only produce text gets to actually do things: read a file, run a command, search the web.
Read definition →