System Prompt
The instructions given to an AI model before a conversation to set its role and behavior.
What Is a System Prompt
A system prompt is a set of instructions given to a large language model before any user input, establishing its role, behavior, tone, constraints, and available tools for the remainder of a conversation or task. It is typically set by the developer or operator of an application rather than by the end user, and most model providers treat it with higher priority than later messages when the two conflict.
How It Works
Technically, a system prompt is just text placed in a designated position in the input sent to the model, often in a separate field or role labeled system in the API request. The model does not receive rules from outside its context window; everything it knows about how to behave in a given session comes from the combination of the system prompt, the conversation history, and any tool or function definitions provided alongside it. Because of this, a system prompt has to explicitly state anything that matters: the persona to adopt, output format requirements, topics to avoid, and how to use available tools.
Why It Matters
System prompts are the primary mechanism for shaping an LLM's behavior without retraining the model itself. A well-written system prompt can enforce a consistent output contract, such as requiring a JSON response that matches a schema, define safety boundaries, or give an agent a clear operating procedure for a task. In multi-agent platforms, each agent commonly has its own system prompt tailored to its role, for example one agent configured to write code and another to review it. In Agenhood, the system prompt is part of an agent's configuration and works alongside the chosen driver and model to determine how the agent interprets and executes tasks.
System Prompt vs User Prompt
- System prompt: set once by the application or operator, defines persistent behavior and constraints, generally not visible to or editable by the end user.
- User prompt: the specific request or message sent for a given turn, changes with every interaction, and is interpreted within the boundaries the system prompt establishes.
Because models weigh instructions by position and role, a strong system prompt reduces the risk of the model drifting from its intended behavior over a long conversation, though it is not a guaranteed security boundary on its own.