---
title: "Self-hosted AI gateway checklist: keys, logs and data control"
description: "What to look for in a self-hosted AI gateway when provider API keys, prompts and usage logs must stay on your own servers. Nine checks for engineering teams."
url: https://kaeso.app/articles/self-hosted-ai-gateway-security-checklist
markdown: https://kaeso.app/articles/self-hosted-ai-gateway-security-checklist.md
language: en
alternates:
  de: https://kaeso.app/de/articles/self-hosted-ai-gateway-security-checklist.md
  zh-CN: https://kaeso.app/zh-CN/articles/self-hosted-ai-gateway-security-checklist.md
published: 2026-11-23
authors:
  - Kaeso Team
tags:
  - security
  - self-hosted
  - privacy
  - guide
  - gateway
image: https://kaeso.app/articles/self-hosted-ai-gateway-security-checklist/cover.jpg
index: https://kaeso.app/llms.txt
---

# Self-hosted AI gateway checklist: keys, logs and data control

What to look for in a self-hosted AI gateway when provider API keys, prompts and usage logs must stay on your own servers. Nine checks for engineering teams.

> Every page, article and docs page of Kaeso is listed in https://kaeso.app/llms.txt.

- Published: 23 November 2026
- Reading time: 5 min
- Author: Kaeso Team

If your requirement is that provider API keys, prompt payloads and usage logs never leave your own servers, "open source" on a README is not enough. Many gateways keep SSO, audit logs or key management behind a hosted control plane, store upstream keys in plaintext environment variables, or send telemetry out of your network by default.

Use these nine technical checks when evaluating any self-hosted AI gateway. Each one shows how Kaeso 0.7.0 handles it.

## 1. Envelope encryption and rotation for provider keys

Provider keys should never sit in plaintext YAML files, browser local storage or app environment variables, and the gateway UI should never display a stored key back after creation.

- **What to check:** Are provider keys encrypted at rest with an authenticated cipher using a key ring you hold outside the database? Can you rotate the master key without re-entering every provider secret?
- **In Kaeso:** Provider keys are envelope-encrypted with **AES-256-GCM** under a `master-keys` file you control. Keys are decrypted only in gateway memory (refreshed at least every 30 seconds) and never returned to apps or the console. To rotate, prepend a new master key and run `kaeso master-key rewrap`.

## 2. Hashed, scoped caller keys with expiry and service accounts

Applications and coding agents should never share one static admin master key.

- **What to check:** Does the gateway hash caller API keys before storing them, separate inference keys from admin keys, enforce expiries and tie automated workloads to service accounts rather than individual employees?
- **In Kaeso:** Caller keys (`sk-kso-…`) are stored only as hashes, scoped to a single project, limited to explicit models and abilities (`Inference`, `Platform`, or `Tools`), given optional expiries, and attached to a member or service account so keys survive staff turnover.

## 3. Request logs on your own storage, with content logging optional

Usage accounting and prompt logging serve different needs. Finance and capacity planning need model, token count, latency and cost; privacy policies often forbid storing raw prompt and completion text.

- **What to check:** Can you turn prompt/reply content logging completely off per organization or per project while keeping spend, token counts and status logs? Can you separate metadata retention from content retention, and export logs without third-party SaaS callbacks?
- **In Kaeso:** Request logs stay in your own ClickHouse instance (or can be turned off entirely while PostgreSQL still records usage and enforces budgets). Metadata defaults to 90 days and content to 30 days, content logging can be disabled per organization or project, media attachments are omitted by default, and logs export directly as CSV or JSON Lines ([Request logs and privacy](https://kaeso.app/articles/request-logs-and-privacy)).

## 4. Hard pre-flight budgets and rate limits

A leaked internal key or runaway agent loop should hit a hard ceiling before it generates a surprise five-figure upstream bill.

- **What to check:** Does the gateway reserve worst-case spend before forwarding concurrent requests, or only tally spend after streams finish?
- **In Kaeso:** Hard spend budgets, token budgets and request/token/tool-call rates are checked atomically in Valkey before the provider is called, nested across Project, Member or Service account, and API key ([Hard budgets, limits and currencies](https://kaeso.app/articles/budgets-limits-and-usage)).

## 5. Pre-upstream guardrails for secrets and personal data

Even when your gateway stays inside your VPC, prompts sent to cloud providers still leave your network unless scrubbed or blocked first.

- **What to check:** Can the gateway block or redact API keys, credentials and personal data before calling an upstream provider, and fail closed (`503`/`500`) if a custom guardrail service is unreachable?
- **In Kaeso:** Built-in secrets and PII rules plus your own HTTP guardrail services inspect chat requests (and optionally replies) before any token leaves your server ([Guardrails in Kaeso](https://kaeso.app/articles/guardrails-in-kaeso)).

## 6. Explicit private-network controls and local model support

If you route sensitive workloads to local Ollama, vLLM or LM Studio servers, the gateway must allow your internal inference subnet without opening unrestricted SSRF access to cloud metadata endpoints or internal admin services.

- **What to check:** Are private IP ranges blocked by default and explicitly allowlisted via CIDR? Can local and cloud models share the same auth, routes and limits?
- **In Kaeso:** Private addresses are blocked until explicitly listed in `KAESO_CUSTOM_PROVIDERS_ALLOWED_NETWORKS`, and local servers integrate as first-class custom providers alongside 50 built-in cloud providers ([One API for OpenAI, Anthropic, Gemini and local models](https://kaeso.app/articles/one-api-for-openai-anthropic-gemini-and-local-models)).

## 7. Access control, SSO, SCIM and audit logs without an enterprise paywall

Security controls lose their value when SSO, offboarding or audit trails require a separate paid tier that teams defer.

- **What to check:** Are OpenID Connect SSO, domain verification, two-factor authentication, SCIM 2.0 deprovisioning, custom roles and full audit logs included in the open-source licence?
- **In Kaeso:** All of them ship in the MIT-licensed repository with no user cap and no commercial edition ([SSO, SCIM 2.0, custom roles and agent policies](https://kaeso.app/articles/sso-scim-and-roles)).

## 8. Observable request path and strict error handling

When a request fails or takes an unexpected route, operators need clear traces without digging through unstructured logs.

- **What to check:** Does every response identify the request, resolved model, provider, fallback path and gateway overhead? Does the gateway refuse unsupported fields rather than silently dropping them?
- **In Kaeso:** Every reply carries `kaeso-request-id`, `kaeso-model`, `kaeso-provider`, `server-timing` and `kaeso-route` (for alias routes), Prometheus metrics stay on private port `9100`, and KPP refuses unsupported parameters instead of stripping them ([How the gateway works](https://kaeso.app/gateway)).

## 9. Clean licensing, verifiable supply chain and measured overhead

Verify what actually runs on your servers: container provenance, signed model metadata, update verification and honest performance data.

- **What to check:** Is the entire stack under one clear open-source licence? Are model catalogue updates cryptographically verified? Can you reproduce the vendor's latency and throughput claims yourself?
- **In Kaeso:** Gateway, console, KPP and UI library share one MIT repository and version. Model pricing and limits sync from [KPMR](https://kpmr.kaeso.app) as an Ed25519-signed catalogue (which you can disable with `kpmr.sync = false` for air-gapped networks), updates verify signed release manifests with `kaeso config check`, and every benchmark script, image digest and raw output is public at [/benchmarks](https://kaeso.app/benchmarks).

Compare how Kaeso, LiteLLM, OpenRouter, Bifrost and Portkey stack up across these criteria on [/compare](https://kaeso.app/compare), or pick a hosting target in [Where to run Kaeso](https://kaeso.app/articles/where-to-run-kaeso).

Product names in this article belong to their owners and are used only to name the software and services involved. Kaeso is not affiliated with or endorsed by them.

By Kaeso Team

## More articles

- [Self-hosted LLM gateways compared: limits, fallbacks and logs](https://kaeso.app/articles/comparing-self-hosted-llm-gateways.md): How Kaeso, LiteLLM, Bifrost, Portkey and Helicone compare on spend limits, model fallbacks, provider key pools and request logging, with the measured throughput cost of logging.
- [Deploy Kaeso on Kubernetes with the Helm chart](https://kaeso.app/articles/deploy-kaeso-on-kubernetes.md): Install Kaeso 0.7.0 on a Kubernetes cluster with its Helm chart, against PostgreSQL, ClickHouse and Valkey you bring, behind an Ingress or a Gateway API route. Master keys, long streams, scaling, upgrades and what it costs.

[See all articles](https://kaeso.app/articles.md)

## Own the gateway. Own the record

```bash
curl -fsSL https://kaeso.app/install.sh | sh
```

[Install Kaeso](https://docs.kaeso.app/self-hosting/installation) · [Open the live demo](https://demo.kaeso.app)
