An age check logger on AWS for a few dollars a month
The Station Road store failed a test purchase at 21:40 on a Friday. A sixteen-year-old volunteer bought four cans of lager from a member of staff working the till alone, and the till recorded the age prompt being answered clearly over 25. The refusals book for the four weeks before held nine entries. Every one of them had been written before six in the evening.

Key takeaways
- The till already records every age prompt and the answer chosen. Almost nobody reads it.
- A refusal count near zero at a busy store is a finding, not a good month.
- The refusals book stays the record the licence asks for. The system reads it.
- Ages, policy ages and accepted ID are dated rules, and several are changing.
- Designed on AWS for about $6 a month.
The whole system on one page
Before any code, here is the shape of what we are designing.
- Machine learning
- Security & identity
- Analytics
- Front-end & mobile
Why a well-run shop still fails a test purchase
Because every control it has is a yes-or-no control. The till prompts on every restricted item: yes. There is a Challenge 25 poster at the counter: yes. Everybody has done the training: yes. The refusals book is kept, as the licence requires: yes. None of those four answers changes when one person on one shift stops asking for ID, and that is the only thing a test purchase actually tests.
The information that would have shown it was already in the building. The till knew how often each person had been prompted and what they had answered. The book showed when refusals were being written. Nobody put the two side by side as a rate, because the book gets read for completeness — is it being filled in, is it signed — and a book with nine tidy entries passes that test comfortably.
What runs (the inside)
- The prompt. Every scan of a restricted item, the rule that applied on that date, and which of three answers was chosen. Part 2.
- The register. The refusals book, photographed at shift end, transcribed line by line and joined to the till. Part 3.
- The rate. Refusals and ID checks per thousand prompts, per person, compared with the same kind of shift elsewhere. Part 4.
- The evidence. What gets assembled when a test purchase fails or a licence comes up for review, and the three months that follow. Part 5.
One group, four stores, four weeks
- Machine learning
- Security & identity
- Management
- Analytics
- People
In plain words
Every restricted product in the till’s product file carries a category — alcohol, tobacco, vapes, knives, lottery, aerosol paint — and every category has a rule about age. When one is scanned the till stops and asks the person serving to choose: ID seen, refused, or clearly over the policy age. The tills have done this for years. Their answers are exported every night and almost never read.
Alongside the till sits the refusals book. Most of the licences in the group carry a condition requiring one, and the older ones say a book, so a book it is. At the end of each shift the person closing photographs the current page on the shop phone. The model transcribes each line, and each line is joined to the till’s refused answers from the same store at roughly the same time.
Once a week the system works out, for every login that served, how many prompts were answered, how many became ID checks and how many became refusals, split by the kind of shift. It compares each person with everybody working the same kind of shift across the group and lists the few whose numbers volume alone cannot explain.
When something goes wrong — a failed test purchase, a complaint, a licence review — it builds an evidence pack from records written at the time: the rule in force, the prompt and its answer, the book, the reviews, and who signed them.
Design rules that shaped every decision
- A refusal rate near zero is a finding to explain, never a good month.
- ID seen and waved through are different answers, and are stored as different answers.
- Minimum ages, policy ages and accepted ID are rules with effective dates, never constants.
- Where the licence asks for a book, the book stays the record. The system keeps a copy.
- A blank or unreadable field in a handwritten line stays blank.
- A person is compared with people working the same kind of shift, never with a store average.
What it does not do
It does not make or block a sale. The till prompt and the person serving make that decision, and a system that second-guessed them at the counter would be slower, less accurate, and would teach staff that somebody else is responsible for the answer.
It does not identify customers and it does not look at CCTV. The descriptions in the book are what staff wrote about people who are, often, children, and the system keeps them only as long as the business has decided it needs them. More detail than the book already holds is not something to build.
It does not run the training either. When a pattern points at a person, what leaves this system is a login, four numbers and the shifts they came from, sent to whoever owns training; assigning and chasing it is a different system. And it is written for England and Wales. Licensing law elsewhere in the UK differs, and the rules table would be a different set of rows.
The next four posts walk through each piece: what the till already records, how the book becomes a register, why the rate matters more than the count, and what the evidence has to show afterwards. One diagram per post, a cost breakdown, and an engineering reference at the end.
All posts