The system prompt holds standing instructions that apply to every request. It is the main lever you have over behaviour, and it is consistently underused by people building on APIs.
How does it differ from a message?
It is not part of the conversation. It sets the frame, persists across turns, and with most providers is given more weight than something a user said, which makes it the right place for rules.
What should it contain?
- The task. Stated narrowly.
- The output format. Precisely.
- The audience. Who reads the result.
- Rules. A few things to always and never do.
- Fallback behaviour. What to do when unsure.
Why does fallback behaviour matter?
Because the default when information is missing is to produce something plausible. Telling it to say when it cannot answer, rather than inventing, is the instruction that prevents the worst failures.
How specific should it be?
Checkable rather than aspirational. Under a hundred words, one paragraph, no preamble are all verifiable; be concise is not, and the compliance difference between those styles is substantial.
What about examples?
The most effective single addition. One or two demonstrations of the output you want do more than a paragraph describing it, because the target is shown rather than characterised.
Should the system prompt include examples?
Usually yes, and fewer than you might. Two or three demonstrations establish the pattern; ten produce output that imitates the examples closely rather than generalising from them.
They also cost tokens on every call, which is an argument for choosing them carefully. A mixed set covering different cases works better than several variations of the same one, and it makes the pattern clearer rather than narrower.
How long should it be?
Shorter than people write. Compliance degrades with length, and beyond a page you cannot tell which instruction produced which behaviour, which makes iteration guesswork.
Where should it actually live?
In version control alongside your code, not pasted into a console. A system prompt is a piece of your application's logic, and treating it as configuration means changes are reviewable and reversible.
That also makes it possible to tell which version produced which behaviour. Prompts edited in place, with no history, are the reason people cannot explain why an application started behaving differently last Tuesday.
Does it cost anything?
Yes, on every call. A long system prompt is charged with each request, which matters at volume and is a reason to keep it tight beyond the quality argument.
How should you iterate on it?
One change at a time against a fixed set of test inputs. Changing three things and rerunning tells you the output differed and nothing about why.
What should you do when it stops working?
Check whether the model changed before rewriting the prompt. Providers update models behind the same names, and a configuration that degraded overnight with nothing altered on your side is frequently this.
Pinning to a specific dated version, where the provider offers it, removes the surprise. That trades automatic improvements for predictability, which is usually the right trade for anything in production.
How do you test whether a prompt is working?
Against a fixed set of inputs, changed one thing at a time. Running a new prompt on a single example and being satisfied is how people end up with instructions that work for the case they happened to try.
Keeping ten representative inputs and rerunning them after each change takes minutes and tells you whether an adjustment helped generally or only on the example that prompted it. That discipline is what separates iteration from guessing.
What is the most common mistake?
Writing a persona. Describing an expert changes tone and little else, where specifying the output, the rules and the fallback changes results substantially.
What is the highest-value thing to add?
A precise output specification and an instruction to ask or refuse rather than guess. Those two account for most of the difference between an application that works and one that produces plausible nonsense.