Your customer has a VAT number now
Halden opens trade accounts for restaurants in January, and the trade team’s notes go into the support prompt under a new heading. It checks clean at a B. It also leaves the agent two price rules it cannot both follow, and an offer of 30-day payment terms to anyone who says they run a cafe.
TL;DR When a consumer support agent starts serving business accounts, let the host pass the account type as a typed input, put every price, return and payment rule that differs into a section guarded on it, move invoices and terms into tools, and test the consumer who says they run a business.
Halden sells kitchen equipment online, pans and knives and blenders, to people who cook at home. Its chat assistant, Ada, handles orders and returns through a start_return tool. In January the shop opens Halden Trade for restaurants and cafes: prices without VAT, invoices paid on 30-day terms, and returns only for items that arrive faulty. The trade team writes it up in six lines and pastes it under the live prompt. Here are the eight checks for the pull request that gets Ada ready for her first business customer.
§1The trade team’s notes
$TOOL start_return - description:: Start a return for an item in an order. - input:: - order_id:: string: the order the item came from. # Role You are Ada, the support assistant for Halden, an online shop for kitchen equipment. # Context All prices include VAT. Customers can cancel any order within 14 days of delivery for a full refund. # Constraints - MUST keep every reply to at most 4 sentences. - WHEN a customer asks for a refund THEN MUST call @[start_return]. - MUST quote prices including VAT. # Trade accounts Restaurants and cafes can now open a Halden Trade account. Trade prices are shown excluding VAT. - ALWAYS quote trade prices excluding VAT. - Trade orders can only be returned if they arrive faulty. - Offer 30-day payment terms to trade customers. - MUST send a VAT invoice when a trade customer asks for one.
# Trade accounts has been live for a year. The section below it is the trade team’s notes, pasted as written.$ typeglish check before.tg before.tg:11:1 info prompt/unregistered-doer A bare generic doer never enters the world model - instruction to the agent, or background about users? Use the imperative if the agent acts, or a definite party ("The user should ...") to register the doer. before.tg:19:1 info prompt/unregistered-doer A bare generic doer never enters the world model - instruction to the agent, or background about users? Use the imperative if the agent acts, or a definite party ("The user should ...") to register the doer. before.tg:20:1 info prompt/agentless-passive The doer is deleted (agentless passive) - who performs this? Name the actor or use the imperative: "Verify the order." instead of "The order is verified." before.tg:22:1 info prompt/unparsed-rule Reads like a rule, but the rule reader cannot parse it as one, so it earns no Enforceability credit and no measurability check: no modal (MUST / NEVER / SHOULD) and "Trade" is not a verb the checker knows, so it reads as prose. Fix: lead with a modal, or start with a verb from the catalog (Escalate …, Ask …). before.tg:22:1 info prompt/agentless-passive The doer is deleted (agentless passive) - who performs this? Name the actor or use the imperative: "Verify the order." instead of "The order is verified." ✓ 1 file — 0 error, 0 warning, 5 info $ typeglish score before.tg before.tg — B (81/100) proven errors: none tiers: base+z3 planes runtime 91 (what the model reads) · hygiene 50 (source only) facets enforceability 88 x.21 · hardness 100 x.12 · directness 76 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 0 x.12 (hygiene) · style 75 x.08 · security 100 x.08 lever annotation 0/100 (up to +12 overall) — 12 statements without a @@ note (L7 L10 L11 L14 L15 L16 L19 L20 +4 more) — put a "@@ why" line directly above each rules 6 of 7 rule-shaped lines read · 1 not provable L22 ✗ invisible Trade orders can only be returned if they arrive faulty. no modal (MUST / NEVER / SHOULD) and "Trade" is not a verb the checker knows, so it reads as prose → lead with a modal, or start with a verb from the catalog (Escalate …, Ask …) L24 ~ unprovable MUST send a VAT invoice when a trade customer asks for one. the checker knows "send" but cannot prove this shape: it stops reading at "when" — the clause after it is not part of the provable action → if the clause is a condition, make it one: WHEN <clause> THEN MUST <verb> …; otherwise give it its own rule L11 prompt/unregistered-doer −0.25 A bare generic doer never enters the world model - instruction to the agent, o L19 prompt/unregistered-doer −0.25 A bare generic doer never enters the world model - instruction to the agent, o L20 prompt/agentless-passive −0.25 The doer is deleted (agentless passive) - who performs this? Name the actor or L22 prompt/agentless-passive −0.25 The doer is deleted (agentless passive) - who performs this? Name the actor or
A B, no errors, five info findings, and a rules table that names two lines. All of it is worth fixing. None of it touches the three problems that will cost Halden money in the first week.
Check 1: find every sentence that says all, any or every. All prices include VAT. and Customers can cancel any order within 14 days of delivery for a full refund. were true when every customer was a home cook. The new section makes both false for a trade account, and neither draws a finding about it: line 10 draws nothing, and line 11 only an info about its bare doer. The checker has no way to know that a trade price is a price. Search the live prompt for all, any, every and customers, and ask of each sentence whether it is still true for a restaurant.
Check 2: find the two rules that cannot both be followed. MUST quote prices including VAT. and ALWAYS quote trade prices excluding VAT. both apply when a trade buyer asks what the stockpot costs. Neither is flagged, because to the checker they are two obligations with different wording: including and excluding are different words, and trade prices is a different object from prices. Put the trade case into a condition and the conflict has a name.
You are Ada, the support assistant for Halden. # Constraints - MUST quote prices including VAT. - IF the customer has a trade account THEN NEVER quote prices including VAT.
$ typeglish check vat.tg vat.tg:4:1 error logic/contradiction Conflicts with line 5. Logical conflict — "quote prices including vat" is both required and forbidden. Keep one, or scope the two rules so they cannot both apply (IF <condition> THEN ...). ↳ line 5: - IF the customer has a trade account THEN NEVER quote prices including VAT. vat.tg:5:1 error logic/contradiction Conflicts with line 4. Logical conflict — "quote prices including vat" is both required and forbidden. Keep one, or scope the two rules so they cannot both apply (IF <condition> THEN ...). ↳ line 4: - MUST quote prices including VAT. ✗ 1 file — 2 error, 0 warning, 0 info
A trade account does not add rules to your prompt. It splits the ones you already have in two.
§2Who is on the chat
Check 3: let the host say which account it is. Line 23, Offer 30-day payment terms to trade customers., opens with a verb the checker knows, and the rules table counts it among the lines it reads. It is the most expensive line in the file, because nothing in the prompt says who a trade customer is. Ada has to decide from the conversation, and a home cook who types I run a cafe has said everything she has to go on. Whether the chat belongs to a trade account is a fact the account system already holds, so it arrives as one: $REQUIRE variable account: one of consumer, trade, filled by the host from the login. Why your agent takes the customer's word for your policy covers the general case.
Check 4: guard everything that differs on that one input. Put each account’s rules in its own section, <consumer when=@{account} is equal to consumer> and <trade when=@{account} is equal to trade>, facts included: Every consumer price includes VAT. goes in the first and Every trade price excludes VAT. in the second, each beside its own price rule. Because account is a closed set of two, the guards cannot both hold. Build with the input bound and each account gets its own artifact, so the two price rules are never in front of the model at the same time. The person returning it did not buy it uses the same shape for a gift’s buyer and recipient. This is the trade artifact, exactly as build wrote it:
<role> You are Ada, the support assistant for Halden, an online shop for kitchen equipment. </role> <constraints> - MUST keep every reply to at most 4 sentences. </constraints> <trade> Every trade price excludes VAT. A trade account pays each invoice within 30 days. - IF the customer reports a faulty item THEN MUST call start_return. - IF the customer wants to return an item that is not faulty THEN MUST call transfer_to_trade_team. - MUST quote every price excluding VAT. - WHEN the customer asks for a VAT invoice THEN MUST call send_vat_invoice. </trade>
§3Returns, invoices and terms
Check 5: give each account its own returns rule. Trade orders can only be returned if they arrive faulty. is invisible: no modal, a passive that deletes whoever does the returning, and a first word the checker does not know as a verb. Meanwhile the live refund rule sends every refund request to start_return. A consumer keeps that rule, plus the 14-day cancellation right UK shoppers have on orders made online, now stated as a fact about a consumer. A trade account gets two rules: a faulty item goes to start_return, and anything else goes to a transfer_to_trade_team tool, because a return of six chopping boards the restaurant over-ordered is a commercial decision, not a chat one.
Check 6: let the billing system write the invoice. MUST send a VAT invoice when a trade customer asks for one. is unprovable: the checker stops reading at when, so the condition is not part of the rule. Turn it round into WHEN the customer asks for a VAT invoice THEN MUST call @[send_vat_invoice]., with a tool that emails the invoice to the billing address on the account. An invoice is a tax document. Ada should never type one into the chat.
Check 7: write payment terms as a fact, and ban the offer for consumers. Thirty days is a term of the trade account, not something Ada extends, so it goes in the trade section as A trade account pays each invoice within 30 days., which she can explain and cannot change. Any request to change it goes to the trade team, and the tool description says so. The consumer section gets the line the old prompt was missing: NEVER offer payment terms.
$REQUIRE variable account: one of consumer, trade $TOOL start_return - description:: Start a return for an item in an order and refund the payment. - input:: - order_id:: string: the order the item came from. $TOOL send_vat_invoice - description:: Email a VAT invoice for an order to the billing address on the trade account. - input:: - order_id:: string: the order the invoice is for. $TOOL transfer_to_trade_team - description:: Hand the conversation to the Halden Trade team, who decide returns of items that are not faulty and any change to payment terms. - input:: - summary:: string: what the customer wants, in one sentence. <role> @@ role: one sentence names the speaker, so every later "you" is the agent You are Ada, the support assistant for Halden, an online shop for kitchen equipment. </role> <constraints> @@ brevity: a chat bubble, not an email - MUST keep every reply to at most 4 sentences. </constraints> <consumer when=@{account} is equal to consumer> @@ consumer_vat: the website shows consumer prices with VAT in them Every consumer price includes VAT. @@ consumer_cancel: the statutory cooling-off period for orders made online A consumer can cancel an order within 14 days of delivery. @@ consumer_refund: a consumer refund goes back to the card - WHEN the customer asks for a refund THEN MUST call @[start_return]. @@ consumer_price: the number the customer sees at checkout - MUST quote every price including VAT. @@ consumer_terms: a cafe owner on a personal account still pays at checkout - NEVER offer payment terms. </consumer> <trade when=@{account} is equal to trade> @@ trade_vat: a business reclaims VAT, so trade prices leave it out Every trade price excludes VAT. @@ trade_terms_fact: the agent can explain the terms; it cannot change them A trade account pays each invoice within 30 days. @@ trade_faulty: a faulty item comes back on any account - IF the customer reports a faulty item THEN MUST call @[start_return]. @@ trade_not_faulty: the trade team decides every other return - IF the customer wants to return an item that is not faulty THEN MUST call @[transfer_to_trade_team]. @@ trade_price: the number on the trade price list - MUST quote every price excluding VAT. @@ trade_invoice: the invoice comes from the billing system, never from the chat - WHEN the customer asks for a VAT invoice THEN MUST call @[send_vat_invoice]. </trade> $TEST consumer_says_trade - input:: I run a cafe and I'm buying a coffee grinder. Can I pay on 30-day terms? - expect:: - at most 4 sentences - does not offer payment terms - quotes every price including VAT $TEST consumer_refund - input:: The blender I bought last week stopped working. I'd like a refund. - expect:: - calls start_return $TEST trade_price - input:: How much is the 20-litre stockpot on our account? - expect:: - matches /ex(cluding|\.)? VAT/i - quotes every price excluding VAT $TEST trade_change_of_mind - input:: We ordered six chopping boards for the new site but only need four. Can we send two back? - expect:: - calls transfer_to_trade_team $TEST trade_faulty - input:: One of the induction hobs on order HT-5520 arrived with a cracked glass top. - expect:: - calls start_return $TEST trade_invoice - input:: Our accountant needs a VAT invoice for order HT-5518. - expect:: - calls send_vat_invoice
§4Test both accounts
Check 8: test the consumer who says they are a business. consumer_says_trade is the cafe owner on a personal account asking for 30-day terms: the reply must not offer them, and must quote the grinder with VAT in it. trade_price carries a deterministic assert, matches /ex(cluding|\.)? VAT/i, that fails any trade price quoted without saying it excludes VAT. The other four are one per rule that moved: the consumer refund, the faulty hob, the over-ordered chopping boards, and the accountant who wants an invoice.
$ typeglish check ada.tg ✓ 1 file — 0 error, 0 warning, 0 info $ typeglish score ada.tg ada.tg — A (99/100) proven errors: none tiers: base+z3 planes runtime 99 (what the model reads) · hygiene 100 (source only) facets enforceability 100 x.21 · hardness 100 x.12 · directness 90 x.08 · consistency 100 x.17 · structure 100 x.12 (hygiene) · annotation 100 x.12 (hygiene) · style 100 x.08 · security 100 x.08 rules 8 of 8 rule-shaped lines read · 8/8 covered by $TEST $ typeglish test ada.tg --dry ✓ ada.tg coverage: 8/8 rules exercised · consumer_says_trade — "I run a cafe and I'm buying a coffee grinder. Can I pay on 3" (not run) ✓ at most 4 sentences · rubric — 2 prose expectations, judged on a live run (needs ANTHROPIC_API_KEY) · consumer_refund — "The blender I bought last week stopped working. I'd like a r" (not run) · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) · trade_price — "How much is the 20-litre stockpot on our account?" (not run) ✓ matches /ex(cluding|\.)? VAT/i · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) · trade_change_of_mind — "We ordered six chopping boards for the new site but only nee" (not run) · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) · trade_faulty — "One of the induction hobs on order HT-5520 arrived with a cr" (not run) · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) · trade_invoice — "Our accountant needs a VAT invoice for order HT-5518." (not run) · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY) ✓ 1 prompt — 0 failed $ typeglish build ada.tg --vars '{"account":"trade"}' ✓ built .typeglish/dist/ada.txt ← ada.tg (dcb9c308b674, full) $ typeglish build ada.tg --vars '{"account":"consumer"}' ✓ built .typeglish/dist/ada.txt ← ada.tg (60589ba7b2fd, full)
matches and sentence-count asserts run on every reply with no model judging them; the rest are judged on a live run.One case the suite leaves to you: the sole trader who owns a cafe and also cooks at home, with both kinds of account under one email address. Which account the host passes when that person opens the chat is a decision for the trade team and whoever owns the login. Make it in the host, and give it a test.
§5Common questions
- How do I add business customers to my AI support agent?
- Let the host pass the account type to the agent as a typed input, such as one of consumer or trade, and put every rule that differs between the two into a section guarded on that input. Prices, returns, invoices and payment terms usually all differ, so test each account separately.
- Should my chatbot quote prices with or without VAT?
- Quote consumer prices including VAT and trade prices excluding it, and decide which applies from the account, never from what the customer says. Two unguarded rules, one for each, both apply to every chat and leave the model to choose.
- Can a customer get trade terms by telling the chatbot they run a business?
- Only if your prompt lets the model decide who is a trade customer. Make the account type an input the host fills from the account itself, and add a test where a consumer says they run a cafe and asks for payment terms.
- Why didn't TypeGlish flag my including VAT and excluding VAT rules?
- Because they are two obligations with different wording, not one action that is both required and forbidden. Scope one of them, such as IF the customer has a trade account THEN NEVER quote prices including VAT, and the conflict becomes a logic/contradiction error.
Before trade accounts launch, list every rule and fact in the live prompt that mentions a price, a refund, a deadline or a payment, and ask whether it is still true for a business. Each one that is not belongs in a section guarded by account, and each new section deserves a test from the customer it protects. The two builds here are dcb9c308b674 for trade and 60589ba7b2fd for consumers; when somebody asks in March why a restaurant was quoted a price with VAT in it, those hashes say which prompt it was talking to. Two VAT rules that never meet in the same artifact are one way to keep a pair of numbers apart; Bake-off: the number in the prompt vs. the number at runtime covers the other.