LGPD for AI Agents: Personal Data in Memory, Logs and Prompts
How LGPD applies to personal data an AI agent stores in memory, logs or prompts, with the duties, retention rules and first steps for Brazilian companies.

LGPD, Brazil's General Data Protection Law (Lei 13.709/2018), applies to personal data that a company's AI agent keeps in memory, writes to logs or sends inside prompts, just as it applies to a CRM or an email archive. The company that decides why the agent processes that data stays responsible for having a legal basis, collecting only what the purpose needs, informing people, protecting the data and answering their requests. Treat each of the three stores as its own data flow, with its own purpose, retention period and list of people allowed to read it.
Key takeaways
- Memory, logs and prompts fall under LGPD whenever they contain information about an identifiable person, including a name inside a saved chat transcript.
- Each store needs a stated purpose, a legal basis and a retention period that someone in the company can defend in writing.
- Logs should record what the agent did and why, not a full copy of every customer message.
- Access, correction and deletion requests reach the agent's memory and indexes too, so you need a way to find and remove that data.
- Model and memory vendors usually act as operators, so their contracts, locations and subprocessors belong in your review before launch.
Where personal data hides inside an agent
Most companies picture personal data in the customer database and stop there. An operating agent creates copies in at least three other places, and each one needs its own answer to the LGPD questions.
Memory is what the agent keeps between sessions: summaries of past conversations, customer preferences, facts it saved about an account or a request. Logs are the traces of what happened: which tool was called, with which arguments, what came back, which user the action touched, and whether a person approved it. Prompts are the full context sent to a model on each call, which can include the customer's message, retrieved documents, account fields and instructions. The model provider receives that prompt, so the prompt is also a transfer.
There is a fourth, quieter store. If you build a retrieval index or embeddings from customer messages, those vectors are derived from personal data. Treat them as carrying the same personal data as the text they came from, because the content can often be recovered or linked back to a person.
Which LGPD duties reach memory, logs and prompts
The law does not contain an exception for automated systems. The duties that matter most for agent data are these:
- Purpose and necessity: process only the data that a stated, legitimate purpose requires, and say what that purpose is.
- Legal basis: each purpose needs a recognized basis, such as performance of a contract or legitimate interest with a documented balance. Sensitive personal data needs stricter grounds.
- Transparency: the privacy notice should say that an AI agent is used, what it keeps and for how long.
- Data subject rights: people can ask for access, correction, anonymization or deletion, information about who the data was shared with, and a review of decisions made solely by automated processing.
- Security and incident reporting: appropriate technical and organizational measures, and notice to the national authority (ANPD) and affected people when a relevant security incident occurs.
- Records and accountability: you should be able to show what processing happens, why, and under which controls.
The ANPD publishes guidance and is the authority to consult on specific questions. The points above are a working map for operations, not legal advice. Confirm the scope with counsel for your own flows.
How do you choose a legal basis and purpose for each store?
The same customer message can serve several purposes: resolving the request, reviewing agent quality, and tuning a model. Each one is a different purpose and may need a different basis and a different disclosure. Do not assume that the basis for support covers using the same conversations to improve a model.
A simple decision guide helps operations teams apply this consistently:
- If the agent needs a fact only to finish the current task, keep it tied to that task and let it expire when the task closes.
- If the agent keeps a preference across sessions, write down the purpose, show the customer what is stored where feasible, and make removal possible.
- If a record exists to audit agent actions, keep only the fields needed to reconstruct the action, not the full conversation.
- If data would be used to train or tune a model, stop and obtain legal review before any copy leaves the operational store.
Every store needs a purpose written down before it needs a retention rule.
Logs: keep evidence without keeping everything
Operators need logs to diagnose failures and to prove what an agent did. The OpenTelemetry documentation on observability describes telemetry as traces, metrics and logs that let teams understand system behavior. The lesson for privacy is that the telemetry you need is usually structural: event names, timestamps, identifiers, outcomes and approval status. Free text is rarely required.
A practical checklist for the logging layer:
- Define the event types you log, such as tool call name, timestamp, result category and approval state.
- Replace direct customer identifiers with pseudonymous references where the operation allows it.
- Redact email addresses, phone numbers, tax identifiers, street addresses and payment details before the record enters the log pipeline, not after it is stored.
- Keep full payload capture switched off in production, and allow it only for a named incident, with a time limit and a note in the incident record.
- Restrict log access by role, and review that access list on a schedule.
For a deeper check of the memory layer, read Superintelligence and LGPD: Keeping Agent Memory Lawful in Brazil.
Retention, deletion and access requests
Each store needs its own retention period. Working memory for a task should close with the task. Preferences should expire on a stated schedule or when the customer changes them. Logs usually need a period tied to operational review and any legal or contractual obligation to keep records. When an obligation requires retention, document the exception and the reason.
Deletion has to reach every copy the agent created, not only the primary record. That includes the memory entries, the index entries derived from the messages, the prompt caches your vendor keeps, and the log entries that still identify the person.
Illustrative scenario: an online furniture retailer runs a support agent that remembers delivery preferences. A customer asks for deletion. The team searches memory by customer reference, removes the preference records, rebuilds the index entries built from those messages, and confirms that the order audit trail keeps only a pseudonymous reference because a contract requires that record. The exception is documented with its end date.
For the procedure itself, see Deleting AI Agent Memory on Request: Find, Remove, Verify.
A first review plan for the next working cycle
A first review does not need a large program. It needs a complete list of stores and a clear owner for each decision. The following sequence works for most small and mid-sized companies:
- Inventory every place where the agent writes personal data, including vendor-hosted memory, vector indexes, prompt logs and error reports.
- For each store, write the purpose, the legal basis, the data fields and the retention period.
- Remove fields the purpose does not need, starting with free text in logs and full prompts kept after the call.
- Update the privacy notice and the internal record of processing activities so they describe the agent accurately.
- Check that vendor contracts cover operator duties, security measures, help with access requests, incident notice and the location of stored data or transfers.
- Test one access request and one deletion request from start to finish, and keep the evidence.
- Name an owner for the review and repeat it whenever a tool, model or integration changes.
A short companion list for the wider rollout is in LGPD and AI Agents: What Brazilian Companies Should Check. The NIST AI Risk Management Framework is also useful for organizing risks by function, so that privacy, security and operational owners see the same map.
How a managed approach keeps these stores under review
Be Human designs and operates AI agents whose memory, tools, channels and permissions remain under the client's control. In a first engagement, the work starts by recording which personal data each store holds, why it is there, and how long it stays, and by narrowing the agent's permissions so that logs and prompts carry only what the role needs. Managed operations then cover recurring permission review, monitoring for personal data that appears where it should not, integration maintenance and incident response, so the mapping stays accurate after the first setup.
Take the free Be Human AI diagnostic to find the first task worth handing to an agent.
Frequently asked questions
Does LGPD apply to an AI agent if the model runs outside Brazil? LGPD generally applies when the processing takes place in Brazil, when it targets people located in Brazil, or when the data was collected there. Hosting the model abroad does not remove those duties, and international transfers add their own requirements. Confirm the scope for each flow with counsel.
Can we keep full chat transcripts in logs for debugging? Keep only what debugging requires, such as identifiers, event types, timestamps and outcomes. Full transcripts are rarely necessary, and they multiply the number of places where personal data must be protected, corrected and deleted. If a transcript is needed for one incident, capture it for that incident only and record why.
Is customer consent always required for agent memory? No. Consent is one legal basis among several, and it must be specific, informed and revocable. For many operational purposes, such as performing a contract the customer requested, another basis may fit better. Choose the basis per purpose and write the choice down.
Who answers an access request when a vendor stores the agent's memory? The company that decides the purpose is responsible for answering the request, even when a vendor holds the data. The vendor contract should require the vendor to help locate and delete the data within a timeframe you can meet. Test that process before a real request arrives.
Your next step
See where an AI agent fits in your company first.
Take the free Be Human AI diagnostic. A few questions about your work show which task to hand to an agent first, what it needs to know and where a person approves.
Be Human editorial guidance. Examples are illustrative unless explicitly attributed. Sources provide background; implementation choices depend on your workflow.


