Study the lesson
Work through every section at your own pace, from start to finish.
If you have spent any time deploying a large language model in a real product, you have almost certainly wrestled with a system prompt, even if you did not call it that. It is the instruction layer that sits above every conversation, shaping how the model behaves before a user types a single word. Think of it as the briefing you give a contractor before they start work: the user's messages are the day-to-day tasks, while the system prompt is the employment contract, the house style guide, and the list of things they are not allowed to do, all rolled into one. Get it right and the model feels coherent, purposeful, and safe. Get it wrong and you will spend weeks chasing inconsistent outputs and confused users. System prompts are where product decisions become model behaviour: defining persona, constraining scope, setting tone, and establishing guardrails. They are also where many practitioners make avoidable mistakes, over-specifying in ways the model ignores, under-specifying in ways the model fills unpredictably, or writing instructions that contradict each other under pressure. This lesson covers the essentials: what a system prompt actually is at a technical level, what belongs in one, and how to write instructions that hold up in production rather than just in your test suite.
Unlock the full lesson, the quiz, and your verifiable completion.
Continue with GoogleBy continuing you agree to the Institute of AI terms of use and privacy policy.
None of these are hard requirements. The lesson is easier if they are already familiar, but everything it uses is explained along the way, so you can start without them.
Section one is open to everyone. Create a free account to work through the rest and take the quiz.
Modern LLM APIs separate the instruction layer from the conversation itself, though they expose it differently: Anthropic takes a top-level system parameter alongside the messages array, while OpenAI uses a developer role, or the instructions parameter in its Responses API, having reserved system for its own use. Whatever the mechanism, that content sits ahead of the conversation, and models are trained to treat it with elevated authority. A system prompt is the content you place in that layer. It is not visible to end users, though they can often infer its contents through probing, and it persists for the duration of a single context window. In standard stateless API calls it does not persist across separate sessions, so your application must re-inject it on every call. The key architectural point is that the model does not know it has a system prompt the way a human knows they have been briefed. It processes the full context window as text, and the system prompt is simply the first content in that context. Adherence is therefore probabilistic, not deterministic: a well-written system prompt strongly conditions the model's behaviour, but it does not enforce rules with mathematical certainty. A user message is one turn among many; the system prompt sits in a fixed, privileged position at the start of the context, and instructions in the system role generally carry more weight than instructions in the user turn, which makes it the right place for hard constraints. That said, conflicting user instructions can still cause drift, so your constraints need to be unambiguous. And because the system prompt establishes trusted authority, it is also the primary target for prompt injection, attempts by malicious user input to override or circumvent your instructions.
Work through every section at your own pace, from start to finish.
A short set of questions on what you have just covered.
Every completion has a certificate that you can share publicly for anyone to verify.
Pass the quiz and the Institute of AI issues you a record of completion with your score. Every completion has its own public verification page, so the link you put on your CV or LinkedIn profile can be checked by anyone, at any time.
Free lessons, a quiz to test what you have learned, and a completion you can verify publicly. All from the UK's professional body for artificial intelligence.
Every AI lesson is free to start, free to finish, and ends in a completion you can verify publicly.