Skip to content
Learn · AI Lessons · Free lesson

System Prompts: What They Are and How to Write Them

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.

Start this lesson freeFree forever. No card required.
Intermediate Under 15 minutes AI for Practitioners Certificate upon completion

Create your free account

Unlock the full lesson, the quiz, and your verifiable completion.

Continue with Google
or
Continue with email

By continuing you agree to the Institute of AI terms of use and privacy policy.

Learners across the UK study with the Institute of AI
Open to everyone From the UK's professional body for AI 100% free, no card required
What you'll learn

By the end of this lesson, you will be able to:

  • Explain what a system prompt is, and why it holds a privileged position ahead of user input.
  • Write with the precision that probabilistic adherence demands, rather than assuming a rule engine.
  • Order a system prompt properly: persona, scope, constraints, output format, then tone.
  • Avoid instruction overload and the latent contradictions that quietly degrade adherence.
  • Treat the prompt like code, with delimiters around user content, injection testing, and version control.

Recommended before you start

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.

  • Practical experience writing prompts for a chat model.
Join Others Learning AI

Free to start. Free to finish. Free to prove.

Start this lesson free
Inside this lesson

3 sections, about under 15 minutes.

Section one is open to everyone. Create a free account to work through the rest and take the quiz.

01

What a System Prompt Actually Is

Free preview

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.

02

The Anatomy of an Effective System Prompt

Unlock free
03

Common Failure Modes and How to Avoid Them

Unlock free
How it works

Walk away with proof, not just knowledge.

Step 1

Study the lesson

Work through every section at your own pace, from start to finish.

Step 2

Pass the quiz

A short set of questions on what you have just covered.

Step 3

Get your certification

Every completion has a certificate that you can share publicly for anyone to verify.

Your record of completion

Finish the lesson. Keep the proof.

The Institute of AI
Record of completion
System Prompts: What They Are and How to Write Them
Completed by
Your name
Quiz score
90%
theinstituteofai.co.uk/verify/lesson/…

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.

  • Verifiable by anyone, with no account needed
  • One link for your CV, email signature, or LinkedIn profile
  • Issued by the UK's professional body for AI
— Common questions —

Frequently asked questions.

Is this lesson really free?+
Yes. Every AI lesson from the Institute of AI is free to take and free to complete, including the quiz and your record of completion. There is no trial, no card, and no catch.
Do I need a technical background?+
This lesson is pitched at intermediate level, so it helps to be comfortable with what is recommended above, though none of it is a hard requirement. Everything is explained in plain English, and if a term matters, the lesson covers it before using it.
How long does this lesson take?+
Around under 15 minutes to work through, plus the quiz at the end. You can leave and come back at any point.
What do I get when I finish?+
A record of completion with your score, held on your profile. Each completion has a public verification page, so you can share a link on your CV or LinkedIn profile that anyone can check.
What is the Institute of AI?+
The Institute of AI is the UK’s professional body for artificial intelligence. It sets the standard of AI practice, works to that standard itself, and puts it within reach of everyone else. Its work runs across four areas: Accreditation, Practice, Platforms, and AI for All.

Join learners across the UK and start "System Prompts: What They Are and How to Write Them" today.

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.

The Institute of AI

Free to learn.
Yours to prove.

Every AI lesson is free to start, free to finish, and ends in a completion you can verify publicly.