← Tidelines/Best practices

Why your agent calls the customer sir

A support agent that calls a customer sir when they are not one is following its prompt: the tone section asked for sir or madam and left the agent to guess which from a first name. Here is the defect, and why the title belongs to the account, not the model.

by TypeGlish team6 min read#best-practices
A name is not a title.

TL;DR Your agent calls customers sir because the prompt asks for sir or madam and leaves the model to guess gender from a first name or a voice; ban both words, take the title from the account where the customer chose it, switch on it with one greeting per member, and save any correction the customer makes in the chat.

It is one of the most-screenshotted lines in customer service, and it is rarely a model bug. Somebody wrote formality into the prompt as two gendered words, and the agent did what the prompt asked: it looked at a first name, guessed, and committed. Twice, for politeness.

§1The symptom

An illustrative exchange, of the kind that turns up in a complaint inbox the week a chat assistant goes live:

the transcript - a claim update✗ wrong title
customer:  Hi, it's Sam Okafor. I sent the photos of the leak yesterday. Any news on my claim?
assistant: Thank you, sir. I can see the photos arrived and your claim is with a
           loss adjuster. Is there anything else I can help you with, sir?
customer:  I'm not a sir.
The claim answer was right. The customer will remember the other word.

Swap the details and it happens everywhere: a Jordan called madam, a Dr Patel called Mrs Patel, a widow called by a title she stopped using, a voice agent that hears a low voice and says sir. The customer did not ask to be gendered. The prompt asked the agent to do it for them.

§2The section that wrote it

Corrie Home Insurance sells policies online. Its support assistant’s tone section came from a brand guide written for a phone team, where staff could ask, or hear an answer:

naive.tg - the tone section, from the brand guide✗ D (63/100)
# Role
You are the support assistant for Corrie Home Insurance, a home insurer that sells policies online.

# Tone
Always address customers formally as sir or madam.
Use the customer's title and surname where possible, for example Mr Patel.
Be warm and respectful.
If unsure, use sir.
$ typeglish review naive.tg
naive.tg — D (63/100) → A (99) projected if every fix below lands  check: 0 error, 1 warning, 2 info  tiers: base+z3

  FIXES  ranked by projected gain
  +12  put a "@@ why" note above L2 L5 L6 L7 L8 — annotation 0 → 100
  +6   make L5 provable — one verb the checker knows, one object, or a bound (the rules table names each edit)
  +5   lead with a modal (MUST / NEVER / SHOULD) on L7 — 1 rule becomes visible to the checker
  +5   fix the 1 prompt/unmeasurable finding (L7) — A rule with no concrete, checkable action or bound.
  +3   commit the 1 soft statement ("where possible" on L6) to MUST / NEVER / ALWAYS / REQUIRE / ENSURE — or keep the word if it is a permission by design — up to hardness 100
  +2   give L7 an observable action or a bound ("at most 3 sentences")
  +2   fix the 1 typeglish/if-then finding (L8) — A conditional (IF / WHEN / UNLESS / WHILE / …) opened without its THEN — an ADVISORY by the owner’s ruling (2026-08,…
  +1   fix the 1 prompt/hedging finding (L6) — A hedge (try to, if possible) softens an instruction; commit to a modal.

  RULES  1 of 2 rule-shaped lines read · 1 not provable · 1 unmeasurable
    L5   ~ unprovable    Always address customers formally as sir or madam.
                         "address" is not a verb the checker knows → use a verb from the catalog (redirect, escalate, ask, cite …) or add a numeric bound
    L7   ~ unmeasurable  Be warm and respectful.
                         no observable action or bound, so nothing can check compliance → name a concrete action or a bound ("at most 3 sentences")

  FINDINGS
  naive.tg:6:38  info   prompt/hedging  Hedging — "where possible" turns this instruction into a suggestion the model may skip. Delete the hedge, or commit to a modal (MUST / NEVER / SHOULD).
  naive.tg:7:1  warn   prompt/unmeasurable  Unmeasurable rule — "be <quality>" names no observable action, so nothing can check compliance. Name a concrete action, or move it to a prose block (persona prose is allowed to be soft).
  naive.tg:8:1  info   typeglish/if-then  IF needs a THEN — write IF <condition> THEN <action>.

  TESTS  no $TEST cases — add one beside a rule; `test --dry` validates it offline
Four lines about formality. The checker finds two rule-shaped lines, reads one and cannot prove it, and the line that decides the outcome is not a rule to it at all.

Read it as the model does. Line 5 asks for sir or madam, and the checker reads it as a rule but cannot prove it: address is not a verb it knows. Line 6 offers the title and surname where possible, a hedge, and the model rarely has the title. Line 7 is a mood, and prompt/unmeasurable says so. Line 8 never reaches a THEN, so the checker does not read it as a rule. The model does: it is a default, and the default is sir.

Put the four together and the instruction is unambiguous. Pick one of two gendered words for every customer, from whatever evidence the conversation offers, and when the evidence runs out, pick the male one.

§3Every sir is a guess

This is the anti-pattern: a rule whose only inputs are facts the agent does not have. A first name does not carry a gender the model can read reliably. Sam, Alex, Jordan, Robin, Jean and thousands of names from outside the training set’s comfort zone do not resolve, and plenty that seem to resolve are wrong. A voice agent is worse off, guessing from pitch on a phone line. And sir and madam leave out every customer who is neither.

The phone team the brand guide was written for had a fix the chat agent lacks: a person can hear a correction and carry it for the rest of the call. The agent can too, but only if the prompt tells it to, and the prompt above tells it to guess first.

Formality does not need gender. Your customer already told you how they want to be addressed, in the title field of the form they filled in to buy the policy, and Mr, Mrs, Ms, Mx, Dr and no title at all are each a choice they made. The fix is to read that field instead of the name. The same move fixes the persona problems in Teardown: the persona sheet that gave your agent a dog: what the brand guide says about warmth stays in prose, and anything that depends on this customer comes from the account.

§4The title is a typed input

Declare the title as a closed set and switch on it, one greeting per member. The first draft is the one most teams write, and the checker refuses it:

titles.tg - one greeting per title, first draft✗ build refused
$REQUIRE variable title: one of Mr, Mrs, Ms, Mx, Dr, none
$REQUIRE variable first_name
$REQUIRE variable surname

# Role
You are the support assistant for Corrie Home Insurance, a home insurer that sells policies online.

# Address
$SWITCH ON @{title}
  - Mr:: Greet the customer as Mr @{surname}.
  - Mrs:: Greet the customer as Mrs @{surname}.
  - Ms:: Greet the customer as Ms @{surname}.
  - Dr:: Greet the customer as Dr @{surname}.
  - none:: Greet the customer as @{first_name}.
$ typeglish check titles.tg
titles.tg:9:1  error  structure/non-exhaustive-switch  @{title} can be mx, but no arm handles it — add a "- <member>::" row for each (or a deliberate "- otherwise::" fallback).
titles.tg:12:3  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.
titles.tg:14:3  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.

✗ 1 file — 1 error, 0 warning, 2 info
The domain lists Mx. Nobody wrote its arm. That is the customer the old prompt would have called sir.

structure/non-exhaustive-switch is the point of using a $SWITCH rather than a paragraph. Every member of the domain needs an arm, so the title somebody forgot, or the one a product team adds to the sign-up form next year, fails the build until it has a greeting. The trade-off between that and a catch-all arm is the subject of Bake-off: a catch-all arm vs. one arm per member; for forms of address, one arm per member is the safer choice, because a fallback is where sir tends to creep back in.

Then ban the two words outright, one per line, and give the customer the last say. A correction in the chat is newer than the account, so the agent saves it with a tool and the next conversation starts with it.

corrie.tg - forms of address, from the account✓ A (91/100)
$REQUIRE variable title: one of Mr, Mrs, Ms, Mx, Dr, none
$REQUIRE variable first_name
$REQUIRE variable surname

$TOOL save_form_of_address
  - description:: Save the title or name the customer asks to be called on their account, so the next conversation starts with it.
  - input::
    - form_of_address:: string: the title or name the customer asked for, in their words.

# Role
@@ role: a home insurer's support assistant; every later "you" is the agent
You are the support assistant for Corrie Home Insurance, a home insurer that sells policies online.

# Address
@@ title_from_account: the customer chose this title when they bought the policy; one arm per member, so a new title fails the build until it has a row
$SWITCH ON @{title}
  - Mr:: Greet the customer as Mr @{surname}.
  - Mrs:: Greet the customer as Mrs @{surname}.
  - Ms:: Greet the customer as Ms @{surname}.
  - Mx:: Greet the customer as Mx @{surname}.
  - Dr:: Greet the customer as Dr @{surname}.
  - none:: Greet the customer as @{first_name}.
@@ no_sir: sir is a guess about the customer's gender from a name or a voice
- NEVER say sir.
@@ no_madam: madam is the same guess
- NEVER say madam.
@@ customer_decides: the customer's own words beat the account and the brand guide
- IF the customer tells you what to call them THEN MUST call @[save_form_of_address].

$TEST corrected
  - input:: It's Mx Okafor, not Mr. Anyway, has my claim been approved?
  - expect::
    - calls save_form_of_address
    - matches /^(?![\s\S]*\b(sir|madam|ma'am)\b)/i

$TEST thanks
  - input:: Thanks, that's sorted. Have a good evening.
  - expect::
    - does not say sir
    - does not say madam
    - matches /^(?![\s\S]*\b(sir|madam|ma'am)\b)/i
tg review and test --dry - corrie.tg✓ 3/3 rules tested
$ typeglish review corrie.tg
corrie.tg — A (91/100) → A (92) projected if every fix below lands  check: 0 error, 0 warning, 2 info  tiers: base+z3

  FIXES  ranked by projected gain
  +1   fix the 2 prompt/unregistered-doer findings (L19 L22) — A bare generic doer (Users should ...) never enters the world model - the imperative or a definite party registers wh…

  RULES  3 of 9 rule-shaped lines read · 3/3 covered by $TEST
    L17  · arm           Mr:: Greet the customer as Mr @{surname}.
                         a $SWITCH / $IF arm body — selected at compile time; the checker does not read arm bodies as rules
    L18  · arm           Mrs:: Greet the customer as Mrs @{surname}.
                         a $SWITCH / $IF arm body — selected at compile time; the checker does not read arm bodies as rules
    L19  · arm           Ms:: Greet the customer as Ms @{surname}.
                         a $SWITCH / $IF arm body — selected at compile time; the checker does not read arm bodies as rules
    L20  · arm           Mx:: Greet the customer as Mx @{surname}.
                         a $SWITCH / $IF arm body — selected at compile time; the checker does not read arm bodies as rules
    L21  · arm           Dr:: Greet the customer as Dr @{surname}.
                         a $SWITCH / $IF arm body — selected at compile time; the checker does not read arm bodies as rules
    L22  · arm           none:: Greet the customer as @{first_name}.
                         a $SWITCH / $IF arm body — selected at compile time; the checker does not read arm bodies as rules

  FINDINGS
  corrie.tg:19:3  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.
  corrie.tg:22:3  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.

  TESTS  2 cases · 3/3 rules exercised

$ typeglish test corrie.tg --dry
✓ corrie.tg  coverage: 3/3 rules exercised
  · corrected — "It's Mx Okafor, not Mr. Anyway, has my claim been approved?" (not run)
      ✓ matches /^(?![\s\S]*\b(sir|madam|ma'am)\b)/i
      · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY)
  · thanks — "Thanks, that's sorted. Have a good evening." (not run)
      ✓ matches /^(?![\s\S]*\b(sir|madam|ma'am)\b)/i
      · rubric — 2 prose expectations, judged on a live run (needs ANTHROPIC_API_KEY)
✓ 1 prompt — 0 failed
From D to A. The six arm rows are chosen by the build from the title, not read as rules, which is why review counts 3 of 9 lines and enforceability sits at 67.

The grade is an A at 91, not 99, and the review says exactly why: the six greetings are arm bodies, selected from the title, and the checker does not read arm bodies as rules. That is the right trade. The greeting is not a rule the model weighs; it is a fact the host fills in. The two info lines on the Ms and none rows are style advisories worth one point between them. corrected is the customer from §1 putting it right, and its regex fails any reply that still says sir, madam or ma’am. thanks checks the sign-off, the place a habitual sir is most likely to come back, the same spot where Why your agent tells a grieving customer to have a great day found its misfire.

§5Common questions

Why does my chatbot call customers sir or madam?
Because the prompt tells it to address customers formally as sir or madam, and the only evidence it has is a first name or a voice. The model guesses a gender and commits. Remove both words from the prompt and take the form of address from the customer's account.
How should an AI support agent address customers?
By the title the customer chose on their account, with their surname, or by their first name when they chose no title. If the customer says what they want to be called, use that and save it so the next conversation starts with it.
Can TypeGlish catch a missing title in my agent's greeting rules?
Yes, if the title is a typed input. Declare it with REQUIRE variable title: one of Mr, Mrs, Ms, Mx, Dr, none and switch on it; a title with no arm is refused as structure/non-exhaustive-switch, so a forgotten Mx fails the build.
Is it OK to tell a voice agent to use sir and madam?
It is riskier than in chat, because the agent can only guess from how the caller sounds. Use the title from the account, or the caller's name, and ban sir and madam as two separate NEVER rules so each one is checked.
Field note

Before you write a tone section, ask whoever owns the sign-up form which titles it offers and whether no title is one of them. That list is your $REQUIRE domain, and if the form changes, the prompt should fail to build until the greeting does too. Then grep the prompt and the brand guide for sir, madam, ma’am, gentleman and lady: each one asks the agent to guess something the customer has already told you.

∿ washed up Nov 14, 2026 ∿