Research Careers Contact

GlossarySystem prompt

System prompt

A system prompt is the set of instructions an application gives a language model before any user input, defining its role, rules, tone and the tools it can use. It stays in place for the whole conversation and is meant to take priority over what users type.

How it works

Chat-style model interfaces separate messages by role. The system or developer message comes first and carries the application's instructions. User messages follow, along with the model's replies and any tool results. Models are trained to weigh system instructions above user instructions when the two conflict.

A system prompt for an agent usually describes the task and its limits, lists the available tools and when to use them, sets the output format and explains how to handle uncertainty, such as asking a question or handing off to a person. A system prompt for a BOM review assistant, for example, tells it to check each line for lifecycle status, a matching footprint and a second source, to cite the datasheet for every claim and to flag what it cannot confirm instead of guessing. Some protocols also let a server offer reusable prompt templates that a client inserts into the conversation.

System prompt vs user prompt

The system prompt is written by the application's builders and is the same for every session. The user prompt is written by the person using the application and changes every turn. The system prompt sets the boundaries. The user prompt asks for something inside them.

Why it matters

The system prompt shapes every answer the application gives. It is also a target. The OWASP Top 10 for LLM applications lists hidden context exposure, which includes a leaked system prompt, as a risk: attackers try to get the model to reveal its instructions, and any secrets placed there are exposed. Prompt injection tries to override the system prompt with instructions hidden in user input or documents. A system prompt is guidance for the model, not a security control.

How to get it right

  • Keep credentials, keys and internal details out of the system prompt.
  • Enforce permissions and limits in code, not only in instructions.
  • State the role, the rules, the tools and the output format plainly.
  • Tell the model how to treat outside content: as data, never as instructions.
  • Version system prompts and test changes on real inputs before release.
  • Keep it as short as the task allows, so each rule stays clear.

System prompts in robotics and drone hardware

A system prompt for engineering software names the task, the standards that apply, such as the IPC class or the design rules for a stackup, and what the model must not do, such as invent part numbers or change released files. The hard limits, like who can approve a release or edit a BOM, belong in the software's permissions, with the system prompt describing them so the model works within them. A prompt for drafting work instructions names the board revision and the format operators expect, and tells the model to leave a torque value or polarity note blank when the source drawing does not give it.

Learn more