Sub topic 11
Handling AI output: accuracy, leakage, and storage
Most guidance about AI and customer data covers what you send in. This chapter covers what comes back. An AI reply can be wrong, can contain customer data, and can end up stored in places you did not plan for. Treat the output as a new piece of work product that needs its own checks.
This chapter assumes you have read the earlier chapters on data classification, approved tools, tool settings, redaction and pseudonymization, and agents and connectors. It also assumes you can read short Python.
Why output needs its own handling
A prompt is something you control before you send it. A reply is not. It is generated, so it may include claims nobody verified and details you did not ask for. It also arrives in a place you may not have thought about, such as a chat history, a document, a ticket comment, or a pull request.
Three problems follow, and the rest of the chapter takes them in order:
- Accuracy: the reply may be false, and a false statement about a customer can cause real harm.
- Leakage: the reply may contain customer data, or may carry data out of the tool through a side channel.
- Storage: the reply, and the conversation around it, persists somewhere with its own retention and access rules.
Accuracy: wrong output about real people
Language models produce plausible text, not verified facts. When the task involves customer records, the usual failures are specific.
- Invented details. A model asked to summarize a case may add a refund amount, a date, or a promise the customer never made.
- Merged identities. If you paste two customer threads into one prompt, the summary may attribute one customer's complaint to the other.
- Silent omissions. A summary can drop the one sentence that mattered, such as a request to stop contact or a medical detail that changes how the case should be handled.
- Confident tone. Wrong answers read exactly like right ones, so the style of the reply tells you nothing about its reliability.
Accuracy is a data protection concern as well as a quality concern. Many privacy laws, including the GDPR, expect personal data to be accurate. If an AI-written note that says a customer "missed three payments" is saved to their record, you have created an inaccurate record about a real person. Decisions made later may rest on it.
Verify against the source
Check any customer-specific claim in an AI reply against the system of record before you act on it or store it. Focus on the claims that carry consequences:
- Names, account numbers, and amounts.
- Dates and deadlines.
- Commitments, such as refunds, exceptions, and escalations.
- Statements about the customer's behavior or eligibility.
If you pseudonymized the input, also confirm that each token in the reply maps back to the right person before you restore real names.
Leakage: customer data coming out
You might expect output leakage to be a minor concern if you were careful with the input. It is not, for four reasons.
The reply echoes what you sent
Models often repeat parts of the prompt. If a name or account number slipped through redaction, it can reappear in a draft email, a code comment, or a generated test fixture. The output then spreads that data further than the prompt did. Generated code is a common case. A model may copy a real customer email from your sample data into a unit test, and that test gets committed to a shared repository.
The reply contains data it should not have
In a tool connected to internal systems, the reply may include data from records you did not mean to involve. A search connector might return a neighboring customer's record because the query matched loosely. In that case the leak is your own tool showing you data, and you are the next link in the chain if you forward it.
The reply carries data out through a side channel
This risk applies to agents and connectors. A document, web page, or email the tool reads can contain hidden instructions, which is called prompt injection. A malicious instruction might tell the model to include customer details in a link, for example by putting them in the URL's query string. If the interface fetches or renders that link automatically, the data goes to the attacker's server without anyone clicking.
Practical defenses:
- Be suspicious of links, embedded images, and formatted blocks in replies from tools that read untrusted content.
- Do not click or auto-load external URLs in a reply that was produced while the tool was reading customer or third-party content.
- Prefer tools that block automatic rendering of remote content, or that show URLs before loading them.
- Keep the connector's access narrow so a successful injection can reach little.
The reply is shared too widely
Many chat tools offer share links, team workspaces, and exported transcripts. A conversation that contained customer data stays sensitive when you share it. A link that anyone with the URL can open is effectively public. Check the sharing setting before you send a transcript to a colleague, and prefer sharing the cleaned result over the whole conversation.
Storage: where output ends up
Output spreads quickly. A single reply may be copied into a ticket, pasted into a document, saved in browser history, and stored in the vendor's chat log. Each location has its own retention period and its own audience.
| Location | Typical risk | What to check |
|---|---|---|
| Vendor chat history | Retained after you "delete" it; visible to admins and sometimes to vendor staff | Retention setting, admin access, deletion behavior |
| Shared workspace or share link | Wider audience than intended | Link permissions, expiry |
| Ticket or CRM note | AI-written inaccuracies become part of the customer record | Human review before saving; source verification |
| Code repository | Real data in generated tests, fixtures, or comments | Search the diff for real names, emails, IDs |
| Local files and downloads | Unencrypted copies on laptops | Approved storage locations only |
| Screenshots and clipboard | Bypasses the tool's controls entirely | Clear the clipboard; do not post screenshots in public channels |
Output inherits the classification
A rule of thumb from the classification chapter applies here: derived data keeps the sensitivity of its source. A summary of a confidential support case is confidential. If the reply still describes an identifiable person, it is personal data. Even a pseudonymized reply is still personal data if you hold the mapping that can reverse it, so store the two separately and apply the same access rules to both.
Store output only where the original data was allowed to live. If the source lived in the CRM, the summary belongs in the CRM, not in a personal notes app.
Retention and deletion
When a customer asks for their data to be deleted, copies of AI output about them are in scope. That includes drafts, transcripts, and generated documents. Keep track of where output goes, and prefer approved tools with admin-controlled retention, so deletion requests are possible to carry out. Where you can, save only the final reviewed result and not the whole conversation.
A small output check in code
Automated checks catch some problems before a reply is saved or sent. This example scans a reply for patterns that should not appear and for pseudonym tokens that the mapping does not know. Unknown tokens are a sign the model invented or confused an identity.
import re
EMAIL = re.compile(r"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")
PHONE = re.compile(r"\+?\d[\d\s().-]{7,}\d")
TOKEN = re.compile(r"CUSTOMER_\d+")
def check_output(reply: str, mapping: dict[str, str]) -> list[str]:
problems = []
if EMAIL.search(reply):
problems.append("contains an email address")
if PHONE.search(reply):
problems.append("contains a phone number")
unknown = sorted(set(TOKEN.findall(reply)) - set(mapping))
if unknown:
problems.append(f"contains unknown tokens: {unknown}")
return problems
mapping = {"CUSTOMER_1": "Ana Diaz"}
reply = "Please apologize to CUSTOMER_1 and CUSTOMER_2. Call +44 20 7946 0958."
print(check_output(reply, mapping))
# ['contains a phone number', "contains unknown tokens: ['CUSTOMER_2']"]This check has the same limits as the redaction code in the earlier chapter. It finds fixed patterns only. It will not notice a wrong amount, a swapped name, or a free-form identifier. Use it to flag replies for review, never to approve them.
A workflow for handling output
Common mistakes
- Trusting the summary. Saving AI text to a customer record without comparing it to the source.
- Sharing the whole transcript. The conversation holds your prompts, not just the clean answer.
- Auto-loading links. Letting a tool open URLs in replies produced from untrusted content.
- Committing generated samples. Leaving real values in test data, fixtures, or comments.
- Forgetting copies. Treating "deleted from the chat" as "deleted everywhere."
- Restoring names too early. Swapping real names back into a reply before the reply has been verified, or in a place that lacks access controls.
Quick checklist
- Did the reply include anything about a customer that I can verify only by trusting the AI?
- Does the reply contain emails, phone numbers, IDs, or names that I did not intend to use?
- Does it include links or rendered content that the tool might load automatically?
- Where will I save it, and is that location allowed for this classification?
- Will I share the result or the whole conversation?
- If something looks like an exposure, do I know whom to report it to? The next chapters on incident response and team habits cover this.
Exercise
You asked an approved AI tool to summarize a support thread, using CUSTOMER1 and CUSTOMER2 as tokens. The reply says "CUSTOMER2 was charged twice and CUSTOMER3 requested a refund." Your mapping holds only CUSTOMER1 and CUSTOMER2. What do you do before saving the summary to the CRM, and why?
Show answer
Do not save it yet. CUSTOMER_3 is not in the mapping, so the model invented or confused an identity, which means other claims may also be wrong. Compare every claim with the original thread, fix or discard the summary, and only then restore real names locally. Save the corrected note to the CRM, which is where the source data lives. Saving the unchecked text would put an inaccurate statement about a real person in their record.
Exercise
An agent that reads incoming customer emails produces a reply containing a link whose URL ends in "?ref=" followed by a customer's account number. The chat window is about to render the link. What is the risk, and what should you do?
Show answer
The link may be the result of a prompt injection in an email. If the interface fetches the URL automatically, the account number is sent to an outside server without any click. Do not load the link. Hold the reply, remove the URL, and tell your security contact, because the account number may already have left your control if the link was previously rendered. Then review the agent's access so an injection can reach less data.