> Markdown rendition of https://typeglish.dev/blog/teardown-age-check-block ("Teardown: the age-check block from legal - Tidelines"). Canonical page: https://typeglish.dev/blog/teardown-age-check-block · All pages: https://typeglish.dev/llms.txt

[← Tidelines](https://typeglish.dev/blog)/ Teardowns Nov 10, 2026

# Teardown: the age-check block from legal

Nine lines from the legal team, pasted into a grocery delivery agent the week the shop started selling wine and kitchen knives. One turns a door policy into a second minimum age. One quietly cancels a delivery rule from last spring. And four are about a doorstep the chat will never see.

by **TypeGlish team** 8 min read #teardowns

Have your ID ready.

**TL;DR** An age-check block for a delivery agent usually writes the driver's Challenge 25 policy as a second minimum age and bans the safe place an older delivery rule still offers, so keep the age check at the door as a fact about the driver, let the host flag a basket with alcohol or knives, and put the safe-place rule in a `$IF` chain on that flag.

Age-restricted products change one thing about a delivery: somebody old enough has to be there to take it, holding ID. Legal knows the law and the shop's policy, and writes a block that reads like the policy page. The chat agent cannot check anyone's age, and it never meets the customer at the door. What it can do is set the customer's expectations before the van arrives, and not promise anything the driver will have to take back.

## §1 The block, as pasted

Thistle Grocer delivers groceries in one-hour slots and answers chat with an AI assistant called Tilly. This month it added wine, beer and a range of kitchen knives, all of which in the UK can only be sold to someone aged 18 or over. Here is the prompt with legal's block in place: the role, a delivery rule written in the spring, and the nine new lines.

age.tg - the role, the spring delivery rule, and the block from legal ✗ C (68/100)

```typeglish
# Role
You are Tilly, the chat assistant for Thistle Grocer, an online grocery delivery service.

# Delivery
- IF the customer will be out THEN offer to leave the order in a safe place.

# Age-restricted items
Alcohol and knives are age-restricted products.
Customers must be 18 or over to buy age-restricted products.
We operate a Challenge 25 policy.
The driver will ask for photo ID if the customer looks under 25.
Never deliver age-restricted products to anyone under 18.
If no valid ID is shown, the age-restricted items will be removed from the order and refunded.
Always remind customers that ID may be required.
Never accept a photo of an ID in chat.
Age-restricted items cannot be left in a safe place.
```

tg review - age.tg ✗ 4 of 5 rules unprovable

```
$ npx typeglish review age.tg
age.tg — C (68/100) → A (100) projected if every fix below lands  check: 0 error, 1 warning, 6 info  tiers: base+z3

  FIXES  ranked by projected gain
  +12  put a "@@ why" note above L2 L5 L8 L9 L10 L11 L12 L13 +3 more — annotation 0 → 100
  +6   make L9 L12 L14 L15 provable — one verb the checker knows, one object, or a bound (the rules table names each edit)
  +3   use the imperative or a named doer on L13 L14 L16 — up to directness 100
  +2   fix the 1 prompt/unmeasurable finding (L9) — A rule with no concrete, checkable action or bound.
  +2   put the modal after THEN on L5 — 1 rule becomes visible to the checker
  +2   commit the 1 soft statement ("may" on L14) to MUST / NEVER / ALWAYS / REQUIRE / ENSURE — or keep the word if it is a permission by design — up to hardness 100
  +2   fix the 3 prompt/agentless-passive findings (L13 L14 L16) — The doer is deleted (agentless passive) or demoted to a by-phrase - name the actor or use the imperative.
  +1   fix the 1 typeglish/if-then finding (L13) — A conditional (IF / WHEN / UNLESS / WHILE / …) opened without its THEN — an ADVISORY by the owner’s ruling (2026-08,…
  +1   give L9 an observable action or a bound ("at most 3 sentences")
  +1   fix the 1 prompt/unregistered-doer finding (L9) — A bare generic doer (Users should ...) never enters the world model - the imperative or a definite party registers wh…

  RULES  4 of 5 rule-shaped lines read · 4 not provable · 1 unmeasurable
    L5   ✗ invisible     IF the customer will be out THEN offer to leave the order in a safe place.
                         the branch after THEN ("offer to leave the order in a safe place") has no modal, and the checker knows "offer" but cannot prove this shape: the "to …" phrase runs past five words, so the line reads as prose → lead the branch with a modal (THEN MUST / NEVER / SHOULD …) and shorten the phrase — the tool call is the rule, the reason for it belongs in a @@ note — or split the rule
    L9   ~ unmeasurable  Customers must be 18 or over to buy age-restricted products.
                         no observable action or bound, so nothing can check compliance → name a concrete action or a bound ("at most 3 sentences")
    L12  ~ unprovable    Never deliver age-restricted products to anyone under 18.
                         "deliver" is not a verb the checker knows → use a verb from the catalog (redirect, escalate, ask, cite …) or add a numeric bound
    L14  ~ unprovable    Always remind customers that ID may be required.
                         the checker knows "remind" but cannot prove this shape: it stops reading at "that" — 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
    L15  ~ unprovable    Never accept a photo of an ID in chat.
                         the checker knows "accept" but cannot prove this shape: the object runs past six words → name the object in fewer words, or split the rule

  FINDINGS
  age.tg:5: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: the branch after THEN ("offer to leave the order in a safe place") has no modal, and the checker knows "offer" but cannot prove this shape: the "to …" phrase runs past five words, so the line reads as prose. Fix: lead the branch with a modal (THEN MUST / NEVER / SHOULD …) and shorten the phrase — the tool call is the rule, the reason for it belongs in a @@ note — or split the rule.
  age.tg:9:1  warn   prompt/unmeasurable  Unmeasurable rule — no observable action or bound, so nothing can check compliance. Name a concrete action ("cite the source", "at most 3 sentences") or move it to a prose block.
  age.tg:9: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.
  age.tg:13:1  info   typeglish/if-then  IF needs a THEN — write IF <condition> THEN <action>.
  age.tg:13: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."
  age.tg:14: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."
  age.tg:16: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."

  TESTS  no $TEST cases — add one beside a rule; `test --dry` validates it offline
```

A C with no errors, so the build goes through. Line 5, the spring rule, is invisible to the checker altogether. Of the four rule-shaped lines in legal's block that it does read, none is provable. Lines 10, 11 and 16 carry the most risk and get almost nothing: no finding at all on 10 and 11, a passive on 16.

The review is a reading list, and it sorts the block better than a skim would. Lines 8 and 10 are statements of policy. Lines 9 and 12 are about the customer and the driver, people who are not reading this prompt. Lines 13, 14 and 16 are passives with nobody doing anything. Of the three lines addressed to the agent, 12, 14 and 15, line 15 is the one legal got most nearly right.

## §2 Lines 9 to 11: two ages, one of them a door policy

Line 9 sets the legal minimum: 18. Lines 10 and 11 describe Challenge 25, the common retail policy where staff ask for ID from anyone who looks under 25, so that nobody has to guess whether a customer is 17 or 19. It is a policy about *when to ask*, applied by a person looking at another person. It does not change who may buy.

The checker says almost nothing about these three lines, because two of them are prose and the third has no act in it: line 9 is flagged unmeasurable, with a generic doer. That silence matters, because the agent reads them all as instructions anyway. Write down what a model could take the trio to mean, the customer must be 18, and the customer must be 25, and the checker gets something to compare:

challenge.tg - the legal age and Challenge 25, both as ages ✗ build refused

```typeglish
# Role
You are Tilly, the chat assistant for Thistle Grocer, an online grocery delivery service.

# Age-restricted items
- The customer must be at least 18 years old.
- The customer must be at least 25 years old.
```

```
$ npx typeglish check challenge.tg
challenge.tg:5:1  error  logic/quantifier-strength  Conflicts with line 6. One rule, two counts — "be at least 25 years old." already sits inside "be at least 18 years old."; the looser bound is dead weight. Keep the tighter line.
              ↳ line 6: - The customer must be at least 25 years old.
challenge.tg:5:1  error  logic/time-strength  Conflicts with line 6. One bound per slot — "at least 25 years" already entails "at least 18 years"; the looser rule on "customer · be" is dead weight. Keep one.
              ↳ line 6: - The customer must be at least 25 years old.
challenge.tg:6:1  error  logic/quantifier-strength  Conflicts with line 5. One rule, two counts — "be at least 25 years old." already sits inside "be at least 18 years old."; the looser bound is dead weight. Keep the tighter line.
              ↳ line 5: - The customer must be at least 18 years old.
challenge.tg:6:1  error  logic/time-strength  Conflicts with line 5. One bound per slot — "at least 25 years" already entails "at least 18 years"; the looser rule on "customer · be" is dead weight. Keep one.
              ↳ line 5: - The customer must be at least 18 years old.

✗ 1 file — 4 error, 0 warning, 0 info
```

Refused at F (59/100). The checker reads the years as a bound on the customer and finds the second line swallows the first: at least 25 already means at least 18, so the 18 is dead weight. That is the reading you are afraid of. A 22-year-old asking whether they can order a bottle of wine hears that the minimum is 25.

The refusal is the right verdict on a wrong sentence. Nobody at Thistle Grocer meant to raise the age to 25, but a second number on the same subject is a second minimum, to the checker and to the model. Challenge 25 belongs in the prompt only as what it is: a fact about what the driver does at the door. Then the agent can explain it (*the driver may ask to see ID, so have it ready*) without ever ruling on anybody's age.

## §3 Lines 5 and 16: the safe place and the bottle of wine

Line 5 is from the spring, when the delivery team added safe places: if the customer will be out, offer to leave the order in the porch, the shed, or with a neighbour. It works well, and the checker cannot see it, because the branch after THEN has no modal. Line 16, eleven lines further down, says age-restricted items cannot be left in a safe place. A passive, with nobody doing the not-leaving.

So the agent holds two instructions, and the customer who triggers both is the ordinary one: a weekly shop with a bottle of wine in it, and a customer who will be at work. Written as plain rules, the pair is a contradiction, and the build refuses it:

safe.tg - the spring rule and legal's rule, as rules ✗ logic/contradiction

```typeglish
# Role
You are Tilly, the chat assistant for Thistle Grocer, an online grocery delivery service.

# Delivery
- WHEN the customer will be out THEN MUST offer a safe place.
- NEVER offer a safe place.
```

```
$ npx typeglish check safe.tg
safe.tg:5:1  error  logic/contradiction  Conflicts with line 6. Logical conflict — "offer a safe place" is both required and forbidden. Keep one, or scope the two rules so they cannot both apply (IF <condition> THEN ...).
         ↳ line 6: - NEVER offer a safe place.
safe.tg:6:1  error  logic/contradiction  Conflicts with line 5. Logical conflict — "offer a safe place" is both required and forbidden. Keep one, or scope the two rules so they cannot both apply (IF <condition> THEN ...).
         ↳ line 5: - WHEN the customer will be out THEN MUST offer a safe place.

✗ 1 file — 2 error, 0 warning, 0 info
```

Refused at F (70/100). An unscoped NEVER beats the scoped MUST on the same act, which is what legal wanted for wine and nobody wanted for a box of eggs.

The tempting fix is to scope the ban by its object, the way legal's sentence did. It checks clean, and that is the trap:

safe-scoped.tg - the ban narrowed to alcohol ✓ clean, B (87/100)

```typeglish
# Role
You are Tilly, the chat assistant for Thistle Grocer, an online grocery delivery service.

# Delivery
- WHEN the customer will be out THEN MUST offer a safe place.
- NEVER offer a safe place for alcohol.
```

```
$ npx typeglish check safe-scoped.tg --strict
✓ 1 file — 0 error, 0 warning, 0 info
```

*A safe place for alcohol* and *a safe place* are two different object phrases, so the checker compares nothing. The order is one delivery. If it has a bottle of wine in it, the safe place is off for the whole order, and the agent still has a rule offering one to anyone who will be out. Clean here means unchecked, the same trap as the refund pair in [Teardown: the marketplace block from the partnerships team](https://typeglish.dev/blog/teardown-marketplace-block).

The honest version of the policy has a condition the agent cannot see from the chat, which is what is in the basket. The host can: it knows the customer's next delivery. So the host passes a flag, and the safe-place rule becomes two arms of a `$IF` chain. The compiler keeps one arm, and the model never reads both. It is the same move as letting the host say which account is on the chat in [Your customer has a VAT number now](https://typeglish.dev/blog/trade-accounts-checklist).

> The chat cannot see the customer's face or the basket. Give the face to the driver and the basket to the host.

## §4 Lines 12 to 15: the door belongs to the driver

*Never deliver age-restricted products to anyone under 18.* It is the line that matters most legally, and it is not a rule the agent can follow: the agent does not deliver anything. The checker's note, that *deliver* is not a verb it knows, is incidental. The real problem is the subject. The driver delivers, the driver sees the customer, and the driver's handheld records the ID check. This is a line for the driver's app, and in the agent's prompt it is [Half your rules are about somebody else](https://typeglish.dev/blog/one-subject-per-prompt) with a legal penalty attached.

Line 13 is what happens when nobody can show ID: the items are removed and refunded. Two passives, and the agent needs to know who does what, because a customer will ask. Said with its doers, it becomes a fact the agent can repeat: the driver takes the items back, and the shop refunds them.

Line 14 asks the agent to remind customers that ID *may* be required. The checker flags the hedge and stops reading at *that*. Both point at the same fix. Reminding everyone is noise in a chat about a missing yoghurt; reminding the customer whose next delivery has wine in it is the most useful thing the agent can say. With the host's flag, the reminder becomes a plain MUST inside the restricted arm, for exactly the deliveries that need it.

Line 15 is the one to keep. A customer who wants to skip the doorstep check will offer to send a photo of their licence, and accepting it proves nothing about who opens the door, while putting a copy of an identity document into the chat logs. The checker reads the line but cannot prove it, because the object runs past six words. Drop *in chat*, which the agent already knows, and it reads: *NEVER accept a photo of an ID.*

## §5 The rebuild

The age check lives with the driver, as context the agent can explain. The host flags a delivery with alcohol or knives. The safe-place rule and the ID reminder sit in a `$IF` chain on that flag, and the ID-photo ban applies to every chat:

thistle.tg - the age-check block rebuilt ✓ A (100/100)

```typeglish
$REQUIRE variable restricted_items: boolean default to false

$TOOL lookup_order
  - description:: Look up an order, including its delivery slot and whether it contains alcohol or knives.
  - input::
    - order_number:: string: the order number.

# Role
@@ role: one chat assistant for a grocery delivery service that sells alcohol and knives
You are Tilly, the chat assistant for Thistle Grocer, an online grocery delivery service.

# Context
@@ challenge_25: the age check happens at the door, where someone can see the customer
The driver asks for photo ID when the customer looks under 25.
@@ no_id: the driver removes the items and the shop refunds them, so the agent can explain the outcome without deciding it
The driver takes back alcohol and knives when nobody shows valid photo ID, and Thistle Grocer refunds them.

# Delivery
@@ lookup: never guess what is in an order from the conversation
- WHEN the customer gives an order number THEN MUST call @[lookup_order].
@@ safe_place: the host sets restricted_items from the next delivery, because an order with alcohol or knives needs an adult at the door
$IF @{restricted_items} is equal to true:
  - MUST tell the customer to have photo ID ready.
  - NEVER offer a safe place.
$ELSE:
  - WHEN the customer will be out THEN MUST offer a safe place.
@@ id_photo: an ID photo in chat proves nothing about who opens the door, and it is personal data we do not need
- NEVER accept a photo of an ID.

$TEST wine_doorstep
  - input:: I'm at work until six. Can you leave my order on the doorstep? It has the wine in it.
  - expect::
    - does not offer a safe place
    - tells the customer to have photo ID ready
    - matches /\bID\b/

$TEST licence_photo
  - input:: Can I send you a photo of my driving licence now so the driver doesn't have to check?
  - expect::
    - does not accept a photo of an ID

$TEST order_lookup
  - input:: Is my order TG-48213 still coming tomorrow morning?
  - expect::
    - calls lookup_order
```

tg check, score, test --dry and build --vars - thistle.tg

```
$ npx typeglish check thistle.tg
✓ 1 file — 0 error, 0 warning, 0 info

$ npx typeglish score thistle.tg
thistle.tg — A (100/100)  proven errors: none  tiers: base+z3
  planes  runtime 100 (what the model reads) · hygiene 100 (source only)
  facets  enforceability 100 x.21 · hardness 100 x.12 · directness 96 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   5 of 5 rule-shaped lines read · 5/5 covered by $TEST

$ npx typeglish test thistle.tg --dry
✓ thistle.tg  coverage: 5/5 rules exercised
  · wine_doorstep — "I'm at work until six. Can you leave my order on the doorste" (not run)
      ✓ matches /\bID\b/
      · rubric — 2 prose expectations, judged on a live run (needs ANTHROPIC_API_KEY)
  · licence_photo — "Can I send you a photo of my driving licence now so the driv" (not run)
      · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY)
  · order_lookup — "Is my order TG-48213 still coming tomorrow morning?" (not run)
      · rubric — 1 prose expectation, judged on a live run (needs ANTHROPIC_API_KEY)
✓ 1 prompt — 0 failed

$ npx typeglish build thistle.tg --vars '{"restricted_items":true}'
✓ built .typeglish/dist/thistle.txt ← thistle.tg (2b3f4c2ea195, full)

$ grep -n "safe place\|photo ID" .typeglish/dist/thistle.txt
5:The driver asks for photo ID when the customer looks under 25. The driver takes back alcohol and knives when nobody shows valid photo ID, and Thistle Grocer refunds them.
9:- MUST tell the customer to have photo ID ready.
10:- NEVER offer a safe place.

$ npx typeglish build thistle.tg --vars '{"restricted_items":false}'
✓ built .typeglish/dist/thistle.txt ← thistle.tg (8941f3cbd534, full)

$ grep -n "safe place\|photo ID" .typeglish/dist/thistle.txt
5:The driver asks for photo ID when the customer looks under 25. The driver takes back alcohol and knives when nobody shows valid photo ID, and Thistle Grocer refunds them.
9:- WHEN the customer will be out THEN MUST offer a safe place.
```

From C (68) to A (100), five of five rules read, every rule exercised by a case. Each build carries one safe-place line: the restricted artifact forbids it and asks for ID, the ordinary one offers it. The two context lines ship in both, because what the driver does at the door is true either way.

The chain also defends itself. When the delivery team next touches the prompt and pastes the spring rule back in above the ID-photo line, outside the chain, the build is refused, and the message names the case where the two meet:

tg check - thistle.tg plus the spring rule, unguarded ✗ logic/contradiction

```
$ npx typeglish check thistle-edit.tg
thistle-edit.tg:24:3  error  logic/contradiction  Conflicts with line 27. Logical conflict — "offer a safe place" is both required and forbidden. Keep one, or scope the two rules so they cannot both apply (IF <condition> THEN ...). A single serve can hold both - e.g. when restricted_items = true.
                 ↳ line 27: - WHEN the customer will be out THEN MUST offer a safe place.
thistle-edit.tg:26:3  warn   clarity/duplicate  Duplicate rule — "offer safe place" is required in 2 places (also line 27). State it once and reference it.
thistle-edit.tg:27:1  error  logic/contradiction  Conflicts with line 24. Logical conflict — "offer a safe place" is both required and forbidden. Keep one, or scope the two rules so they cannot both apply (IF <condition> THEN ...). A single serve can hold both - e.g. when restricted_items = true.
                 ↳ line 24: - NEVER offer a safe place.
thistle-edit.tg:27:1  warn   clarity/duplicate  Duplicate rule — "offer safe place" is required in 2 places (also line 26). State it once and reference it.

✗ 1 file — 2 error, 2 warning, 0 info
```

Refused at F (81/100). *A single serve can hold both - e.g. when restricted_items = true* is the bottle of wine and the customer at work, found by the checker rather than by a driver standing at a locked door.

What left the prompt matters as much as what stayed. The second minimum age went, because there is only one. The driver's rules went to the driver, apart from a sentence the agent can repeat. The hedged reminder became a firm one, sent only to the customers it is for. And legal's one good rule, no ID photos in chat, stayed, a few words shorter.

## §6 Common questions

**How do I add alcohol to my grocery delivery chatbot?**

Treat the age check as something that happens at the door, not in the chat. Let the host tell the agent whether the next delivery has alcohol or knives, and in that case have the agent tell the customer to have photo ID ready and never offer a safe place. The driver checks age; the agent sets expectations.

**Can my AI agent verify a customer's age in chat?**

No. A chat agent cannot see the customer, and a photo of an ID sent in chat proves nothing about who opens the door. Keep the age check with the driver at handover, and give the agent a rule never to accept a photo of an ID.

**Should Challenge 25 go in my agent's system prompt?**

Only as a fact about what the driver does, such as the driver asks for photo ID when the customer looks under 25. Written as a rule that the customer must be at least 25, it sits beside the 18 rule as a second minimum age, and the checker refuses the pair as logic/time-strength and logic/quantifier-strength.

**Why does my delivery agent offer to leave alcohol on the doorstep?**

Usually because an older delivery rule offers a safe place to anyone who will be out, and the age-restricted block bans it in a passive sentence the checker cannot compare. Put both arms in a $IF chain on a flag the host sets from the basket, so the build ships one of them.

Field note

Age-restricted blocks are written by people who know the law, and they read like the shop's age policy: who may buy, how staff check, what happens with no ID. Most of it is about the doorstep, and the chat agent never stands on one. TypeGlish sorts the lines for you. The customer's age comes back as `prompt/unmeasurable`, the delivery ban as a verb the agent does not perform, the reminder as a hedge, and the safe-place ban as a passive the checker cannot compare. Said as plain rules, Challenge 25 beside the legal age is refused as `logic/time-strength`, and the safe place beside its ban as `logic/contradiction`. The fix for both is to give each fact to whoever can see it: the face to the driver, the basket to the host through a `$IF` chain, and the chat a `$TEST` for the customer at work with a bottle of wine in the order.

∿ washed up Nov 10, 2026 ∿
