How LiteLLM encryption in transit and at rest works in your environment
LiteLLM offers HTTPS at the proxy through --ssl_keyfile_path and --ssl_certfile_path or the SSL_KEYFILE_PATH and SSL_CERTFILE_PATH variables, it uses TLS for all connections to LLM providers by default, and LITELLM_SALT_KEY encrypts the provider credentials it stores in its database. Encryption of the PostgreSQL database and the Redis service underneath is not something the proxy provides for you. It depends on how those services are deployed, so each one needs its own review. A security or platform team should work through this section before go-live, when the gateway first carries prompts, virtual keys and spend data, and again during any security assessment that asks where that data travels and rests.
Start by mapping each hop. Client traffic to the proxy is protected only if the HTTPS listener is enabled or a load balancer or ingress terminates TLS in front of it, so confirm which layer holds the certificate, who renews it and whether traffic between the ingress and the proxy pods is also encrypted. Next, confirm that outbound calls to each approved provider use TLS and that your egress policy allows only the endpoints you have approved. For the stored data, decide who owns LITELLM_SALT_KEY, store it in the same secret manager as LITELLM_MASTER_KEY, and plan how it is rotated, because changing it affects how existing stored credentials are read. Record the key's location and owner in your configuration documentation so an auditor can trace it.
The final checks sit with the services underneath. Ask the database and cache owners to show encryption at rest for the volumes or managed storage that hold PostgreSQL and Redis data, and encryption in transit between the proxy and those services where your deployment supports it. Confirm this against the documentation for your chosen PostgreSQL and Redis versions and hosting model, since LiteLLM does not set these controls on your behalf. For the current release line, check the LiteLLM production deployment guide and the security and encryption FAQ against your own architecture before you write the evidence pack.
Where data is encrypted between clients, the proxy, providers and storage
Traffic starts at the client, which reaches the LiteLLM proxy over HTTPS either directly or through your ingress that terminates TLS. The proxy then calls each LLM provider over TLS, which LiteLLM applies by default. Its connections to PostgreSQL and Redis are different: their encryption depends on the database and cache settings you configure, not on LiteLLM alone. Check each solid edge in the diagram, and confirm that the salt key is set before any provider credential is stored.
Client to provider and storage paths, with the salt key protecting stored credentials.
Which encryption option fits each layer
This table compares the encryption options available at each layer of a self-hosted LiteLLM gateway, from client traffic to the proxy through provider calls, stored credentials and the database and cache underneath. Read each row for the trade-off and the condition under which that option fits, then confirm the details against your own build before you commit.
| Layer | Option | Trade-off | When it fits |
|---|---|---|---|
| Client to proxy | TLS at the proxy using SSL_KEYFILE_PATH and SSL_CERTFILE_PATH | Traffic is encrypted to the container itself, but you manage certificate files and renewal inside the pod or host | Single instance, or a deployment where clients connect straight to the proxy and no ingress terminates TLS |
| Client to proxy | TLS at a Kubernetes ingress or load balancer | Certificate lifecycle sits with the platform team, but traffic between the ingress and the proxy must be re-encrypted or kept on a trusted network | Multi-replica Kubernetes deployments where ingress already manages certificates and policy |
| Proxy to LLM providers | TLS on outbound calls, enabled by default | Requires no setup from you, but you still need to confirm egress rules and which provider endpoints your network allows | Every deployment; confirm the outbound path in your network policy |
| Stored provider credentials | LITELLM_SALT_KEY | Encrypts provider credentials in the database; losing or changing the key without a plan can make stored credentials unreadable | Any deployment that stores provider API keys in the database; keep the key in a secret manager |
| PostgreSQL storage | Volume or disk encryption and TLS to the database | Protects data at rest and on the connection, but depends on your platform and database settings, which you must confirm | Any production database holding virtual keys, spend and logs |
| Redis cache and state | TLS and authentication to Redis | Needed once more than one proxy instance shares rate limits and router state; confirm the Redis version and TLS support you run | Multi-instance deployments that share rate limits, router state or cache |
| Backups and snapshots | Encrypted backup storage with restricted keys | Covers copies outside the live database, which are often missed in reviews; key custody must be documented | Every environment, including those with point-in-time recovery |
Setting up HTTPS, salt key and data store encryption in order
This sequence takes a self-hosted LiteLLM gateway from plain defaults to encrypted client connections, a salt key held outside the application, and verified encryption for the database and cache beneath it. Following the order matters because the salt key must exist before the first credential is stored.
Choose the TLS termination point
Decide whether TLS ends at the LiteLLM proxy itself or at an ingress controller, load balancer or reverse proxy in front of it. Record the choice in the deployment design, along with who owns the certificate and where the private key is held. If an ingress terminates TLS, confirm the hop between ingress and proxy is also encrypted or sits on a network segment your security team has approved. Done when the design names one termination point and the owner of each certificate.
Provision certificates and key files
Have your PKI or certificate authority issue a server certificate whose names match the hostname clients will use, then place the certificate and private key on the proxy host or in the ingress secret store. Restrict read access on the private key file to the service account that runs the proxy. Check the certificate chain and expiry date with standard OpenSSL inspection commands before going further. Done when the chain validates against your trust store and the key file is readable only by the runtime account.
Configure HTTPS on the proxy
If the proxy terminates TLS, set the key and certificate paths with the documented flags, --ssl_keyfile_path and --ssl_certfile_path, or the SSL_KEYFILE_PATH and SSL_CERTFILE_PATH variables. Store the paths in your configuration-as-code repository, not in a shell history. Restart the proxy and confirm the startup log shows it listening with TLS enabled. Done when the proxy starts cleanly with the new settings and the log reflects the HTTPS listener.
Generate and store the salt key before first use
Generate LITELLM_SALT_KEY with a cryptographically strong random generator, then write it to your secret manager before any provider credential is saved to the database. The salt key encrypts provider credentials stored in LiteLLM's database, so changing it later affects those stored values, and the key should be treated as a long-lived secret. Inject it into the proxy at runtime from the secret manager rather than from a file in the image. Done when the proxy reads the value from the secret manager and a test credential can be saved and used.
Confirm PostgreSQL encryption settings
Work with your database team to confirm that PostgreSQL connections use TLS and that data at rest is encrypted by the storage layer, such as encrypted volumes or the managed service's storage encryption. Set the proxy's database connection to require TLS, and record the CA used to verify the server. Confirm backups and snapshots inherit the same encryption. These controls are a property of the database platform and the infrastructure, so confirm the exact settings with your platform owner and the PostgreSQL version you run. Done when a connection with TLS required succeeds and the storage encryption status is written down.
Confirm Redis encryption settings
Redis is required once more than one proxy instance runs, and it holds shared rate limits, router state and cache. Confirm that Redis connections use TLS where your Redis deployment supports it, and that its storage volumes or managed service are encrypted at rest. Check the Redis version against the requirement of 7.0 or newer from LiteLLM's production guide. Ask your platform owner to document which of these settings are available in your Redis build or service. Done when the proxy connects to Redis over the chosen transport and the version and encryption status are recorded.
Verify HTTPS and reject plain HTTP
From a host outside the proxy, use a test client such as curl with the proper CA to call the HTTPS endpoint and confirm a valid response. Then send a request to the plain HTTP port, if one is reachable, and confirm the connection fails or is refused rather than serving the API. Repeat the test from the network segment your clients use. Keep the test results with the change record. Done when the HTTPS request succeeds with certificate validation and the plain HTTP request is refused.
What happens to stored credentials if the salt key changes
LITELLM_SALT_KEY encrypts the provider credentials that LiteLLM stores in its database, so the key is part of the data set, not a configuration detail. The database holds the ciphertext, and the salt key is what makes it readable by the proxy. A database backup without a matching copy of the salt key can restore the rows but not the credentials in them, so the gateway may start with its model routes intact and fail every upstream call. Treat the salt key with the same care as the database: store it in your secret manager, record which environment it belongs to, and include it in the same recovery runbook that restores PostgreSQL.
The larger risk is changing the key without a documented procedure. If the value in the environment differs from the one used to encrypt the stored credentials, the proxy cannot decrypt them and provider calls fail until the credentials are re-entered or re-encrypted. This is most likely during a rebuild, a move to a new cluster, or a secret rotation done by someone who does not know the key is in use. Before any change, ask the vendor to confirm in writing how LiteLLM handles salt key rotation, whether stored credentials can be re-encrypted in place, and what a rollback looks like. Confirm this against the current LiteLLM production deployment documentation and your pinned version, since behavior can differ between releases.
Write the procedure before you need it. It should name the owner of the key, where each environment's key is stored, a tested restore of a database backup paired with its salt key into a non-production instance, and the steps and test calls used to verify that stored provider credentials still work after any change. Keep the salt key out of application code, logs and shared configuration files, and restrict who can read it in the secret manager. Until the rotation behavior is confirmed, plan any change as a one-way step that requires a verified backup of both the database and the current key.
Security and operational considerations for encrypted LiteLLM traffic
Turning on TLS and salt key encryption is the start, not the finish. The cards below cover the operational duties that keep those controls working over time: renewing certificates, protecting keys, keeping admin traffic encrypted behind load balancers, and making sure backups, caches and logs do not undo the protection.
Certificate lifecycle and renewal
Each certificate loaded through --ssl_certfile_path or SSL_CERTFILE_PATH expires, and the proxy will not renew it for you. Record the issuer, expiry date and owner of every certificate, and rotate them on a schedule that is tested before the deadline. Confirm with your platform team whether a restart or a rolling pod replacement is needed to load a new certificate, since that determines whether rotation causes downtime. Check the chain on the proxy, not just on the certificate file.
Private key storage
The TLS private key that sits next to the proxy is the most sensitive file in this setup. Store it in your secret manager or Kubernetes secret store with restricted read access, and mount it into the container at runtime rather than baking it into an image or a configuration file in source control. Limit who can read the secret, log access to it where your platform supports that, and confirm that backups of the cluster do not expose it in plain text.
Admin UI and API on HTTPS behind load balancers
Encryption often ends at the load balancer or ingress, so traffic from there to the proxy can travel in plain text unless you configure it otherwise. Decide whether the internal hop will be encrypted, and test both the admin UI login and the API paths, including the browser sessions used by administrators. Confirm that the proxy's view of the client protocol matches what is actually received, so that redirects and secure cookies behave correctly.
Backup encryption
Database backups contain the same stored provider credentials that LITELLM_SALT_KEY protects, so an unencrypted dump undoes the protection on the live database. Encrypt PostgreSQL backups at rest with a key managed separately from the database host, and restrict who can restore them. Keep the salt key recoverable alongside the backup set, because a restored database cannot decrypt its stored credentials without it. Test a restore in a non-production environment.
Cache data in Redis
Redis holds shared rate limits, router state and cache entries once more than one proxy instance runs. Those entries can include request or response content, depending on how caching is configured. Confirm with your team whether caching is enabled, what it stores, and whether Redis is reachable only from the proxy network. Apply transport encryption to the Redis connection where your deployment supports it, and set eviction and retention settings that match your data policy.
- Minimum Redis version
- 7.0
Logs that must not capture secrets
Request logs, debug output and error traces can capture authorization headers, virtual keys or provider credentials if logging is set to a verbose level. Set log levels deliberately for production, review what your logging pipeline forwards to the SIEM or storage, and confirm that the master key and provider keys never appear in output. Test this with a deliberately failed request, then search your log store for the key values you used.
Questions buyers ask about encrypting a self-hosted LiteLLM gateway
What does it cost to encrypt a self-hosted LiteLLM gateway?
No price is published for this work, and DeployOpen does not publish a price list. A quote follows from a written scope. The main cost components are the time to design certificate and key handling, configure TLS at the proxy or ingress, set up TLS to providers, and encrypt or secure the PostgreSQL and Redis services underneath. Costs rise with the number of environments, the number of certificate authorities involved, how many provider connections need review, and whether the database and cache are already encrypted. Ask any provider for a fixed-scope quote that lists each of these items separately, and confirm which parts recur, such as certificate renewal and key rotation, and which are one-time.
How long does an encryption review of a LiteLLM gateway take?
Duration depends on the environment more than on the LiteLLM configuration itself. A single gateway with an existing certificate authority, a managed database and a managed cache is usually quicker to review than a multi-region setup with separate teams owning ingress, the database and the cache. Timing also depends on how quickly the client can provide certificate chains, access to the database and Redis settings, and approval for changes in production. No fixed duration is supplied for this work, so ask for a timeline in the written scope and confirm the dependencies on your side before work starts.
What must our team provide before encryption work starts?
Plan to supply the items that only your organization controls. These usually include:
- Certificates and private keys for the proxy or ingress, along with the chain that clients trust, issued by your certificate authority or a public one you approve.
- A decision on key management for
LITELLM_SALT_KEYand the secret manager that holds it, including who can read and rotate it. - Connection details and admin access for PostgreSQL and Redis, including the TLS settings your database and cache already support.
- Egress rules and the provider credentials needed to test TLS connections to each model provider.
If any of these are missing, the work stalls, so confirm ownership and access in the written scope.
Can our internal platform team encrypt the LiteLLM gateway alone?
Often yes, if the team already runs TLS certificates, Kubernetes ingress and a secret manager, and has administrator access to PostgreSQL and Redis. The work is mostly configuration and verification, but mistakes are easy to make in key handling, such as losing the salt key or changing it without a plan for stored credentials. An internal team usually needs time to test each path, including client to proxy, proxy to providers and proxy to the data stores. Decide early whether you want an outside review of the design, an implementation, or a combination, and write that choice into the scope.
What goes wrong when TLS and salt key settings are configured without a plan?
The most common failures are clients that reject the certificate chain, health checks that fail after a certificate change, and a lost or rotated LITELLM_SALT_KEY that leaves stored provider credentials unreadable. Database and Redis connections can also fail silently if TLS is enabled on one side and not the other. Engineers should check each connection path after every change and keep a tested rollback. Record which secret manager holds the salt key and who approves rotation, so an outage does not become a data recovery problem.
Can DeployOpen prepare evidence for a compliance assessment without issuing an audit report?
Yes, DeployOpen can prepare the systems, controls and evidence that an assessment will ask for, such as configuration records, certificate and key handling procedures, and test results for each TLS path. DeployOpen does not issue audit reports, attestations or certifications. Independent auditors and certification bodies perform those assessments and decide whether the controls meet the applicable requirements. Ask in advance which evidence your assessor expects, and agree in writing which artifacts DeployOpen will deliver.
Does encrypting the gateway also require a LiteLLM Enterprise license?
The supplied sources state that HTTPS at the proxy using --ssl_keyfile_path and --ssl_certfile_path, or the SSL_KEYFILE_PATH and SSL_CERTFILE_PATH variables, is available in both open source and Enterprise. LiteLLM also uses TLS for connections to LLM providers by default. Encryption of stored credentials depends on LITELLM_SALT_KEY, which the production deployment documentation describes. Confirm the license needed for any other control in your design, such as IP allowlisting or secret manager integrations, which the Enterprise documentation lists separately.
What evidence your security team will ask for
Your security team will want to see the configuration that proves data is encrypted, not a description of intent. For the proxy, that means the TLS settings in the deployment: the --ssl_keyfile_path and --ssl_certfile_path arguments or the SSL_KEYFILE_PATH and SSL_CERTFILE_PATH variables, the certificate chain and its issuer, and the ingress or load balancer manifest that terminates TLS in front of the proxy. Ask who owns the private key, where it is stored and how rotation is handled. Confirm with your platform team whether TLS terminates at the proxy, at ingress, or at both, because the reviewer will ask which hop is the last unencrypted one.
The secret store entry for LITELLM_SALT_KEY is the artifact most often requested and most often mishandled. Provide the entry's name, its location, the access policy that limits who can read it and the audit trail of reads, but never the value itself. Also record where the salt key is backed up and what happens to stored provider credentials if it is lost or changed, since the proxy uses it to encrypt provider credentials kept in its database. For data stores, collect the encryption settings for the PostgreSQL volumes and backups and for Redis, including whether in-transit TLS is enabled between the proxy and each service. Confirm these settings with your cloud or database team rather than assuming the managed defaults match your policy.
Test results close the gap between configuration and behavior. Run a request against the plain HTTP port and record that it is refused or redirected, then record a successful TLS handshake with the expected certificate and protocol versions. Capture a connection test from the proxy to one provider endpoint to show that outbound calls use TLS. DeployOpen can prepare these artifacts, run the tests and organize the evidence for your compliance team, but independent auditors and certification bodies issue any assessment report or attestation. Agree in writing with your assessor which artifacts they accept and in what format before the evidence is collected.
How DeployOpen scopes and delivers encryption hardening for LiteLLM
DeployOpen plans, implements and documents encryption for a LiteLLM gateway inside infrastructure you control, covering the proxy listener, provider connections, stored provider credentials and the PostgreSQL and Redis services beneath them. The work runs as a fixed-scope engagement with the written scope, deliverables and timeline agreed before any change is made.
How we scope
- We inventory every path that carries prompts, keys and spend data, including client connections, provider calls, database and Redis traffic.
- We record where TLS terminates today, whether at the proxy or at an ingress, and which certificate authority issues the certificates.
- We confirm with you who owns the LITELLM_SALT_KEY value, where it is stored and how it would be rotated before any change is agreed.
How we build
- We configure HTTPS at the proxy with the documented certificate and key path settings, or set up TLS at your ingress, and test both paths.
- We check that outbound connections to each model provider use TLS, and we document any internal endpoint that does not.
- We set up encryption for PostgreSQL and Redis in your environment and verify that the gateway connects to them over encrypted channels.
How we hand over
- You receive a written configuration record listing each encrypted path, the certificate source, the key storage location and the owner of each setting.
- We deliver test evidence showing protocol checks on each listener and connection, with the commands used so your team can repeat them.
- We provide a runbook for certificate renewal, salt key handling and database or Redis encryption changes during upgrades.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after the initial handover.
- We can retest encryption settings after LiteLLM upgrades, infrastructure changes or certificate rotation, as agreed in the written scope.
- A quote follows from the written scope, so ask for the components, the environments covered and the retest cycle to be listed.

