AI & automation

What is a system prompt?

A system prompt is the set of instructions an application gives a language model before the conversation starts, defining its role, what it may and may not do, its tone, the format of its answers and the facts it should rely on.

What a good one contains

Think of it as a job description plus a style guide. For a booking assistant at a dental clinic it might cover: - Role and audience: you help patients of one named clinic book, move or cancel appointments. - Boundaries: no medical advice, no prices beyond the published list, hand over to staff for complaints. - Facts and sources: opening hours, address, and an instruction to use the booking tool rather than guess availability. - Format: short replies, one question at a time, dates written in a fixed style. - What to do when unsure: say so and offer a call back.

Mistakes to avoid

Very long prompts full of contradictory rules confuse models; if two instructions clash, the model picks one unpredictably. Putting secrets such as API keys or internal discount codes in the system prompt is risky, because users can sometimes coax the model into repeating it. And writing rules only in capital letters and threats tends to work worse than calm, specific explanations of why a rule exists.

Treat it as code

Keep the system prompt in version control, change it deliberately, and rerun a fixed set of test conversations after every edit. A one-line change can alter how the assistant behaves in situations you did not think about.

Questions, answered

They normally cannot see it directly, but determined users can often get the model to reveal parts of it, so never store anything confidential there.

As long as it needs to be clear. Many production assistants use a page or two; length matters less than consistency.

By the Stegnor team · Updated