← AI glossary

AI glossary · Beginner · Language models

System prompt

A system prompt is a set of base instructions placed in an AI model before the user starts a conversation. It defines what role the model plays, what tone it answers in, and what it must not do.

About this term
Level
Beginner · Core ideas for first-time readers
Category
Basics
Added
2026-10-08
In plain words It is similar to the work guide a new employee receives on their first day. Whatever the customer (user) asks, the employee responds according to that guide. Unlike a person, though, AI does not always follow the guide perfectly.

How it works

A conversation with an LLM usually goes into the model as a stack of messages. The system prompt comes first, followed by user messages and the model's replies. Models are often trained to give the system prompt higher priority than user messages. The system prompt is also just text inside the context window, so it takes up tokens.

Why it matters

Even the same model becomes a completely different service, such as a customer service agent, coding assistant or translator, depending on its system prompt. Companies use this prompt to set the service's character, answer format and safety rules to follow. It is also more convenient because users do not have to repeat the same explanation every time. In AI agents, it also tells the model which tools it can use and in what order to carry out tasks.

Good to know

A system prompt is only strong guidance, not an absolute lock. With crafty inputs such as prompt injection or jailbreaks, the model may break its instructions or reveal the contents of the system prompt. So it is best not to include sensitive information such as passwords, and important rules are enforced again with separate mechanisms such as guardrails. If the instructions are too long or conflict with each other, the model may also miss some of them.

Example

When building a business chatbot, a developer calls the model through an API and sends along a system prompt such as "You are a customer service agent for the ○○ online store. Answer only questions about shipping and refunds, and for anything you don't know, guide the user to a human agent." The user cannot see this text, but the chatbot sets the scope and tone of its answers according to these instructions.

Related terms