From 9e8b247ac8b768d4b7f91c3111bfa188f0e8d103 Mon Sep 17 00:00:00 2001 From: Scott Zhu Date: Mon, 2 Nov 2026 22:31:36 +0800 Subject: [PATCH] Say that the AI Gateway's spend log keeps prompts and responses by default Since #363, spendLogs.storePrompts is true by default, and LiteLLM's spend log keeps the request and the response of each call. PRIVACY.md still said that the records held no prompt or response. It now says what they hold, that LiteLLM shortens each value longer than 2,048 characters, who can read them, and what storePrompts: false changes. The security page lists the spend log with the other logs, and the Gateway chart README says what the prompt is and how LiteLLM shortens it. --- PRIVACY.md | 33 +++++++++++++++++++------ app/cetirun-ai-gateway/chart/README.md | 6 +++++ site/content/en/docs/security/_index.md | 11 +++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/PRIVACY.md b/PRIVACY.md index 2628f1aff..86a740d15 100644 --- a/PRIVACY.md +++ b/PRIVACY.md @@ -7,11 +7,13 @@ statement that a particular deployment was inspected. It is also not a promise about third-party services or a substitute for the operator's own privacy notice. -**The default configuration can collect conversation content in container logs.** -The agent chart enables the session logger. The infrastructure templates enable -Container Insights and managed Prometheus configuration. Before you allow -sensitive workloads, examine these settings. There is no single CetiRun setting -that disables logging, telemetry, and network activity across every component. +**The default configuration can collect conversation content in container logs +and in the AI Gateway's database.** The agent chart enables the session logger. +The infrastructure templates enable Container Insights and managed Prometheus +configuration. The AI Gateway keeps the request and the response of each model +call in its database for seven days. Before you allow sensitive workloads, +examine these settings. There is no single CetiRun setting that disables +logging, telemetry, and network activity across every component. ## Data processed by CetiRun @@ -19,7 +21,7 @@ that disables logging, telemetry, and network activity across every component. | --- | --- | --- | | Portal and sign-in | User alias, preferred username, display name, email claims, group authorization, and administrator status. These items are used to identify users and authorize access. | Browser, OAuth2 Proxy/identity provider, portal request context, and application logs. Instance ownership/profile fields are also stored in Kubernetes resources. | | Workspace management | Instance and team names, owner alias, model selection, profile information, configuration, status, events, and resource identifiers | Portal, operator, Kubernetes API objects, Helm release state, and operational logs | -| Agent activity | Prompts, responses, files, tool arguments/results, session history, and user/team context | Agent process and workspace storage. Configured model, tool, and channel services. Possibly container logs. | +| Agent activity | Prompts, responses, files, tool arguments/results, session history, and user/team context | Agent process and workspace storage. Configured model, tool, and channel services. The AI Gateway's database, for seven days by default. Possibly container logs. | | Authentication material | Gateway/API keys, provider credentials, OAuth device-flow state, and optional Tailscale credentials | Kubernetes Secrets, mounted configuration, agent home files, process memory, and the services that authenticate them | | Browser and terminal | Commands/output, visited pages, downloads, screenshots, browsing history, and browser login state | Workspace processes and storage. Websites or services that the browser/tools contact. Terminal/desktop streams that go to the user. | @@ -96,7 +98,20 @@ and Team. Unless `spendLogs.enabled` is `false`, the database also keeps LiteLLM's own record of each call in `LiteLLM_SpendLogs`. The recorded calls also include health-check probes. Each record contains the call's metadata, for example the key, user, Team, model, token counts, spend, timing, and the error -of a failed call. It does not contain the prompt or response of the call. +of a failed call. + +By default (`spendLogs.storePrompts: true`), each record also contains the +request and the response of the call. These include the messages, images, +tool calls, and tool results that an Agent sends, and the model's answer. +LiteLLM shortens each value that is longer than 2,048 characters, and keeps its +start and its end. As a result, a long message or an image is stored only in +part. The Gateway console's request log pages show these records. Anyone who +can sign in to the console, use the Gateway's master key, or read its database +or its backups can read them. + +With `spendLogs.storePrompts: false`, each record contains only the metadata. +This setting does not remove the content of records that are already stored. +A `general_settings` block that is saved in the console can override it. When these rows and the stored health-check results are older than `spendLogs.retention`, LiteLLM deletes them. The default value is seven days, @@ -106,7 +121,9 @@ Source: [Gateway chart defaults](app/cetirun-ai-gateway/chart/values.yaml), [platform chart defaults](app/cetirun-platform/values.yaml), [request log callback](app/cetirun-ai-gateway/cetirun_ai_gateway/request_log.py), the [entrypoint that registers it](app/cetirun-ai-gateway/entrypoint.py), -and [LiteLLM configuration](app/cetirun-ai-gateway/chart/templates/configmap.yaml). +[LiteLLM configuration](app/cetirun-ai-gateway/chart/templates/configmap.yaml), +and the Gateway chart's +[spend log section](app/cetirun-ai-gateway/chart/README.md#litellms-spend-log). ### Infrastructure collection and traffic metadata diff --git a/app/cetirun-ai-gateway/chart/README.md b/app/cetirun-ai-gateway/chart/README.md index 4fb999ff0..fcaae271a 100644 --- a/app/cetirun-ai-gateway/chart/README.md +++ b/app/cetirun-ai-gateway/chart/README.md @@ -2544,6 +2544,12 @@ metadata, prompt, and response. The default of `spendLogs.storePrompts` is with the selected boolean. This default applies to new installs and to upgrades that have no explicit value for `storePrompts`. It can store sensitive content. +The prompt is the request body of the call: the messages, with images and tool +results, and the tools. LiteLLM shortens each value in it, and in the response, +that is longer than 2,048 characters, its `MAX_STRING_LENGTH_PROMPT_IN_DB` +default. It keeps the start and the end of the value. As a result, an image is +stored only in part. + To keep the call metadata, but not to store prompts or responses, use these values: diff --git a/site/content/en/docs/security/_index.md b/site/content/en/docs/security/_index.md index a5185d47d..63bf173f7 100644 --- a/site/content/en/docs/security/_index.md +++ b/site/content/en/docs/security/_index.md @@ -148,6 +148,17 @@ still contain sensitive data. Portal, operator, agent, and tool logs are other data sources. `desktop.logging: false` disables x11vnc/websockify output, but Chrome stderr still reaches container stderr. +The AI Gateway keeps a record of each model call in its PostgreSQL database +(`LiteLLM_SpendLogs`). By default (`spendLogs.storePrompts: true`), the record +also contains the request and the response of the call: conversation text, +images, tool calls, and tool results. LiteLLM shortens each value that is +longer than 2,048 characters. The Gateway deletes these records after seven +days (`spendLogs.retention`). The Gateway console's request log pages show +them. Restrict who can sign in to the console, use the Gateway's master key, +and read its database and backups. To keep only the metadata of each call, set +`spendLogs.storePrompts: false`. Refer to the Gateway chart's +[spend log section]({{< repo "app/cetirun-ai-gateway/chart/README.md" >}}#litellms-spend-log). + Restrict access to logs and monitoring workspaces. Document the retention, redaction, and deletion procedures. If you disable one logger, you do not disable every agent, provider, browser, tool, or infrastructure collection