AI Practitioner

Case File: The Customer List in the Chat Box

A member of staff pasted a whole page of customer messages into a free online AI tool to get better replies. The messages held phone numbers, emails and bank account numbers. Text that goes into an online tool leaves your control, so personal details must be replaced before it is pasted. Split each message into words, strip the punctuation at the end of each word, and recognise an email (one @ with a dot in the domain), a phone (11 digits starting with 0, or +234 and 10 digits) and an account (exactly 10 digits). Replace each with a tag, keep the punctuation, and report what was found, which messages were unsafe and how many were clean. Run it on messages that you cannot see. The messages are generated for you alone.

50 min

Sabi Logistics · Desk 1

The Customer List in the Chat Box

A free online AI tool now holds a page of real customer phone numbers, and nobody knows what it does with them

Ngozi Compliance officer · Phone call

Ngozi. A member of staff wanted better replies to customers, so they pasted a whole page of customer messages into a free online AI tool. Some of those messages had phone numbers, email addresses and bank account numbers in them. I cannot get that text back. I want a rule that every message goes through before it is pasted anywhere.

I have a file of messages. Please find the emails, phones and account numbers in each, replace them with a tag, and tell me which messages were unsafe and how many were clean. I would like to know the exact rules that you used, because people will argue about a number with twelve digits.

The brief

What you need to know first.

  • Words first. Split the message on white space. For each word, the core is the word without the punctuation at its end (any of . , ; : ! ?); the removed punctuation is the tail and is kept in the output, so 08031234567, becomes [PHONE],.
  • The three kinds. An EMAIL has exactly one @, something before it and a dot inside what comes after it. A PHONE is 11 digits starting with 0, or +234 followed by exactly 10 digits. An ACCOUNT is exactly 10 digits. A word of 12 digits (an order number) or 9 digits is not data of these kinds, and neither is ada@shop (no dot after the @).
  • The order of the tests matters. An 11-digit word that starts with 0 is a phone, not an account; test the email first, then the phone, then the account.
  • The output. The redacted text is the words joined by single spaces. Count the three kinds per message. unsafe is the sorted ids of messages where anything was found; n_clean is how many had nothing.
  • Fill in scan(req) returning {"rows", "total_found", "unsafe", "n_clean"}, then result and total_found. The checks run scan on messages that you cannot see: a phone with a comma after it, a +234 number with a full stop, a ten-digit account, 12-digit and 9-digit numbers, a broken email, an empty message, and an empty list.

The lab gives you the data for this case, invented and generated for you alone.

Preparing your data…

On the bench

The lab checked the rule with a script. These are the checks that show the same thing in a real office.

You want toDo thisWhat you see
see what a tool does with the text you pasteRead the privacy page and the data settings of the tool: whether chats are used for training, how long they are kept and how to delete themwhether pasted text can be kept or used, which decides what may be pasted
test your redaction ruleWrite ten invented messages with phones, emails, accounts and decoys and run the rule on themwhat the rule misses, before a real message finds it
check the history and sharing settingsOpen the settings of the account and see whether chat history is on and whether chats can be shared by linkcopies of pasted text that stay in the account

Practise with invented data only. Never paste real customer, patient, pupil or staff details into an online AI tool, and never rely on an assistant for a decision about money, health or law without a person checking it.

🔒 The debrief unlocks when you close the case. Finish the lab above.

Write the redaction note

Write the note for the compliance officer: the rules that were used to find an email, a phone and an account (and why a 12-digit or a 9-digit number is not one), what the scan found in the messages (the total, the unsafe messages and the clean ones), what the rule cannot find (names, addresses, numbers with spaces), and what to do beyond a rule (avoid pasting personal data, a business version of the tool with a data agreement or a local model, widening and testing the rule, a short policy, training, what to do after a mistake, and the data protection law).

0 words

🧪 Want to practise this on your own computer? See how to set up your lab →

📝

Knowledge Check

1 of 4

Which of these words is an ACCOUNT by the rules of this case?

Report a problem

About: /lessons/case-the-customer-list