Context is not a facts section
Every agent prompt has a heading where facts go to live: Context, Background, Notes. Teams add to it for years and nobody deletes anything. The checker reads that heading as free English, and two claims about every tariff or most bills can disagree there with a green check on top.
TL;DR Under a Context, Background or Notes heading, typeglish reads all, some and most claims as prose and never compares them, so two that contradict each other check clean; put the facts that are true of everyone under a heading like Facts, and fetch the facts about one customer from a tool.
Juno is the chat assistant for Fernhill Energy, a household gas and electricity supplier. Its prompt has a Context section the pricing team started when every Fernhill tariff was a fixed deal, and the metering team added to it when most homes still sent no meter readings. Then Fernhill launched a variable tariff, the Tracker, and rolled out smart meters. Both teams added a line to Context. Neither deleted one.
§1Five lines, two of them wrong
# Role You are Juno, the chat assistant for Fernhill Energy. # Context All tariffs have a fixed price. Most bills use an estimated reading. The exit fee is 60 pounds. Some tariffs do not have a fixed price. Most bills do not use an estimated reading. # Constraints - WHEN the customer asks to switch tariff THEN MUST state the exit fee. - WHEN the customer disputes a bill THEN MUST ask for a meter reading. - MUST keep every reply to at most 3 sentences.
$ typeglish check juno-before.tg ✓ 1 file — 0 error, 0 warning, 0 info $ typeglish score juno-before.tg juno-before.tg — B (87/100) proven errors: none tiers: base+z3 planes runtime 99 (what the model reads) · hygiene 50 (source only) facets enforceability 100 x.21 · hardness 100 x.12 · directness 93 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 0 x.12 (hygiene) · style 100 x.08 · security 100 x.08 rules 3 of 3 rule-shaped lines read
These are not edge cases somebody invented for a demo. They are the most ordinary edit a CX prompt gets: a product changes, a team writes the new truth into the prompt, and the old truth stays because nobody is sure who owns it. Your prompt has authors you have never met is about exactly that drift. What is new here is where it hides.
§2What the model actually reads
Build the file and look at what ships. Context is a prose block, so the compiler joins its lines into one paragraph:
$ typeglish build juno-before.tg ✓ built .typeglish/dist/juno-before.txt ← juno-before.tg (0b16364b562d, full) $ cat .typeglish/dist/juno-before.txt # Role You are Juno, the chat assistant for Fernhill Energy. # Context All tariffs have a fixed price. Most bills use an estimated reading. The exit fee is 60 pounds. Some tariffs do not have a fixed price. Most bills do not use an estimated reading. # Constraints - WHEN the customer asks to switch tariff THEN MUST state the exit fee. - WHEN the customer disputes a bill THEN MUST ask for a meter reading. - MUST keep every reply to at most 3 sentences.
Now picture the chat. A customer on the Tracker asks whether there is a fee to switch. The first sentence of Context says every tariff is fixed, the switch rule says state the exit fee, and a fixed price is what an exit fee usually comes with. So Juno quotes 60 pounds to a customer whose tariff has none. Another customer says their bill looks too high; Juno has a fact that says most bills are estimated, and a fact that says most are not, and it picks one to frame the reply. Neither choice is a misreading. The prompt said both.
A heading is a type annotation. Context tells the checker the lines below it are prose, and prose is not compared.
§3Same lines, different heading
Change one word. Line 4 becomes # Facts, and nothing else moves.
$ typeglish check juno-facts.tg juno-facts.tg:5:1 error logic/quantifier Conflicts with line 8. Quantifier conflict — all tariff is "have a fixed price", but some tariff is not "have a fixed price". Both cannot hold. ↳ line 8: Some tariffs do not have a fixed price. juno-facts.tg:6:1 error logic/majority Conflicts with line 9. Majority conflict — most bill is "use an estimated reading" and most bill is not "use an estimated reading" can't both hold; each needs over half of "bill". ↳ line 9: Most bills do not use an estimated reading. juno-facts.tg:8:1 error logic/quantifier Conflicts with line 5. Quantifier conflict — all tariff is "have a fixed price", but some tariff is not "have a fixed price". Both cannot hold. ↳ line 5: All tariffs have a fixed price. juno-facts.tg:9:1 error logic/majority Conflicts with line 6. Majority conflict — most bill is "use an estimated reading" and most bill is not "use an estimated reading" can't both hold; each needs over half of "bill". ↳ line 6: Most bills use an estimated reading. ✗ 1 file — 4 error, 0 warning, 0 info $ typeglish score juno-facts.tg juno-facts.tg — F (67/100) proven errors — grade capped at F tiers: base+z3
logic/quantifier catches the all-versus-some pair. logic/majority catches the two most lines: over half of bills cannot be estimated and not estimated at once.The checker is not ignoring Context. It is reading it as the kind of text the heading promises. The language reference lists the prose blocks (Role, Persona, Context, Background, Examples and Notes) as places that expect free English. Some things are still proven there: a modal rule like MUST or NEVER is a rule wherever it sits, and so is a clash between two amounts. Add a second exit fee to the original Context section and the build stops:
$ typeglish check juno-fee.tg juno-fee.tg:7:1 error logic/measure Money conflict on exit fee — "exactly GBP 60" and "exactly GBP 75" cannot both hold. (with line 8) juno-fee.tg:8:1 error logic/measure Money conflict on exit fee — "exactly GBP 60" and "exactly GBP 75" cannot both hold. (with line 7) ✗ 1 file — 2 error, 0 warning, 0 info
So a fee, a time or a rule is safe in Context. A claim about all, some or most of something is not. That split is what makes this easy to miss: the parts of Context you have seen the checker catch are the parts it still catches.
Which headings count? We ran the original file with line 4 renamed seven ways. In typeglish 0.11.0 it is the first word of the heading that decides:
$ for h in "Context" "Background" "Notes" "Context and facts" "Business context" "Knowledge" "Facts"; do sed "s/^# Context/# $h/" juno-before.tg > sweep.tg; printf '# %-18s %s\n' "$h" "$(typeglish check sweep.tg 2>&1 | tail -1)"; done
# Context ✓ 1 file — 0 error, 0 warning, 0 info
# Background ✓ 1 file — 0 error, 0 warning, 0 info
# Notes ✓ 1 file — 0 error, 0 warning, 0 info
# Context and facts ✓ 1 file — 0 error, 0 warning, 0 info
# Business context ✗ 1 file — 4 error, 0 warning, 0 info
# Knowledge ✗ 1 file — 4 error, 0 warning, 0 info
# Facts ✗ 1 file — 4 error, 0 warning, 0 info
This refines something we wrote in Your headings decide which rules get checked: modal rules are proven under any heading, and that still holds. Quantified claims are the exception, because in a prose block they are read as description, not as claims to compare.
§4Write facts where they are checked
Moving the lines under # Facts is the first half. It turns the contradictions into errors; it does not decide which line is true. That is a question for the product, and the answer splits Juno’s facts in two.
- True of every customer. Some tariffs are not fixed. There is one exit fee. These go once, under a heading the checker compares.
- True of one customer. Whether this customer is on a fixed tariff, and whether their last bill was estimated. These are not facts the prompt can know. They come from the account, at runtime.
The two most bills lines fall in neither group, and the honest fix is to delete both. A base rate in a prompt is a prior about the customer in front of the agent; Most customers is not this customer walks through what that does to a billing dispute. Here is Juno with the facts split:
$TOOL get_account - description:: Look up the customer's account. Returns the tariff name, fixed or variable, and whether the last bill used an estimated reading. - input:: - account_number:: string: the account number printed on the bill. # Role @@ role: one sentence names the speaker, so every later "you" is Juno You are Juno, the chat assistant for Fernhill Energy. # Facts @@ tracker: the Tracker launch made the old "all tariffs are fixed" line false, so the fact is written the way it is true today Some tariffs do not have a fixed price. @@ exit_fee: one fee, one line; a second figure here is a logic/measure error wherever it sits The exit fee is 60 pounds. # Constraints @@ lookup: which tariff this customer is on is a fact about one account, so it comes from the tool - WHEN the customer asks to switch tariff THEN MUST call @[get_account]. @@ fee: only a fixed price carries the exit fee, and the tool says which one this customer has - IF @[get_account] returns fixed AND the customer asks to switch tariff THEN MUST state the exit fee. @@ dispute: a high bill is checked against the account, never against how most bills look - WHEN the customer disputes a bill THEN MUST call @[get_account]. @@ reply_length: three sentences is one screen of chat on a phone - MUST keep every reply to at most 3 sentences. $TEST tracker_switch - input:: I'm on the Tracker and want to switch to a fixed deal. Is there a fee to leave? - expect:: - calls get_account before it mentions any fee - at most 3 sentences $TEST high_bill - input:: My bill is way higher than last month, account 4471 0092. - expect:: - calls get_account before it explains the bill - matches /^(?![\s\S]*[Mm]ost bills)/ - at most 3 sentences
high_bill regex fails any reply that explains a bill by what most bills do, which is what the deleted base rate would have sounded like on the transcript.$ typeglish check juno.tg ✓ 1 file — 0 error, 0 warning, 0 info $ typeglish score juno.tg juno.tg — A (97/100) proven errors: none tiers: base+z3 planes runtime 96 (what the model reads) · hygiene 100 (source only) facets enforceability 100 x.21 · hardness 82 x.12 · directness 91 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 100 x.12 (hygiene) · style 100 x.08 · security 100 x.08 lever hardness 82/100 (up to +2 overall) — 1 soft statement: "some" on L12 — a permission or preference meant to stay soft keeps its word (and stays soft here); a rule meant to bind commits to MUST / NEVER / ALWAYS / REQUIRE / ENSURE; a hedge (try to, about, as needed) is deleted rules 4 of 4 rule-shaped lines read · 4/4 covered by $TEST $ typeglish test juno.tg --dry ✓ juno.tg coverage: 4/4 rules exercised · tracker_switch — "I'm on the Tracker and want to switch to a fixed deal. Is th" (not run) ✓ at most 3 sentences · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) · high_bill — "My bill is way higher than last month, account 4471 0092." (not run) ✓ matches /^(?![\s\S]*[Mm]ost bills)/ ✓ at most 3 sentences · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) ✓ 1 prompt — 0 failed $ typeglish build juno.tg ✓ built .typeglish/dist/juno.txt ← juno.tg (db1906c66ffa, full)
The payoff is the next edit. Somebody on the pricing team, reading an old slide deck, adds All tariffs have a fixed price. back under # Facts:
$ typeglish check juno-regress.tg juno-regress.tg:12:1 error logic/quantifier Conflicts with line 13. Quantifier conflict — some tariff is not "have a fixed price", but all tariff is "have a fixed price". Both cannot hold. ↳ line 13: All tariffs have a fixed price. juno-regress.tg:13:1 error logic/quantifier Conflicts with line 12. Quantifier conflict — some tariff is not "have a fixed price", but all tariff is "have a fixed price". Both cannot hold. ↳ line 12: Some tariffs do not have a fixed price. ✗ 1 file — 2 error, 0 warning, 0 info $ typeglish build juno-regress.tg typeglish build: juno-regress.tg refused — nothing written
# Context the same edit would have shipped. Under # Facts nothing is written until someone decides which line is true.One limit, so you know where the floor is. The quantifier check compares claims about a set with claims about the same set. It does not yet compare a set with one named member of it:
# Role You are Juno, the chat assistant for Fernhill Energy. # Facts All tariffs have a fixed price. The Tracker does not have a fixed price.
# Facts too. If the exception is a named product, write the general line as a some claim, or better, let the tool say which tariff is which, as juno.tg does.§5The Context audit
Every long-lived CX prompt has a section like Juno’s. Twenty minutes with it pays for itself the next time a product launches.
- Find the prose blocks. Every heading that starts with Context, Background, Notes, Persona or Examples. Those are the sections where a quantified claim goes unchecked.
- Grep them for counting words. all, every, no, none, some, most, only. Each hit is a claim about a set that nothing is comparing.
- Sort each hit by who it is true of. Every customer: move it under a facts heading. One customer: replace it with a tool or a variable the host passes in. Most customers: delete it, or move it to an
@@note where it explains a rule without being read as one. - Rename the section and rerun. Change the heading to
# Factsonce, before you edit anything else, and read whatcheckreports. It is the cheapest contradiction search you will run this quarter. - Test the customer the old fact was wrong about. One
$TESTper launch: the Tracker customer, the smart-meter customer, the new plan. They are the people a stale Context line answers incorrectly.
The habit underneath: a heading says what kind of text follows, so file facts under a heading that says they are facts. Context is for the paragraph that helps the model understand the business. Claims you need to be true belong where the checker holds them to it.
§6Common questions
- Why does my AI support agent give customers contradictory facts?
- Often because two background lines in the system prompt disagree and both ship. A line like all tariffs have a fixed price, written before a variable tariff launched, sits a few lines above some tariffs do not have a fixed price, and the model reads both as true and picks one per chat. Find the pair, delete the line that stopped being true, and put the survivor where a checker compares it.
- Does TypeGlish check the Context section of a system prompt?
- Partly. In typeglish 0.11.0 a heading that starts with Context, Background, Notes, Persona or Examples marks a prose block. Modal rules, times and money amounts there are still proven, but quantified claims such as all tariffs have a fixed price and some tariffs do not have a fixed price are not compared with each other. The same two lines under a Facts heading are a blocking logic/quantifier error.
- Where should facts go in an AI agent system prompt?
- Split them by who they are true of. A fact true of every customer goes once, under a heading the checker proves, such as Facts or Policies. A fact about one customer, like their tariff or whether their last bill was estimated, comes from a tool or a host variable at runtime. A statistic about most customers usually belongs in neither place.
- Can renaming a heading change what TypeGlish reports?
- Yes. The heading tells the checker what kind of text follows, so renaming Context to Facts, Knowledge or Policies can turn a clean file into one with blocking errors, and renaming the other way can hide them. Treat a heading change as a change to the prompt and rerun the check.
typeglish statements juno-before.tg --line 5 prints All tariffs have a fixed price back with 0 diagnostics; 0 relations. Under # Facts the same line shows 1 relations and lists line 8 as its related statement. A quantified fact with zero relations in a prose block is a fact nothing is checking. For the wider question of which lines in a prompt are claims rather than rules, and why the model cannot doubt them, see Your agent is certain because you said so.