Skip to content
[nonimo]
EN
Try it free

Home / Blog

UK GDPR · DSAR

Subject access and erasure requests in an LLM app

· 7 min read

A Leeds energy supplier receives a subject access request, then an erasure request, from a customer who used its AI chat. Here is how it found every copy.

The Nonimo teamData protection and AI integration, for engineering teams and DPOs.

In this article
  1. What does a subject access request cover when you use an LLM?
  2. Where do copies of a customer's data end up?
  3. How long do you have to answer?
  4. How do you find and delete one customer's data across every store?
  5. What goes into the copy you send the customer?
  6. What if the customer only wants part of the data erased?
  7. What about the AI provider's copy?
  8. How does masking at the gateway reduce the work?
  9. Does the same apply to a RAG index?
  10. Subject access and erasure in an LLM app: checklist

Quick answer

A subject access or erasure request covers every copy your LLM app keeps: the app database, chat history, logs and traces, caches, retry queues, backups and whatever the AI provider retains.

You have one month to respond, so build a map of those copies and a search-and-delete routine by customer ID before the first request lands.

Calderbrook Energy is a fictional home energy supplier in Leeds with about 60,000 customers. Last spring it added an AI assistant to its customer service: it drafts replies to emails, summarises call notes and answers billing questions in the web chat.

In October a customer, Priya Whitfield, emailed asking for a copy of everything Calderbrook held about her. A fortnight later she asked the company to delete her chat transcripts. The data protection lead, Martin Okafor, had to work out where an AI assistant had put her data.

Calderbrook is in England, so the law is the UK GDPR and the Data Protection Act 2018 (UK), with the ICO as regulator. An Irish firm would answer the same request under the GDPR and the Data Protection Act 2018 (Ireland), with the Data Protection Commission as regulator, and the article numbers below match.

What does a subject access request cover when you use an LLM?

Article 15 gives Priya the right to know whether Calderbrook processes her data, to access it and to receive the supporting information. Article 15(3) adds a copy of the personal data undergoing processing.

The request covers her data wherever it sits. If the assistant wrote her name into a trace, a cache entry or a prompt log, that copy is in scope as much as her account record.

An LLM feature tends to multiply those copies quietly, because each layer of the stack keeps its own record for debugging.

Where do copies of a customer's data end up?

Martin sat down with the engineering team and listed every place a chat with Priya could have left text. The diagram shows the result.

Places where an LLM customer-service app keeps copies of a customer's data Customer-service assistant App database Chat history Logs and traces Response cache Retry queue Backups AI provider per its retention [PERSON_1] Each box needs a search by customer ID and a delete route
Seven places a single chat can leave text. With masking, the provider receives labels instead of the customer's name.

The table turns the diagram into work. It is the version Calderbrook now keeps in its Article 30 record, next to the assistant's entry.

CopyFound byFor access (Art. 15)For erasure (Art. 17)
App databaseCustomer IDExport the recordDelete, except what the law requires you to keep
Chat historyCustomer ID on each conversationExport transcriptsDelete conversations
Logs and tracesCustomer ID in a structured fieldInclude entries with personal dataDelete or let expire on a short, documented schedule
Response cacheKey prefix per customerUsually transient; note itPurge keys
Retry queueCustomer ID in the messageUsually transient; note itDrop pending messages
AI providerYour contract and settingsDepends on provider retentionFollow the provider's deletion process, or send labels only
BackupsBackup date rangeUsually out of reach day to dayExpire on schedule; reapply erasures on restore

How long do you have to answer?

Article 12(3) sets one month from receipt of the request. You can extend by two further months where necessary, taking into account the complexity and number of requests, but you must tell the person within the first month and explain why.

An LLM feature is a poor reason for an extension. If finding a customer's data in your own traces takes weeks, that is a design gap to close before the next request, and one a regulator is likely to ask about.

How do you find and delete one customer's data across every store?

The rule Calderbrook adopted is simple: every store that can hold customer text must be searchable by the internal customer ID. Free-text search for "Priya Whitfield" across logs is slow, misses misspellings and finds other people with the same name.

The routine below runs the same two operations against every registered store and returns a report for the case file. Each store implements its own find and erase.

interface CustomerStore {
  name: string;
  find(customerId: string): Promise<unknown[]>;
  erase(customerId: string): Promise<number>; // rows or items removed
}

type Line = { store: string; found: number; erased?: number };

export async function handleRequest(
  stores: CustomerStore[],
  customerId: string,
  mode: "access" | "erasure",
): Promise<{ copy: Record<string, unknown[]>; report: Line[] }> {
  const copy: Record<string, unknown[]> = {};
  const report: Line[] = [];
  for (const store of stores) {
    const items = await store.find(customerId);
    copy[store.name] = items;
    const line: Line = { store: store.name, found: items.length };
    if (mode === "erasure") line.erased = await store.erase(customerId);
    report.push(line);
  }
  return { copy, report };
}

The report matters as much as the deletion. When Priya or the ICO asks what was done, Martin can show which stores were searched, how many items each held and how many were removed, without keeping the content itself.

Logs that can be searched without holding the text

Traces are the copy that grows fastest. Calderbrook changed its logging so that each assistant call writes the customer ID, the model and counts, and leaves the prompt and the answer out.

import json, logging, time

log = logging.getLogger("assistant")

def log_call(customer_id: str, model: str, tokens_in: int, tokens_out: int) -> None:
    # No prompt or reply text: only what is needed to operate and to answer requests.
    log.info(json.dumps({
        "ts": int(time.time()),
        "customer_id": customer_id,
        "model": model,
        "tokens_in": tokens_in,
        "tokens_out": tokens_out,
    }))

That one change shrank the access request work for logs to a filter on a single field. It also helps with Article 5(1)(e), because a log line without content is easier to justify keeping for a few weeks.

What goes into the copy you send the customer?

Article 15(3) asks for a copy of the personal data undergoing processing, in a commonly used electronic form if the request came in electronically. For Priya, that meant her account record, her chat transcripts and the email replies the assistant had drafted about her.

Drafts that an agent edited and sent are part of her correspondence. Drafts that were discarded but still sit in a table are personal data too, so Calderbrook included them, clearly labelled as unsent.

Log lines that hold only her customer ID, a timestamp and token counts are listed in the covering letter rather than copied in full. Martin explains what the assistant records and why, which also answers the questions in Article 15(1) about purposes and retention.

What if the customer only wants part of the data erased?

Priya's second request was narrower: delete the chat transcripts, keep the account. Article 17 lets you erase on the grounds it lists, and it also sets out exceptions, such as data you must keep to comply with a legal obligation.

An energy supplier has to keep billing records, so Calderbrook kept her invoices and meter readings and erased the chats, the cached replies and the drafts. The reply to Priya said which categories were erased, which were kept and on what basis.

The search-and-delete routine shown earlier handles this, because each store is registered on its own. A partial erasure simply runs it against a subset of stores.

What about the AI provider's copy?

The provider receives every prompt the assistant sends. How long it keeps API inputs and outputs depends on its retention policy, your contract and any settings you have chosen, so read the provider's current documentation and record the answer in your DPIA under Article 35.

Article 19 adds a duty to tell each recipient about an erasure, unless that proves impossible or involves disproportionate effort, and to tell the person about those recipients if they ask. If the provider is one of your recipients, Calderbrook needs a route to pass that on.

The cleaner design is to send the provider less in the first place. If the prompt that leaves your systems carries labels instead of Priya's name and account details, the provider's copy holds very little that relates to her.

How does masking at the gateway reduce the work?

Calderbrook put the Nonimo Gateway between its assistant and the AI provider. Before each request leaves, the Gateway replaces personal data with labels such as [PERSON_1] and [IBAN_1], and when the reply comes back it puts each real value in its place, in streaming responses and tool calls too.

For a subject access or erasure request, that changes three rows of Martin's table:

  • The provider receives labels. Its copy of Priya's chats holds placeholders for the personal data the Gateway recognises, and the link back to her stays inside Calderbrook's environment.
  • The Gateway keeps no text between requests. There is no Gateway store to search.
  • The Gateway's per-request log holds counts only. It records the time, provider, model and the number of items masked by type, exported as CSV or JSONL, and the data itself never enters it.

So the list of places to check gets shorter. The app database, chat history and backups are still Calderbrook's to handle, and the map above stays in use.

Nonimo acts as processor for the text that passes through the hosted Gateway, with Microsoft Azure hosting the confidential machine as sub-processor and Calderbrook as controller. Nonimo itself only sees totals of requests and masked items. The details of the hosted set-up are on the security page.

Does the same apply to a RAG index?

Yes, and it is often the hardest store to clean. If your assistant answers from a vector database built over customer emails, each chunk needs the IDs of the people it mentions, or erasure means rebuilding the index.

Our article on RAG and personal data under the GDPR covers how to tag chunks at indexing so that one filtered delete removes a person's chunks and vectors together.

Subject access and erasure in an LLM app: checklist

  • Every store that can hold customer text is on the map, including caches, retry queues and traces.
  • Each store can be searched and cleared by internal customer ID.
  • Logs record IDs and counts, not prompts or replies.
  • The provider's retention and deletion process is written into the DPIA.
  • You have a route to notify recipients of an erasure under Article 19.
  • Restores from backup reapply erasures carried out since the backup date.
  • The one-month clock and any extension are tracked per request.
  • A test request with an invented customer has been run end to end.

That last item is worth doing before a real customer asks. The test set described in testing PII redaction before go-live works for it too, and the Gateway's trial and plans are on the pricing page.

Common questions

Are prompts and AI replies covered by a subject access request?

Yes, when they contain the person's data. A prompt log, a trace or a cached reply that mentions the customer is personal data like any other record you hold about them, and it belongs in the copy you provide under Article 15(3).

How long do we have to respond to a subject access request?

One month from receipt, under Article 12(3) of the GDPR and the UK GDPR. You can extend by two further months where necessary, given the complexity and number of requests, if you tell the person within the first month and explain why.

Can we extend the deadline because the AI stack is complex?

It is a weak reason on its own. If finding a customer's data in your own traces takes weeks, a regulator is likely to see a design gap rather than a complex request. Planning the search before the first request arrives is the safer route.

Do we have to ask the AI provider to delete the customer's prompts?

Start with the provider's retention policy and deletion process, and record both in your DPIA. Article 19 also asks you to tell recipients about an erasure, unless that proves impossible or involves disproportionate effort, and to name them if the person asks.

Should discarded AI drafts go into the copy we send?

Yes, if they are still stored. A draft reply that mentions the customer is personal data you hold, even if nobody sent it. Label those drafts as unsent so the customer can tell them apart from the correspondence they actually received.

Can a customer ask us to erase only their chat history?

Yes. The request can cover part of the data, and Article 17 applies with its exceptions, such as records you must keep to comply with a legal obligation. Tell the customer which categories you erased, which you kept and on what basis.

What do we do about backups after an erasure?

Let backups expire on their documented schedule, and make sure any restore reapplies the erasures carried out since the backup date. Write that approach into your erasure procedure, so you can explain it if the customer or the regulator asks.

Does the Nonimo Gateway store our customers' conversations?

No. It keeps no text between requests, and its per-request log holds the time, provider, model and counts by data type, never the data itself. That leaves one fewer store to search. See the security page.

Sources

  1. UK GDPR (retained Regulation (EU) 2016/679)
  2. Data Protection Act 2018 (UK)
  3. Regulation (EU) 2016/679 (General Data Protection Regulation)
  4. Data Protection Act 2018 (Ireland)
  5. ICO, Guidance on AI and data protection

More articles

Nonimo Gateway redacts personal data before your request reaches the AI provider and puts it back in the reply.

See how it works
€0 today10 days free · cancel any time

Try Nonimo Gateway

Try it free on real requests from your own applications.

Then €290/month inc. VAT, only if you carry on.

We’ll use your email to send you the trial and remind you before it ends. Privacy.

Questions? Email [email protected]

Already have a Gateway? Go to Your Gateway