How LiteLLM prompt logging controls support GDPR minimization and storage limits
A controller that routes prompts containing personal data through a self-hosted LiteLLM gateway can use the gateway to support data minimization and storage limitation, and to document both in its records of processing. The platform does not decide the lawful basis, does not settle transfer questions for model providers, and does not make the controller compliant on its own. Those remain the controller's decisions under Articles 5(1)(e), 25(2) and 30(1)(f). DeployOpen plans and configures these controls in your infrastructure and prepares the evidence your privacy and security teams review. DeployOpen does not issue audit reports or certificates, and the GDPR requires none. Certification under Article 42 is voluntary and does not reduce the controller's responsibility.
The main settings are store_prompts_in_spend_logs, which decides whether prompt content is stored at all, and turn_off_message_logging, which keeps messages and responses away from logging providers while spend metadata is still tracked. Per-request redaction is available through the beta x-litellm-enable-message-redaction header, so confirm its status against your LiteLLM version before relying on it. Spend log retention through maximum_spend_logs_retention_period deletes old logs on a schedule and is available in open source. Work out the retention period per data category first, because the record of processing should state erasure time limits where possible and privacy notices must state the storage period or the criteria used to set it.
Decide which teams and purposes need prompt content at all, then set logging per team rather than assuming one gateway-wide default fits every workload. Test the settings with synthetic personal data, check what actually lands in the database and log sinks, and keep the test results with the configuration as evidence. Enterprise features such as team-level logging should be confirmed against the edition you run before you write them into your records.
Which GDPR requirements map to which LiteLLM settings
This table pairs each GDPR provision on storage, minimization, records and security with the LiteLLM setting that supports it and the duties that stay with your organization. Read each row as a split: the configuration column covers what the gateway can enforce, and the right-hand column covers what no gateway setting can prove. Treat the gateway as one control among several, not as compliance on its own.
| Requirement | LiteLLM configuration needed | What stays outside the platform |
|---|---|---|
| Article 5(1)(e), storage limitation | Set maximum_spend_logs_retention_period so old spend logs are deleted on a schedule, and confirm the deletion job runs in your deployment | Choosing a retention period that matches the purpose, and documenting why it is necessary |
| Article 25(2), default minimization including storage period | Keep store_prompts_in_spend_logs off by default and use turn_off_message_logging where prompt bodies are not needed for the purpose | Deciding which purposes justify storing any prompt content, and approving exceptions per team |
| Article 30(1)(f), envisaged erasure time limits | Record the configured retention period and logging switches as the erasure limits for the gateway's data categories | Writing the time limits into the record of processing activities and applying them to backups and downstream systems |
| Articles 13(2)(a) and 14(2)(a), storage period in privacy notices | Document the retention settings so the notice states the period or the criteria used to set it | Writing the privacy notice itself and telling data subjects the storage period or criteria |
| Article 32(1)(a), pseudonymisation and encryption | Use the beta x-litellm-enable-message-redaction header per request where supported, and encrypt the PostgreSQL database and Redis at rest and in transit | Confirming redaction quality on your own data, and key management and encryption policy outside LiteLLM |
| Per-team logging scope | Apply logging settings per team so only teams with a documented purpose store prompt content | Assigning team owners who justify the purpose and review the setting periodically |
| Lawful basis and Chapter V transfers | Route traffic only to approved provider endpoints and record which providers receive prompts | Lawful basis under Article 6, transfer assessments and standard contractual clauses for each provider, and third-country access risk |
Where personal data in prompts ends up in a LiteLLM gateway
Personal data in a prompt does not stay in one place. It enters through the proxy, passes to the model provider you selected, and can be copied into the gateway's own stores and into any logging callback you enabled. Before you set any control, map each of those points for your deployment. The first is the request path through the LiteLLM proxy, where the request body, the caller's virtual key and the routed deployment are handled. The second is the spend log table in the PostgreSQL database, which the gateway uses to record spend and, depending on your settings, request content. The third is each logging callback that sends data to an external observability or storage tool. A prompt containing a customer name or an account identifier may reach any of these, so a control applied at only one of them leaves the others open.
The most important distinction is between spend metadata and message content. The setting turn_off_message_logging stops messages and responses from reaching logging providers while spend metadata is still tracked, so cost reporting continues without the prompt text. The store_prompts_in_spend_logs setting controls whether prompt content is stored in the spend log database at all. Per-request redaction is available through the x-litellm-enable-message-redaction header, which the LiteLLM Logging documentation marks as beta. Because it is beta and set per request, do not rely on callers to send it consistently. Instead, confirm how the header behaves against the LiteLLM logging documentation, then test it in your own environment with a synthetic personal data value and check each store and callback for that value.
Treat the current behavior as something to verify, not assume. Build a test matrix that sends prompts containing test personal data through each team's key, then inspect the spend log table, the logging destinations and any traces or exports for the value. Record the configuration version and LiteLLM release used for each result, since logging behavior can change between releases. The outcome of this check determines your record of processing entries for prompt content, the storage period you can state in privacy notices, and whether you need additional redaction before data reaches a provider.
Configuring prompt logging, redaction and retention in sequence
This sequence sets LiteLLM so prompt content is not stored by default, message logging to external providers is off, retention is bounded to a documented period, and each team's logging matches its purpose. The closing test shows the settings hold in practice.
Set the default so prompts are not stored
Start with the configuration setting store_prompts_in_spend_logs in the proxy config, which controls whether prompt content is written to spend logs at all. Leave it off unless a documented purpose requires prompt text in the database. The platform owner makes this change in the configuration repository, not in the admin UI, so the setting is versioned and reviewable. You know the step is done when the config diff shows the key set to the value your records of processing describe, and a test request leaves no prompt text in the spend log table.
Turn off message logging to external providers
Enable turn_off_message_logging so that messages and responses are not sent to logging providers configured on the gateway, while spend metadata such as model, key, team and token counts is still tracked for billing and budgets. This keeps personal data out of third-party observability tools that would otherwise be additional recipients. The platform owner confirms this with the logging integrations in place. The step closes when a test request appears in the spend data but its message body does not appear in any configured external logging destination.
Decide whether per-request redaction is used
The x-litellm-enable-message-redaction header enables redaction per request, but it is in beta. Decide with the privacy and security leads whether your processing depends on it. If it is not needed, rely on the two settings above and do not write redaction into your records as a control. If it is adopted, document the beta status, the calling applications that send the header, and the fallback if the behavior changes. The step closes with a written decision that names who sends the header and which requests depend on it.
Set spend log retention to the documented period
Set maximum_spend_logs_retention_period so old spend logs are deleted on a schedule. The period should come from your retention decision, not from a default, and should match the time limit you record for spend data in your records of processing and privacy notices. Confirm with the LiteLLM retention documentation how the deletion schedule runs in your release and whether it is available in your deployment. The step closes when the configured value is recorded in the same document as your erasure time limits and a test log older than that period is removed on the next scheduled run.
Apply per-team logging settings
Review each team and key that sends prompts and apply logging settings that match its purpose. Teams processing customer or employee personal data may need stricter settings than internal test teams. Per-team logging controls are documented as part of LiteLLM Enterprise, so confirm availability for your edition before you rely on them, and record the edition in the processing record. The platform owner keeps a table mapping each team to its logging setting and purpose. The step closes when that table is approved by the data protection lead and matches the live configuration.
Verify with dummy personal data
Send test prompts that contain clearly fictitious personal data, such as invented names, email addresses and identifiers, through each team's key. Then check the spend logs, the database, configured logging destinations and any admin UI views for that text. Also confirm that spend totals still increase, so billing and budgets still work. Record the test date, the configuration version tested and the results in the evidence file. The step closes when no test personal data appears where the settings say it should not, and any gap is logged as a finding with an owner and a fix.
Document the controls in records of processing
Update your record of processing activities with the configured settings, the retention period, the teams covered and the verification results, so it reflects what the gateway does. The record should state the time limit for erasure of each data category where possible. Have the data protection lead sign off the update and set a review point when the configuration or LiteLLM release changes. The step closes when the record references the exact configuration version and the test evidence, and a reviewer can trace each claim to a setting.
Evidence to keep for your records of processing and a supervisory authority request
A supervisory authority will ask you to show what your gateway actually does with prompts, not only what your policy says. The cards below cover the artifacts that connect the LiteLLM configuration to your Article 30 record and your retention schedule, and each one needs refreshing when you upgrade LiteLLM.
Configuration exports as deployed
Keep a dated export of the proxy configuration file and the logging-related settings as they run in production, including turn_off_message_logging, store_prompts_in_spend_logs and any per-team logging overrides. Store exports in version control so each change has an author and a reason. On every LiteLLM upgrade, re-export and diff against the prior version, because default values and setting names can change between releases. Confirm the exact keys against the release you run.
Retention settings as deployed
Record the value of maximum_spend_logs_retention_period in force on each environment, plus the date the deletion schedule was last confirmed to run. Keep a query result showing the oldest spend log row, taken on a set date, so you can show that deletion works in practice and not only in configuration. Check after each upgrade that the scheduled job still runs, since a silent failure leaves personal data stored beyond the period you declared.
Test records for dummy personal data
Run a scripted test that sends synthetic personal data, such as a made-up name, email address and account number, through each team's route and then searches the spend logs, the database and any connected logging provider for those strings. Keep the test script, its inputs, the outputs and the date. Repeat the test after changes to redaction, prompt storage or logging callbacks. Use only fictitious values so the test does not itself create personal data.
Change history for logging settings
Keep a dated log of every change to prompt storage, message logging, redaction and retention, with the requester, approver and the reason. Include changes made through the admin UI, not only those in files. Tie each entry to the lawful purpose it serves and to the data protection impact assessment where one exists. This history lets you show that the setting in force on a given date matched the one you documented then.
Retention schedule feeding the Article 30 record
Maintain a schedule that lists each category of data in the gateway, such as prompt bodies, response bodies, spend metadata and error traces, with its storage period and deletion method. Article 30(1)(f) asks for envisaged erasure time limits where possible, and Articles 13(2)(a) and 14(2)(a) ask that privacy notices state the period or the criteria used. Link each schedule line to the matching configuration key so the record and the system agree. Review the schedule with your DPO whenever a setting or purpose changes.
GDPR text on EUR-LexUpgrade impact checks for logging controls
Before moving to a new LiteLLM release, record which logging, redaction and retention behaviors you rely on and test each one on staging. Keep the release notes you reviewed and the test results with the upgrade ticket. LiteLLM maintains support for the four most recent stable minor versions, so plan upgrades inside that window and keep evidence that each production move was tested. Confirm current release details on the GitHub releases page before scheduling.
- Supported minor versions
- 4
How prompt data flows through the gateway and where controls apply
A request starts at the caller and passes through the LiteLLM proxy, where virtual key checks run before anything is logged. The message logging switch and redaction decide what reaches logging callbacks, while the spend log store keeps metadata and, only if store_prompts_in_spend_logs is enabled, prompt content. A retention job deletes old spend logs on schedule. The trust boundary sits before the model provider: any provider outside your infrastructure receives prompt text, so check which region and jurisdiction that provider uses.
Where prompt content, logs and retention controls apply in a self-hosted LiteLLM gateway.
Questions buyers ask before hiring help with GDPR logging controls
What does the GDPR logging configuration work cost, and what drives the price?
Cost comes from the scope of the work, and DeployOpen does not publish a price list, so a quote follows from a written scope. The main drivers are how many model providers and teams the gateway serves, how many logging destinations need to be reviewed (the proxy's own spend logs, any callback or observability tool, and any SIEM), how many distinct retention rules you need, and how much testing is required to show that prompt bodies stay out of the stores you chose. Ask for a quote that lists each provider, team, logging destination and test case as a separate line, and state which items are one-time (configuration, testing, documentation) and which recur (retainers for upgrades, retesting and support). Ongoing support is available as a retainer.
How long does a GDPR logging controls engagement take?
The duration depends on the number of teams, providers and logging destinations in scope, how much of the data flow is already documented, and how quickly your DPO and security reviewers can approve the retention periods and redaction rules. Most engagements are fixed-scope, so the timeline is agreed in writing before work starts. Ask for a schedule that separates discovery of current prompt and log flows, configuration in a non-production environment, verification of what reaches each store, and the handover of records of processing documentation. Timing for any specific environment should be confirmed in the quote, not assumed from this page.
What does the work need from our DPO, security and platform teams?
The work needs three different inputs. Your DPO defines the purposes of processing, the storage periods or the criteria used to set them, and which categories of personal data may appear in prompts, since these feed the record of processing activities under Article 30(1)(f) and the privacy notice under Articles 13(2)(a) and 14(2)(a). Your security team approves the storage location of logs, access to them and how they are encrypted and pseudonymised, in line with Article 32(1)(a). Your platform team provides access to the proxy, its PostgreSQL database and any logging integrations, and owns the change process for the configuration. Agree on who signs off each decision before work starts so that the configuration is not held up later.
Can our internal team set this up using the LiteLLM documentation alone?
Often yes, if the team has engineers who already run the LiteLLM proxy and a clear privacy position. The LiteLLM logging documentation describes turning off message logging, the spend log retention setting and the prompt storage switch, and the per-request redaction header is in beta. What the documentation does not do is decide your retention periods, map the settings to your records of processing, or prove that personal data stays out of every destination. Those tasks need privacy and security sign-off, and the evidence needs to be repeatable. Your team should check each setting against a test prompt in a non-production environment, and confirm current behavior with the release notes of the version you run.
Can DeployOpen certify that our GDPR logging setup is compliant?
No. The GDPR requires no audit, attestation or certificate, and DeployOpen does not issue audit reports, attestations or certifications. DeployOpen configures the gateway, tests what the logs contain, and prepares the evidence and documentation your compliance team and any independent auditor or supervisory authority may ask for. Certification under Article 42 is voluntary, issued by accredited certification bodies or supervisory authorities, and does not reduce the controller's responsibility for compliance. Your organization remains the controller and decides whether its processing meets the GDPR.
How do upgrades to newer LiteLLM minor versions affect these settings?
Logging and retention settings must be checked after each upgrade, because a release can change defaults or how a setting behaves. LiteLLM maintains support for the four most recent stable minor versions for both open source and Enterprise deployments, so plan upgrades to stay within that window. Before moving to a newer minor version, rerun your test prompts, confirm that message logging is still off where you require it, confirm that spend log deletion still runs on schedule, and update the records of processing if the behavior changed. Ask for upgrade testing to be included in the scope or covered by a retainer.
Does the configuration keep every personal data field out of logs?
No configuration can promise that, and a reliable answer requires testing. Turning off message logging stops messages and responses from reaching logging providers while spend metadata is still tracked, but personal data may still appear in metadata such as user identifiers, team names or request fields your applications send. Redaction and prompt storage controls reduce what is kept, and retention deletes old spend logs on a schedule. The work should map each field your applications send, test whether it reaches each store, and document any residual personal data with its justification and storage period.
How DeployOpen scopes and delivers GDPR-aligned LiteLLM logging configuration
DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, including LiteLLM gateways. For GDPR prompt logging controls, we start from what personal data reaches your prompts and logs, then configure and document the controls that keep that data minimal and time-limited.
How we scope
- We map which teams send personal data in prompts and which logs, spend records and database tables would store it.
- We agree in writing which logging, redaction, prompt storage and retention settings are in scope before work starts.
- We confirm which LiteLLM features and release line your environment supports, and record the version we will configure.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing and a quote following from that scope.
How we build
- We configure message logging, prompt storage and spend log retention in your own LiteLLM deployment and database.
- We set per-team logging behavior and test that prompt bodies stay out of logs for the teams that require it.
- We verify retention deletion runs on schedule and that old spend logs are removed as the configured period requires.
- We check that the gateway, its PostgreSQL database and any Redis instance stay inside the infrastructure you control.
How we hand over
- We deliver a configuration record listing each logging and retention setting, its value and the reason it was chosen.
- We draft processing entries for your records of processing, including storage periods and data categories, for your privacy team to review.
- We document the verification steps and test results so your team can repeat them after upgrades or configuration changes.
- We walk your engineering, security and privacy staff through the settings and the operating runbook before closing.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers, covering retention checks and configuration drift.
- We can review the configuration again when a new team, model provider or LiteLLM release line is added to the gateway.
- We help you prepare the evidence your privacy and security reviewers ask for, while your legal team decides the lawful basis and notices.
- DeployOpen does not issue audit reports or certifications, so we prepare systems and evidence for your assessors instead.
Sources and further reading
- LiteLLM docs: Logging ↗
- LiteLLM docs: Maximum Retention Period for Spend Logs ↗
- LiteLLM docs: UI Spend Log Settings ↗
- Regulation (EU) 2016/679 (GDPR), EUR-Lex ↗
- EDPB Guidelines 01/2025 on Pseudonymisation (version for public consultation) ↗
- EDPB Recommendations 01/2020 on measures that supplement transfer tools (version 2.0) ↗

