The persona tells an assistant who it is. The rules tell it what it must do when the conversation stops being easy: when a user asks for something it should not invent, when a topic drifts outside its expertise, when the helpful answer and the correct answer pull in different directions. That is the moment guardrails earn their place. A rule like "be careful" gives the assistant nothing to hold on to. A rule like "Never guess a password" gives it a line it can actually follow.
This guide shows how to write rules that hold up: one per line, each one a piece of behaviour you can check in a finished reply, assembled with the free System Prompt Generator on Ovatly.
Contents
- Quick answer
- Where rules sit in a system prompt
- The checkable behaviour test
- Always-follow rules and output rules
- How to set rules, step by step
- Worked example: two rules that carry a support agent
- Limitations
- Common mistakes
- FAQs
- Conclusion
Quick answer
To set rules in a system prompt: write each rule as one line of checkable behaviour, something you could verify by reading a single reply. Keep the set short. Separate behaviour rules (what the assistant always does) from output rules (length, language, structure). Then assemble them with the System Prompt Generator: type the rules one per line, add the persona, expertise and output rules, pick plain text, Markdown or JSON, and copy the result. Finally, test the assistant with real questions, because a system prompt guides a model and cannot guarantee behaviour.
Where rules sit in a system prompt
A system prompt is the standing instruction given to a model before the conversation starts. It sets identity, expertise, rules and answer format for every reply that follows. The generator builds it from five fields: a persona in one phrase, an area of expertise, the always-follow rules, the output rules, and an optional example exchange.
Rules sit in the middle of that structure for a reason. The persona and expertise say what the assistant is for. The rules say what it does, every time, including the times when doing it is awkward. The output rules then shape how the answer looks. Read the rules section twice: it is the part real users will test.
The checkable behaviour test
A rule is checkable when a finished reply lets you answer yes or no: was this rule followed? Run every candidate rule through that test before it earns a line.
- "Never guess a password" passes. Either the reply invented a password or it did not.
- "Ask one question at a time" passes. You can count the questions in the reply.
- "Be helpful" fails. Two readers can read the same reply and disagree, which means the assistant can disagree too.
- "Use your judgement" fails in the same way. It hands the decision back to the model at exactly the moment you wanted a line drawn.
Failing rules are not useless sentiments; they are just not rules. If one matters to you, rewrite it until it names an action. "Be careful with account details" becomes checkable as "Never guess a password" or "Ask for the detail instead of assuming it". The rewrite is the real work of setting guardrails: the generator arranges your fields and never invents rules you did not write.
One rule per line is part of the same discipline. A line is one behaviour. Two behaviours crammed into one sentence hide the second one, and a paragraph of rules hides all of them. Lines are also what the tool expects: the rules field takes your rules one per line and numbers them in the output.
Always-follow rules and output rules
The generator keeps two kinds of rules in two sections, and the split is worth respecting. Always-follow rules govern behaviour: what the assistant does, refuses, asks or checks, in every reply. Output rules govern presentation: length, language and structure, such as answering in plain English or keeping answers under 120 words.
Mixing the two weakens both. A length limit buried among behaviour rules gets read as a suggestion about content. A behaviour rule written as a formatting note gets treated as style. Keep behaviour in the rules field and presentation in the output rules field.
How to set rules, step by step
- Open the System Prompt Generator and write the persona: who the assistant is, in one phrase.
- Add its area of expertise and its always-follow rules, one per line, each line passing the checkable behaviour test.
- Add output rules (length, language, structure) and optionally an example exchange that shows the rules being followed.
- Read the whole set once, looking for conflicts, then pick plain, Markdown or JSON and copy the generated system prompt.
Plain text suits most chat tools. Markdown helps long rule sets stay readable. JSON suits API integrations: the fields become an object under a system role, with quotes and newlines escaped by JSON.stringify, so it is safe to paste into an API payload.
Worked example: two rules that carry a support agent
The generator's own example is a support agent. Persona: "a concise technical support agent". Expertise: "home Wi-Fi routers". Its rules section holds just two lines: "Never guess a password" and "Ask one question at a time". Output rules: "Answer in plain English" and "Keep answers under 120 words". The plain output reads:
You are a concise technical support agent.
Your area of expertise is home Wi-Fi routers.
Rules you always follow:
1. Never guess a password
2. Ask one question at a time
How you format your answers:
1. Answer in plain English
2. Keep answers under 120 words
Two rules carry this assistant a long way. The first blocks the most damaging failure available to it: inventing a credential a frustrated user might actually try. The second controls the shape of every troubleshooting exchange, so the user is never buried under five questions at once. Both pass the checkable test: read any reply and you can say in seconds whether each rule held. That is the standard to hold your own rules to.
Limitations
A system prompt guides a model; it cannot guarantee behaviour. Rules steer replies, they do not lock them, so testing is part of the workflow rather than an optional extra. Assemble the prompt, then ask the assistant real questions, including the awkward ones your rules were written for, and read the replies against each rule line by line. A rule that a test reply breaks needs rewriting, usually into something more specific, not repeating at higher volume.
There is also a ceiling on what rules can settle in advance. Fewer, clearer rules work better than a long list. If two rules conflict, models resolve the conflict unpredictably, so a long list does not just dilute attention, it creates collisions you cannot foresee. Read the set as a whole before copying, and when two rules collide, decide yourself which one wins and rewrite the other to say so.
Common mistakes
- Writing wishes instead of behaviour. "Be careful" and "use your judgement" cannot be checked in a reply, so they cannot guide one either.
- Packing several behaviours into one line. One line, one behaviour. Hidden second behaviours get skipped.
- Conflicting rules. Two rules that pull in opposite directions get resolved unpredictably. Read the set as a whole and settle collisions yourself.
- Mixing behaviour and formatting. Length and language belong in output rules; what the assistant does belongs in the rules field.
- Expecting the generator to invent guardrails. Every rule in the output is a line you typed; the tool only numbers and arranges them.
- Skipping the test. A rule set that has never met a real question is a draft, however tidy it looks.
FAQs
What makes a rule checkable? You can point at a finished reply and say yes or no. 'Ask one question at a time' is checkable because you can count the questions. 'Be helpful' is not, because two readers can disagree about whether a reply was helpful.
How many rules should I add? Fewer, clearer rules work better than a long list. If two rules conflict, models resolve the conflict unpredictably, so read the set as a whole before copying.
Does the generator write rules for me? No. Every rule in the output is a line you typed; the tool only numbers and arranges them.
What is the difference between rules and output rules? Rules govern what the assistant does: its always-follow behaviour. Output rules govern how answers look: length, language and structure. The generator keeps them in separate sections.
Can rules guarantee the assistant never breaks them? No. A system prompt guides a model; it cannot guarantee behaviour. Test the result with real questions before relying on it, and tighten any rule that a test reply breaks.
Conclusion
Good guardrails are short, separate and checkable: one behaviour per line, each line verifiable in a single reply, behaviour kept apart from formatting, and the whole set read once for conflicts before it ships. The generator handles the assembly; the judgement about where the lines go is yours, and so is the testing that proves the lines hold. If you are still deciding what belongs on the system side at all, start with the companion guide on system prompt vs user prompt. For more guides like this, see the AI and Prompt Tools guides.