Chapter 7 · Constraints and positive framing#
The big idea#
Constraints keep an answer inside the lines: length, tone, words to avoid, facts to include. The trick is to say what you want, not only what you don’t. “Don’t use jargon” tells the model what to avoid but not what to do. “Use words a 12-year-old knows” gives it a target.
Everyday example: Telling a child “don’t run!” makes them stop but leaves them unsure what to do instead. “Walk beside me” tells them exactly. Instructions work best when they describe the behaviour you want.
In plain words
For each “don’t” in your prompt, write the opposite as a positive rule, and add a number when you can.
A picture#
Before and after#
Replies below are typical examples to show the difference. Your model will word things differently, so run the prompts yourself.
Example 1 · Tone and length#
Before
Explain how a VPN works. Don't be long, don't use jargon, don't ramble.
Typical reply
A VPN, or Virtual Private Network, creates an encrypted tunnel between your device and a remote server, masking your IP address and protecting your traffic from eavesdroppers. It uses protocols like OpenVPN or WireGuard... (still long, still jargon)
After
Explain how a VPN works using words a 12-year-old knows. Maximum 3 sentences. Use one everyday comparison.
Typical reply
A VPN is like sending your letters inside a locked box through a trusted friend's house. People along the way cannot read what you sent or see where you live. Only your friend knows, and they forward the letter for you.
Prompt checker (code/promptcheck.py, columns T C A F L E D):
before 1/7 [Y . . . . . .] missing: context, audience, format, limits, example, delimiters
after 3/7 [Y Y . . Y . .] missing: audience, format, example, delimiters
Why it works. Negative rules are vague and easy to break. Positive, countable rules (3 sentences, 12-year-old, one comparison) are easy to follow and to check.
Example 2 · Safe defaults#
Before
Write a reply to this angry customer. Don't admit fault. Don't promise anything. Don't be rude.
Typical reply
Dear Customer, We understand you are upset. We cannot admit fault or promise a refund, but we do take feedback seriously and will review your case. (cold and evasive)
After
Write a reply to this angry customer in a calm, respectful tone. Acknowledge their frustration in the first sentence, state what we will check (the delivery record), and say when they will hear from us (within 24 hours). Under 80 words.
Typical reply
I am sorry this has been so frustrating. I'm checking your delivery record now, and you will hear from me within 24 hours with exactly what happened and what we can do.
Prompt checker (code/promptcheck.py, columns T C A F L E D):
before 3/7 [Y Y Y . . . .] missing: format, limits, example, delimiters
after 5/7 [Y Y Y Y Y . .] missing: example, delimiters
Why it works. The first prompt lists fears. The second describes a good reply: acknowledge, commit to a check, give a time. The model can then write it.
Constraint checklist#
Length: words, sentences, bullets or paragraphs.
Tone: formal, friendly, neutral (and one example if it matters).
Must include: facts, keywords, a call to action.
Must avoid: only when truly necessary, and paired with an alternative.
Fallback: what to do when something is missing (“if the date is unknown, write ‘date unknown’”).
You can count some constraints in code:
reply = "A VPN is like a locked box. Nobody can read it on the way. Only your friend sees it."
sentences = [s for s in reply.split(".") if s.strip()]
print(len(sentences), "sentences,", len(reply.split()), "words")
3 sentences, 19 words
Rules of thumb#
Turn “don’t X” into “do Y”.
Prefer numbers to adjectives.
Always give a fallback for missing information.
Common mistakes#
Piling up ten rules that conflict with each other.
Using hard “never” rules the model cannot know how to apply.
Not checking the constraint afterwards (count the words).
Try it yourself#
Rewrite “Don’t make it boring.” as a positive rule.
Add a fallback to: “Extract the phone number from the text.”
Why might “never mention competitors” be hard to follow?
Answers
“Open with a surprising fact or question, and use one concrete example.”
“If there is no phone number, return ‘none’.”
The model may not know what counts as a competitor. List the names or say “mention only our own products”.
Next
Next: for problems with several steps, make the model show its working. Think step by step.