LiteLLM audit logs

LiteLLM audit logs record who created, changed, deleted or regenerated keys, teams, users and models on a self-hosted gateway. They identify people only when sign-in goes through SSO, and they require an Enterprise license.

On this page

What LiteLLM audit logs record and when you need them

A security or compliance team that needs to know who changed access on a shared LiteLLM gateway needs an audit trail, and on a self-hosted gateway that trail exists only under an Enterprise license. LiteLLM audit logs record create, update, delete and regenerate actions on keys, teams, users and models, along with the identity of the person who performed each action. Without the Enterprise license, you cannot rely on this record, so the license decision comes before any compliance commitment about gateway access.

The actions in scope matter because they are the changes that alter what a caller can reach. Creating or regenerating a virtual key issues new access, updating a key or team can raise budgets or widen the models a key may call, and deleting a user or model removes or reroutes capacity. Confirm with LiteLLM which fields each event captures in your version, since the audit log is only useful if it shows the before and after state of these changes. Map each control your assessors expect for access changes to a specific action in this list, and test one change of each type in a non-production gateway before you rely on the record.

Decide early whether you need the trail at all. If the gateway serves more than one team, holds provider credentials, or sits in scope for a control that asks you to review privileged access, plan for audit logs from the first deployment rather than adding them after an incident. Confirm your license terms and the edition that covers your user count with LiteLLM before you commit, and note that the identity rules in the next section decide whether the trail names people or only the shared admin account.

Audit log configuration options and when each fits

This table compares the settings that turn LiteLLM audit logs on, off and into export, and states what each one does not do. Read it as a decision aid: pick the control that matches how much override you need, then add export only when the trail must leave the gateway.

OptionWhat it controlsWhen it fitsWhat it does not do
store_audit_logs in litellm_settingsExplicitly turns audit log storage on or off in the proxy configuration fileTeams that manage configuration as code and want the setting recorded in version controlDoes not send records to external storage and does not create an Enterprise license
LITELLM_STORE_AUDIT_LOGS environment variableExplicitly turns audit log storage on or off at the container or deployment levelPer-environment overrides, such as switching storage off in a test deployment without editing shared configDoes not export logs and does not identify users unless SSO is in place
Default behavior with an Enterprise licenseAudit logs are on when no explicit setting is suppliedEnterprise deployments that want logging without extra configuration; confirm the default in your releaseDoes not apply without an Enterprise license, and does not replace an explicit setting if you need one
audit_log_callbacks set to s3_v2Exports audit logs asynchronously to an S3 bucket as JSON files under audit_logs/<YYYY-MM-DD>/Retention in object storage you control, or feeding logs to a SIEM or archive pipelineDoes not store logs by itself; storage must be on, and the bucket's retention, access and encryption are your responsibility
Local database storage onlyKeeps the audit trail in the gateway's PostgreSQL databaseSmall deployments where the database backup policy already covers the trailDoes not survive database loss unless backed up, and does not separate the trail from gateway administrators

Setting up audit logs and S3 export on a self-hosted gateway

This sequence takes a self-hosted LiteLLM gateway from a standard deployment to one that records who changed keys, teams, users and models, and copies those records to an S3 bucket you control.

  1. Confirm the Enterprise license

    Before any configuration, confirm with your LiteLLM account contact or procurement record that your organization holds an Enterprise license that covers this gateway. Audit logs require an Enterprise license, so open source installs cannot record these events. Check the license is active on the proxy before continuing. You know this step is done when the license is recorded in your change ticket with the deployment it covers, and the proxy starts with it loaded.

  2. Place PostgreSQL under the gateway

    Confirm the gateway runs on PostgreSQL, the primary supported database, because virtual keys and the audit trail depend on it. Verify the database is reachable from every proxy instance, that backups cover it, and that the connection string is held in your secret manager rather than in plain configuration files. You know this step is done when the proxy starts cleanly, creates or migrates its tables, and a test key can be created and listed through the admin API or UI.

  3. Enable SSO for admin sign-in

    Configure SSO for the admin UI with your identity provider, such as Google, Microsoft Entra ID, Okta or a generic OIDC provider, so each administrator signs in as a named person. This matters because the audit trail records the signed-in identity. Shared values such as the master key or UI_USERNAME and UI_PASSWORD make every action appear as the proxy admin. Confirm the SSO login maps to a distinct user record. You know this step is done when two administrators sign in with their own accounts and each sees their own identity in the admin UI.

  4. Set store_audit_logs explicitly

    Add store_audit_logs under litellm_settings in the proxy configuration, or set LITELLM_STORE_AUDIT_LOGS, so the setting is visible in version control rather than left to the default that applies with an Enterprise license. Set it to true for this environment and keep the configuration in the same repository as other gateway settings. Restart the proxy and confirm it loads the new setting in its startup logs. You know this step is done when the configuration file and the running instance both show audit logging on.

  5. Configure the s3_v2 callback and bucket access

    Set audit_log_callbacks to s3_v2 and give the proxy credentials with write access to the target bucket, preferably an IAM role or workload identity rather than long-lived access keys. Restrict the permissions to the audit prefix, and confirm the bucket has the retention, encryption and access logging your policy requires. Apply the change and restart the proxy. You know this step is done when the proxy starts with the callback loaded and reports no authentication or permission errors when it first writes.

  6. Make a test change and find it in the bucket

    Create a test virtual key, then regenerate or delete it, signing in as a named administrator. Wait for the asynchronous export, then open the bucket and look for JSON files under audit_logs/ with today's date in YYYY-MM-DD form. Open one file and confirm it records the action, the object affected and the administrator who performed it. You know this step is done when the matching record for your test change is in the bucket and names your administrator account.

  7. Test a failed write and document the trail

    Confirm the export handles failure: temporarily remove write permission for a test prefix or point the callback at a bucket you cannot reach in a non-production environment, make a change, and confirm your monitoring or proxy logs show the failure. Restore access and check that the change is exported. Record the owner, bucket, prefix and retention settings in your operating runbook. You know this step is done when a failure is visible to operators and the restored export delivers the record.

How an admin action becomes an exported audit record

The trail starts when an administrator signs in through SSO and changes a key, team, user or model on the proxy. The proxy writes the audit record to its PostgreSQL database in the same request, so the record exists before any export happens. A separate asynchronous exporter then reads those records and writes JSON files to S3 under a date prefix. The trust boundary sits between the gateway and the bucket: check that the exporter's credentials, bucket policy and retention are controlled by your team, not the gateway's admin accounts.

Admin change flows through the proxy, database and exporter into S3.

Security and operational considerations for the audit trail

An audit trail only helps if the gateway's admin path, the people who can change keys, and the export bucket are all controlled. The cards below cover the six places where a LiteLLM audit trail is most often weakened, and what to confirm in your own environment before relying on it.

Protect the master key and admin credentials

The master key (LITELLM_MASTER_KEY, which must start with sk-) acts as proxy admin, and anyone holding UI_USERNAME and UI_PASSWORD signs in with the same authority. Store both in a secret manager, limit who can read them, and rotate them on a schedule your security team sets. Because shared admin values erase individual attribution, confirm that all routine administration happens through named SSO accounts rather than these shared credentials.

Moving from OSS checklist

Restrict who can change keys

Creating, updating, deleting and regenerating keys, teams, users and models are the actions the trail records, so the set of people allowed to perform them defines what the trail can prove. Map admin roles to a short list of named operators, and review that list whenever staff change. Confirm in your own test environment which roles can perform each action before you rely on the log for an investigation.

Bucket permissions and retention

Exported audit_logs/<YYYY-MM-DD>/ objects should be writable only by the gateway's export identity and readable by a small review group. Deny deletes to everyone else, including platform administrators, and set a retention period that matches your record-keeping policy. Ask the storage team which bucket policy, encryption and lifecycle rules apply, and test that the gateway can write without holding delete rights.

Object immutability choices

Decide whether exported logs must resist modification or deletion for a fixed period. Options depend on the storage platform, so ask the storage team whether object lock or an equivalent write-once setting is available for the bucket, and whether it applies per object or per bucket. Confirm this before go-live, because changing it later may not rewrite objects already stored.

Monitor export failures

Audit export runs asynchronously, so a failing destination can leave a gap that nobody notices until an investigation. Alert on export errors in gateway logs, and check that daily prefixes appear in the bucket as expected. Test the failure path deliberately, for example by revoking write access in a non-production bucket, and confirm which alert fires and who receives it.

Keep the trail reviewable

A trail is only useful if the security team can query it without engineering help. Agree on the fields they need (actor, action, target, timestamp), decide how JSON files are indexed or searched, and run a sample review each quarter. Record who reviewed which period and what they found, so the review itself becomes evidence. Confirm the exact field names in your gateway version before writing queries.

Retention, export and review of the S3 trail

The S3 export needs its retention rules in the bucket, not in LiteLLM. With audit_log_callbacks set to s3_v2, LiteLLM writes JSON files under audit_logs/<YYYY-MM-DD>/, so each day's trail is a set of objects in a predictable prefix. Retention, lifecycle transitions and deletion belong in the bucket policy and lifecycle configuration that your storage platform enforces, with object locking or versioning where your compliance owner requires tamper resistance. The gateway's own database copy is a separate concern. Audit records there grow with every key, team, user and model change, and they need a cleanup schedule of their own. Confirm with your compliance owner which retention period applies to the audit trail, how long the database copy must stay queryable, and which storage platform holds the bucket (on-premises object storage that speaks the S3 API, or a cloud service). Those answers decide the lifecycle rules and who can delete objects.

A security team reviews the trail by listing a date prefix, such as audit_logs/2026-10-14/, and reading the JSON for create, update, delete and regenerate actions on keys, teams, users and models. Each record names the actor, so the review question is whether that actor maps to a named person. That mapping only works when administrators sign in through SSO, as described in the SSO section. Build a short review routine: pull the prefixes for the review window, filter for regenerate and delete actions on keys and for changes to user roles, then match each actor to the identity provider account and confirm the change had an approved ticket. Test the routine before you need it by making a known change in a non-production gateway and finding it in the export. Confirm the exact field names in your LiteLLM version's audit log output, since the review queries depend on them.

Limits to confirm before relying on audit logs

The audit trail is only as useful as its coverage, its licensing and its export path. Each card below is a check to complete in your own environment before a compliance reviewer or incident responder depends on the log.

Enterprise license requirement

Audit logs require an Enterprise license, so an open-source deployment does not have this trail at all. Confirm the license covers the gateway before the design assumes the log exists. Ask your LiteLLM contact to confirm the license terms in writing, and check whether the license applies to every proxy instance you plan to run. Treat a missing license as a gap in your control design, not a configuration detail.

Enterprise docs

Version includes the documented features

Audit log behavior, settings and export options can change between releases. Check the release you run against the audit logs documentation, not an older blog post or a colleague's notes. Confirm that the version you pin supports the store_audit_logs setting and the s3_v2 callback in your configuration. Record the version in your change records so a later upgrade can be compared against the same behavior.

Supported minor versions
4
LiteLLM releases

Actions the trail does not capture

The trail covers create, update, delete and regenerate actions on keys, teams, users and models. It does not, by the documented scope, record ordinary API requests, prompt content or spend events, so those need their own logs. Ask the vendor to confirm any action outside the listed set, such as changes to routing or guardrail settings made in the configuration file, and plan where those changes are recorded.

Export behavior during outages

Export to S3 runs asynchronously, so a bucket outage, expired credentials or a blocked network path can delay or drop records without stopping the gateway. Confirm how the export retries, how long records remain available locally before they are lost, and what alerts fire when export fails. Test a deliberate bucket permission failure and check that gaps are visible, not silent.

The 5-user SSO free limit

From v1.76.0, SSO for the admin UI is free for up to 5 users, and an Enterprise license is needed beyond that. Audit entries identify people only when logins are tied to SSO identities, so a team larger than five that signs in with shared or local credentials will produce a trail that names the admin account, not the person. Confirm how your identity provider maps to named users before you count on attribution.

Admin UI SSO docs

Test the trail in your environment

Vendor documentation describes what the trail should contain, but your deployment decides what it actually holds. Create a test key, change a team, regenerate a key and delete a user, then find each event in the exported S3 objects under the date-based prefix. Confirm the actor name, the time and the target for each action. Repeat the test after every upgrade and keep the evidence with your compliance records.

Questions buyers ask about LiteLLM audit logs

What drives the cost of setting up LiteLLM audit logs?

The main cost drivers are the LiteLLM Enterprise license, the identity provider integration for SSO, and the S3 bucket and IAM work for export. Audit logs require an Enterprise license, so that subscription is a recurring cost paid to LiteLLM. The SSO setup and bucket and IAM configuration are one-time engineering work, typically quoted by the implementation partner or your own team. Costs rise when your identity provider needs custom claim mapping, when you run several environments, or when retention and access policies for the bucket must match an internal standard. Ask for a quote that separates license, configuration, and verification effort so you can see what recurs.

Why does SSO have to be in place before audit logs are useful?

Audit logs only identify people when each admin signs in with their own identity. The LiteLLM Admin UI also accepts UI_USERNAME and UI_PASSWORD or the master key, and anyone holding those values signs in as proxy admin, so the log records an admin role instead of a named person. Configuring SSO with Google, Microsoft Entra ID, Okta or a generic OIDC provider ties every create, update, delete and regenerate action to an individual account. Shared credentials should be retired for day-to-day administration and kept for break-glass use under separate control.

How long does it take to set up and verify LiteLLM audit logs?

No duration is fixed for this work, because it depends on the identity provider, the number of environments, and how the S3 bucket and IAM roles are governed in your AWS account. Enabling audit logging on an Enterprise deployment is a configuration change, while SSO, bucket policy, and export verification take most of the effort. Verification should include creating, changing, and deleting a test key, team, user and model, confirming each action appears with the correct signed-in identity, and checking that JSON files land under the audit_logs date folders. Ask any provider to write the verification steps into the scope before work starts.

What does the work need from our side?

The work needs access to your identity provider so SSO can be registered and tested, an AWS account where the export bucket and IAM policies can be created, and a PostgreSQL database that the LiteLLM proxy uses for its state. You will also need an Enterprise license key and a named owner who can approve the bucket retention and access settings. Confirm in advance who can create IAM roles, who receives identity provider admin rights for testing, and which change window applies to the gateway. Missing access is the most common reason these projects stall.

Can our internal team set up LiteLLM audit logs alone?

Yes, a team with experience in LiteLLM, your identity provider and AWS IAM can configure audit logs without an outside partner. The configuration itself is small: enable store_audit_logs or LITELLM_STORE_AUDIT_LOGS, set audit_log_callbacks to s3_v2, and grant the proxy write access to the bucket. The harder parts are SSO integration, least-privilege IAM, and proving that the trail identifies people correctly. If your team lacks one of those skills or needs independent evidence for an assessment, a fixed-scope engagement with written deliverables is a practical alternative.

How do audit logs differ from request spend logs?

Audit logs record administrative changes: who created, updated, deleted or regenerated keys, teams, users and models. Spend logs record the usage side, such as which key or team made requests, the model used and the cost of each call. Audit logs need an Enterprise license and export to external storage for long-term review, while spend log retention is a separate setting with its own privacy and table-growth considerations. Both matter for governance, but an investigation into a changed budget or a regenerated key needs the audit trail, not the spend data.

Does DeployOpen issue audit reports or certifications for our gateway?

No. DeployOpen plans, implements, documents and prepares evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. For audit logs, the implementation can produce configuration records, SSO settings, bucket policies and test evidence that your assessors can review. Independent auditors and certification bodies make the assessment decision. Ask your assessor which evidence format they expect before configuration begins so the export and documentation match their request.

How DeployOpen scopes and delivers audit log setup

DeployOpen plans and builds LiteLLM audit logs inside your own infrastructure, starting with the identity model so each recorded change maps to a named person. The work is fixed-scope, with the enterprise license, SSO, storage export and handover agreed in writing before any configuration changes.

How we scope

  • Confirm the LiteLLM Enterprise license status and which edition your gateway will run on before work starts.
  • Inventory who creates, changes and regenerates keys, teams, users and models, and which admin accounts exist today.
  • Agree in writing whether break-glass use of UI_USERNAME or the master key is allowed and how it will be recorded.

How we build

  • Connect the Admin UI to your identity provider first, so audit entries identify people rather than the shared proxy admin.
  • Set store_audit_logs explicitly in the gateway configuration and verify create, update, delete and regenerate events are written.
  • Configure the S3 export with audit_log_callbacks set to s3_v2, then test that JSON files appear under the dated audit_logs prefix.

How we hand over

  • Deliver a runbook that shows how to query audit events by actor, action and object for a given date range.
  • Document the bucket policy, retention settings and access rights for the people who read the exported trail.
  • Walk your security and compliance teams through a test change and its resulting audit record before sign-off.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after the initial handover.
  • Retest audit coverage after each LiteLLM upgrade, identity provider change or export configuration change.
  • Keep the written scope as the reference for any later changes so additional work is quoted against agreed deliverables.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.