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.
- Published
- 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 keys01
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-keysfile 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 runkaeso master-key rewrap.
2. Hashed, scoped caller keys with expiry and service accounts02
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, orTools), 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 optional03
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).
4. Hard pre-flight budgets and rate limits04
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).
5. Pre-upstream guardrails for secrets and personal data05
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).
6. Explicit private-network controls and local model support06
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).
7. Access control, SSO, SCIM and audit logs without an enterprise paywall07
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).
8. Observable request path and strict error handling08
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-timingandkaeso-route(for alias routes), Prometheus metrics stay on private port9100, and KPP refuses unsupported parameters instead of stripping them (How the gateway works).
9. Clean licensing, verifiable supply chain and measured overhead09
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 (opens in a new tab) as an Ed25519-signed catalogue (which you can disable with
kpmr.sync = falsefor air-gapped networks), updates verify signed release manifests withkaeso config check, and every benchmark script, image digest and raw output is public at /benchmarks.
Compare how Kaeso, LiteLLM, OpenRouter, Bifrost and Portkey stack up across these criteria on /compare, or pick a hosting target in 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


