# Data inventory

**Last updated:** 2026-11-27T07:51:36-03:00 (UTC-3)

[Security and trust](/docs/security/trust/) · [Cryptography](/docs/security/cryptography/) · [Retention](/docs/features/metadata-retention/)

What the gateway stores in PostgreSQL, whether it is encrypted, for how long and how to delete it. This is the product's data management policy, checked against the migrations (103 tables on 2026-10-27). The gateway runs on the infrastructure of whoever installs it: the data lives in the operator's database, and backups and disk encryption are the operator's too.

## By category

| Category | Main tables | What it contains | Encrypted by the application | Retention and deletion |
|---|---|---|---|---|
| Usage metadata | `gateway_usage_events`, `gateway_usage_valuations`, `gateway_durable_usage`, rollups | Time, key, team, model, provider, status, tokens, latency, correlation IDs, end user and session declared by the client, the model alias the client sent (`requested_model`), the service tier the provider reported (`service_tier`), the gateway's own error code (`error_code`) and the guardrail that blocked the request (`guardrail_blocked`). **No prompt or response** | No (there is no content) | Kept forever by default; opt-in [retention](/docs/features/metadata-retention/) deletes finalized events after the period |
| Credentials | `gateway_managed_keys`, `gateway_key_credentials`, `gateway_console_users`, `gateway_console_invitations` | Client keys, console tokens and invitations | **Only the SHA-256 hash**, never the value | Immediate revocation; the record stays for audit |
| Third-party secrets | `gateway_provider_overrides`, `gateway_mcp_team_credentials`, `gateway_mcp_user_tokens`, `gateway_alert_channel_overrides` | Provider keys, MCP credentials and OAuth tokens, alert channel secrets | **Yes**, AES-256-GCM with the providers key ([cryptography](/docs/security/cryptography/)) | Deleted when the resource is removed |
| Content captures (`content_capture`, off by default) | `gateway_content_captures`, `gateway_content_capture_policies`, `gateway_content_capture_readers` | **Request and response bodies, with prompts and answers**, of the teams with a capture policy, plus their metadata; the policies; who may read them. With `content_capture_evaluation`, a record may also keep the request as it was sent on after input guardrail masking, and records with the `evaluation` purpose are what live evaluation reads (`gateway_content_capture_folds` remembers which evaluation capture policies were moved here). With `content_capture_media`, the **images and audio** of a captured request or answer in `gateway_content_media`, one row per attachment with its request ID, team, organization, key and principal, bounded per record and per team; with `content_capture_reasoning`, the **model's reasoning** as a part of the record | **Yes**: per-record data key, AES-256-GCM, wrapped by the content key; an attachment is sealed under its record's data key; the metadata stays in the clear | `retention_days` of the policy (1 to 3,650, default 30), purged every minute; manual deletion by record, team, request and time; every read and deletion audited ([content capture](/docs/features/content-capture/)) |
| Replay links and configuration fingerprints (`request_replay`, `trace_explorer`) | `gateway_request_replays`, `gateway_config_fingerprints` | One row per [replay](/docs/features/trace-explorer/#replay-a-request): the original and the new request ID and trace ID, the team, the organization, the operator and the HTTP status. One row per configuration the gateway ran with: its fingerprint, version and **a hash per section**. No prompt, no answer and no configuration value | **No** (identifiers and hashes) | Kept; the rows hold no content |
| Reviews (`review_multi_annotator`, off by default) | `gateway_eval_queue_reviews`; `finals` on `gateway_eval_queue_items` | One row per reviewer of a queue item: who, their lock, when they finished and what they answered (the values of the queue's fields and optional notes, never captured content); the final value of each field on the item. Deleted with the queue item; a queue is hidden, not deleted, so its reviews stay until the team is removed |
| Automations (`review_automations`, off by default) | `gateway_automations`, `gateway_automation_matches` | A team's rule that fills a review queue or a dataset: its query, caps, counters and owner (a console user ID), and the IDs of the traces, spans, sessions or requests it already added (IDs only). Matches older than 30 days are purged once the automation looks past them |
| Saved views (`trace_query`, off by default) | `gateway_saved_views`, `gateway_saved_view_defaults` | A named query of the Traces or the Request logs screen with its time range, columns, sort and lens; its owner, and the team or organization it belongs to. **No request data**: a query can name identifiers (a customer, a key, a tag value) | No | Until the view is removed by its owner or by whoever manages the team's or organization's views; a person's default goes with the view |
| Custom dashboards (`custom_dashboards`, off by default) | `gateway_dashboards`, `gateway_dashboard_versions`, `gateway_dashboard_widgets` (the widget library) | A dashboard's name, description, time range and widgets (titles, metrics, filters, queries, Markdown notes); its owner, and the team or organization it belongs to; the same for each kept version, with who saved it. **No request data**: a filter or a query can name identifiers (a customer, a key, a tag value), and a note holds what its author wrote | No | Until the dashboard is removed by its owner or by whoever manages the team's or organization's dashboards; its versions go with it, and the oldest past `dashboards.versions_kept` at each save |
| Evaluator versions, events and runs (`evaluators`, off by default; on-demand runs and code sources with `code_evaluators`) | `gateway_eval_evaluator_versions`, `gateway_eval_evaluator_events`, `gateway_eval_jobs`, `gateway_eval_on_demand_runs`, `gateway_eval_evaluators.code` | Each saved definition of an [evaluator](/docs/features/evaluators/) (its judge prompt, filter, sampling and parameters, with a readable spec), each change of its status or published version (actor, before and after, reason), and one row per run: the evaluator version, the span, trace or session ID it judges, when it is due and how it ended. A code evaluator's source is the team's text, kept in each version; an on-demand run records who started it, its source (selection, query, one trace), its query and its counts. **No request content**: a prompt or a source is the team's text, a session ID the client's identifier, and a code run's console output and metadata are never stored | No | Versions and events stay with the evaluator; finished runs for `evaluation.job_retention_days` (30 by default) |
| Agent runs (`agent_recognition`, off by default) | `gateway_agent_runs` | One row per recognized coding-agent run: team, organization, run ID, key, principal, agent name and type, parent run, a **keyed hash** of the task the user typed, times, counters and the call IDs of the latest 256 tool steps it counted (identifiers the model provider issued, so a step is counted once). No prompt, answer, tool argument or tool result. Only with `agent_recognition.task_capture` (off by default) and a team content capture policy: **the first 200 or 2,000 characters of the typed task** | The task text: **yes**, AES-256-GCM under a per-run data key wrapped by the content key. The rest is metadata in clear | The run: `agent_recognition.retention_days` after its last request (default 30). The task text: the capture policy's `retention_days`; it is also removed by an end-user deletion that erases the run's first request and by a team-wide deletion of captured content (the hash stays). Both removed every minute, with the flag on or off ([agent runs](/docs/features/agent-recognition/#retention)) |
| Application spans (`otlp_ingest`, off by default) | `gateway_spans` (or the analytics store's span table with `spans.engine: analytics_store`), kind `app` | Spans an application sent to `POST /v1/traces`: its trace and span IDs, name, times, status, sub-kind, model, provider, tokens, an estimated cost, session and end user it declared, tags, tool name and call ID, retrieval document IDs and scores, allowlisted attributes, issues, the key, team and organization. No message content | No (metadata) | `spans.retention_days`, like the gateway's own spans |
| Application span content (`otlp_ingest` with a policy's `app_spans` purpose) | `gateway_content_captures` (operation `app_span`, request ID `otlp.<trace>.<span>`) | The input and output messages of an ingested span, normalized to role and content | **Yes**, AES-256-GCM under the content key, like every captured record | The capture policy's `retention_days` |
| OTLP ingest policy and result retention state (T186.016) | `gateway_otlp_ingest_override`, `gateway_result_retention` | The runtime OTLP ingest policy; the last result retention pass and its totals | No | Until changed |
| Topics (`topics`, off by default) | `gateway_topic_summaries`, `gateway_topics`, `gateway_topic_assignments`, `gateway_topic_units`, `gateway_topic_maps`, `gateway_topic_runs`, `gateway_topic_facets`, `gateway_topic_settings` | Per unit (trace, session or agent run) and facet: **a one-sentence summary a model wrote from the sent view of the unit's captured requests**, its state and label, its embedding; the topics (names and descriptions a model wrote from summaries), each unit's topic, the maps and their runs. With the analytics store as span engine, a mirror of the assignments there (`gateway_topic_assignments_v1`: IDs only) | **Yes** for the summary text, AES-256-GCM under the content key with a data key per row bound to its unit and facet; the embedding, the label, topic names and assignments are in the clear | Summaries: `topics.retention_days` (30) and never longer than the content record they were read from; assignments and units the same; erased with an end user's requests; a reset deletes them all |
| Route experiments (`route_experiments`, off by default) | `gateway_route_experiments` | A team's experiment on a canary alias: its name, alias, evaluator, thresholds, state and who changed it; no traffic content (the readout is computed from spans and results on read) | No | Until deleted; removed with its team |
| Insight triage (`failure_insights`, off by default) | `gateway_insight_status` | A team's status and note (at most 500 characters, written by a person) for one failure group, by its fingerprint; no traffic content | No | Until changed; removed with its team |
| Eval captures | `gateway_eval_team_captures` | Prompt and response of requests captured by team policy | **Yes**, AES-256-GCM | Deleted at the end of the policy's retention period |
| Semantic cache | `gateway_semantic_cache` | Chat answer and question vector | **Yes**, the answer with AES-GCM; the vector stays in the clear | TTL from 1 s to 24 h and manual purge |
| Semantic cache on Redis (`distributed_semantic_cache`) | Redis keys `<namespace>:sc:*` of the cache backend | Chat answer, question vector and its int8 copy | **Yes**, every value AES-256-GCM with a subkey of `cache_backend.key_env` and the key name; names are HMACs | TTL from 1 s to 24 h; purge replaces a generation and the old keys expire |
| Files and batches | `gateway_files`, `gateway_batch_items` | Uploaded files (`batch`, `user_data`, `evals`) and batch request bodies, **with prompts** | **No** | File deleted through the API or on expiry (the content is zeroed); batch items follow the batch |
| Vector stores | `gateway_vector_documents`, `gateway_vector_chunks` | Document text in chunks and their vectors | **No** | Deleted with the document or the store |
| Evals | `gateway_eval_datasets`, `gateway_eval_dataset_items`, `gateway_eval_run_items`, `gateway_eval_comments`, `gateway_eval_scores` | Inputs and expected outputs, results, comments and scores | **No** | Deletion per item, comment, score, queue and rule through the API |
| Prompts | `gateway_prompt_revisions` | Prompt templates and their revisions | **No** | Prompt deletion through the API |
| Federated identity | `gateway_oidc_sessions`, `gateway_scim_users`, `gateway_scim_groups` | OIDC subject, user name and SCIM external ID | No | User is deactivated, not deleted; sessions expire |
| Audit | `gateway_identity_audit`, `gateway_control_audit` | Who changed what, with `request_id`. No secrets or payloads | No | Not deleted by retention |
| Quotas and finance | `gateway_quota_*` | Reservations, measurements, receipts and billing imports. No content | No | Controlled archiving; unknown reservations are never deleted to free up balance |
| Configuration | `gateway_*_overrides`, `gateway_feature_overrides` | Overrides of models, providers, flags and policies | Only the secrets (above) | Reverted to YAML through the API |

> **Content capture changes this profile.** With `content_capture` on and a team policy, the gateway keeps that team's prompts and answers, which may contain personal data, for the policy's retention, in the database and its backups. Plan the legal basis, the retention and who may read before turning it on ([content capture](/docs/features/content-capture/)).

## Outside the database

The optional [client-source recording](/docs/security/source-ip-controls/) profile sends a canonical client IP to stdout/OTLP only; those external collectors own retention and access. It does not insert request IP into SQL usage history, receipts or the ledger. Configured key CIDR authorization policies and their independent version are stored in managed-key metadata and audited, which is separate from collecting observed request addresses.

The default-off [managed credential cache](/docs/features/managed-key-cache/) retains bounded process-local verified metadata indexed by a digest, never cleartext bearer keys. No snapshot or deadline proof is persisted or exported. Credential validity deadlines govern reuse, not guaranteed immediate heap erasure; entries leave on invalidation, replacement, capacity eviction or process exit. Its dedicated runtime policy override is persisted with the normal control version and audit.

With `logging.request_events: stdout`, each finished inference request also leaves the process as one JSON line on stdout ([request audit events](/docs/features/request-events/)): the same class of metadata as the usage events above (key ID, team, organization, model, provider, tokens, cost, end user and session declared by the client, tags), and **no prompt, response or credential**. Its retention and deletion are those of the log pipeline that collects it, which the operator runs.

## Content in cleartext

Files, batch bodies, vector store chunks, eval datasets and results, comments and prompts are stored **in cleartext** in the database. Their protection today is PostgreSQL's own: restricted access, TLS and disk encryption. For sensitive data:
- use disk or volume encryption on PostgreSQL;
- restrict who can access the database;
- set a short expiration on files.

Encrypting this content in the application, as is already done for captures and the cache, is on the roadmap.

## LGPD and data subject requests

- **Console users:** can be deactivated (`DELETE /api/v1/admin/users/{id}` or SCIM), which cuts off access immediately. The record stays, because the audit trail points to it.
- **Clients' end users:** the gateway stores only the label the client sends (`X-Gateway-End-User` or `user`), in the usage metadata. There is no per-end-user deletion yet. Today, deletion of this metadata comes from time-based retention.
- **Content:** files, vector store documents, dataset items, comments and prompts can be deleted through the API. Content captures are deleted by record, team, request or time through `POST /api/v1/admin/content-captures/delete`.

## Limits

- There is no per-end-user data deletion or per-data-subject export yet.
- The content of the tables above marked "No" is not encrypted by the application.

## Provider credential pools

Optional pool metadata contains operator-selected entry IDs, primary, weights, cooldown/status policy and source. PostgreSQL stores each console secret as authenticated ciphertext in `gateway_provider_credentials`, bound to provider and entry IDs; deleting an entry/override deletes its ciphertext transactionally. Safe configuration returns material presence/source only, never values, env references, hashes or ciphertext. Selection/cooldown state is bounded and process-local, not an immutable finance record. Operator backup/reencryption includes this family; see [pool lifecycle](/docs/features/provider-credentials/).
