Training AI on Customer Data: The LGPD Legal Basis to Check

Training AI on Customer Data: The LGPD Legal Basis to Check

Using customer data to serve a request does not authorize training a model with it. Learn the LGPD legal bases, purpose limits and what to document first.

•

Want to apply this in your company?

Book a call with Juan →

There is no single legal basis for training AI on personal data. When a company collected data to serve a customer, using that same data to train a model is a different purpose. The LGPD, Brazil's data protection law, requires its own legal basis for that purpose, such as consent or legitimate interest, plus records and transparency. In practice, the right question is not "do we have the right to use this data?" but "for what purpose, on which basis, and who can prove it later?"

Key takeaways

  • Serving a request and training a model are different purposes, and each needs its own justification.
  • The legal basis must be set before data is collected for training, not after the model already exists.
  • Legitimate interest requires a documented assessment of necessity, the data subject's expectations, impact and safeguards.
  • Anonymization only helps when the method is verifiable and no one can be identified with reasonable effort.
  • Records of processing, an impact assessment when warranted, supplier contracts and a deletion plan are the minimum to have in writing.

Serving the customer and training the model are different purposes

When a customer sends a WhatsApp message asking for a second copy of an invoice, or describes a problem with a piece of equipment, the company processes that data to carry out the service. The use is tied to the service the data subject asked for. The LGPD frames this through the purpose principle: processing must serve legitimate, specific purposes that are disclosed to the data subject, and it cannot be incompatible with what was disclosed.

Training a model changes the nature of the use. Those messages now shape the behavior of a system that will serve other people, often in other contexts. Even if no data appears word for word in a later answer, the processing already happened when the records were copied into a training set. So "we already have the data" does not settle the question.

A simple test helps separate the cases: when the person provided this data, would they expect it to be used to improve an AI model? If the honest answer is "I'm not sure," the company should treat the case as training and settle the legal basis before going further.

Which legal bases can support training

Article 7 of the LGPD lists the bases for processing personal data. For AI training, two usually require the most care: consent and legitimate interest. Performance of a contract rarely covers training, because the contract covers the service, not improving a model for other purposes. Compliance with a legal obligation does not fit this situation either.

Consent must be free, informed and unambiguous, and it can be withdrawn at any time. Collecting specific authorization for training requires its own flow, clear wording and a way to withdraw permission that actually works. Bundling general terms acceptance with permission to train is usually a fragile basis.

Legitimate interest is more flexible, but it is not automatic. The company must show a concrete interest, demonstrate that the processing is necessary for that purpose, verify whether the data subject would reasonably expect this use, and adopt safeguards to reduce risks. This reasoning should be written down, with a version and a named owner. Sensitive data, such as health information, has its own rules under Article 11 and generally should not enter a training set without a separate analysis.

The guidance from the National Data Protection Authority (ANPD) is the starting point for interpreting these requirements. Check it before closing any analysis, because the understanding of AI is still developing.

What changes when data enters the model

A technical point directly affects both the legal basis and data deletion. An AI system that consults a knowledge base at the moment of answering, an approach known as retrieval-augmented generation (RAG), keeps the data in a repository the company controls. If a document is corrected or deleted, the change shows up in the next query.

In fine-tuning, information is built into the model's weights. Deleting the source record does not simply remove what the model learned. Cloud provider documentation that compares retrieval and fine-tuning describes these differences in maintenance and updating, and they matter for any decision about personal data.

In practice, the safest sequence is usually this: solve the service problem first with controlled retrieval and records, then assess whether any training is truly necessary and, only then, handle that part under its own legal basis.

What the company needs to document

Documentation does not need to be an extensive file, but it must exist and be verifiable. A minimum checklist:

  • A description of each purpose of use: service, process improvement, model training and internal evaluation.
  • The legal basis chosen for each purpose, with the reason for the choice.
  • A legitimate interest test, when that is the basis, with version, owner and date.
  • Records of processing, showing where the data comes from, where it is stored and who has access.
  • A data protection impact assessment, when the risk is high or the ANPD requests one.
  • A contract or terms with each AI supplier that processes data on the company's behalf, with written rules on training use and a check of the settings available in each tool.
  • A rule for international transfers, if processing happens outside Brazil, as covered in international data transfer with AI providers.
  • A retention period and a deletion procedure, including copies in logs and evaluation sets.
  • A channel for data subjects, including requests to review automated decisions, as explained in LGPD automated decisions and the right to review.

Illustrative scenario: a store with WhatsApp support

Illustrative scenario: a building materials store uses an agent on WhatsApp to check orders, delivery times and exchanges. A manager proposes using a year of conversation history to train a model that "talks like the team." The team separates three uses before making any decision. The first is keeping the history for support and for handling complaints, which stays under the service basis and the current records. The second is building a question and answer base reviewed by people, drawn from conversations with names, addresses, tax IDs (CPF) and order numbers removed, with a test that the removal actually works. The third is training on raw conversations, which is excluded from the plan, because the legal basis does not hold without specific consent or a documented legitimate interest test.

The result is a knowledge base consulted in real time, which can be corrected at any moment, combined with tone examples written and approved by the team. The store gets the consistency it wanted without turning customer history into training material.

How to apply the method before training

In our work, the sequence is the same as in any AI project: map the current process and data sources, limit which data and actions are included, pilot a real flow with records and an agreed success metric, then hand over the operation and decide whether to expand, adjust or stop. In most cases, the pilot shows that the expected improvement comes from a well organized knowledge base and clear service rules, without any need to train on personal data. When training is necessary, the decision belongs in the mapping stage, with the legal basis and documentation defined, not as a technical detail at the end of the project. To structure the data before this step, see data ready for superintelligence.

Frequently asked questions

Can I train AI on customer data if they accepted the terms of use? Accepting general terms rarely covers training. In most cases, the authorization must be specific to that purpose, or the company needs another legal basis backed by a documented analysis. Have legal counsel review the wording before using any history.

Can anonymized data be used without a legal basis? Anonymized data, when the process is robust and identification cannot be reversed with reasonable effort, no longer counts as personal data under the LGPD. The problem is that many attempts only remove names, and that is not enough. Document the method and test whether the information can still identify someone.

Do I need an impact report for every AI project? Not necessarily, but an impact assessment is advisable when processing involves significant risk, sensitive data or decisions that affect people. The ANPD can request the report, so it is safer to have it ready from the start. Decide based on the concrete risk of each use.

If my AI supplier says it does not train on my data, is that enough? The statement must appear in a contract or terms that apply to the plan you have purchased, and the company should check the tool's settings. You also need to verify where data is processed and stored, because that can trigger international transfer rules. Keep this evidence with the project documentation.

Sources

LGPDAI trainingdata protectionlegal basiscompliance