System prompt

The system prompt is the fixed set of instructions a model receives before every conversation: who it is, what it can and cannot do, what tone it answers in and what to do when it does not know something. The user never sees it and it is sent on every request.

What is system prompt?

The system prompt is the fixed set of instructions a model receives before every conversation: who it is, what it can and cannot do, what tone it answers in and what to do when it does not know something. The user never sees it and it is sent on every request.

Also: system instructions · system message

Why it matters

What changes in a SaaS

It is the cheapest thing to adjust and what changes an agent behaviour most. Before considering training a model or switching provider, there is nearly always room here: most strange answers come from ambiguous instructions, not from the model.

Primer plano de una placa de circuito

System prompt in detail

  • What it has to carry

    What the product is, who it serves, what information it may use, what it must never do — invent figures, promise deadlines — and what to do when a fact is missing. That last point is what separates a careful agent from a dangerous one.

  • Say what to do, not only what not to do

    "Do not invent prices" works worse than "if you are asked a price and it is not in the context, say you will confirm it and hand the conversation to a person". A prohibition leaves the model with no way out; an alternative gives it one.

  • It is code, even though it looks like text

    It changes behaviour in production, so it deserves version control, review and a way to check that a change does not break what was working. Editing it by hand in a panel with no history is like deploying without a repository.

Questions about system prompt

How long should a system prompt be?

As long as it needs to cover the cases that matter, and not one line more: it takes up context window on every request and is paid for every time. If it grows without stopping, it usually means somebody is patching case by case instead of fixing the underlying instruction.

Can the user see the system prompt?

They should not, but it is worth writing it as if they could. Attempts to extract it are routine, and a prompt that would say nothing embarrassing if it leaked is a better-written prompt.

Related terms

A term on its own is only half understood. These come up in the same conversation.

Try it without dropping what you use