# Rocket Relay Security Overview

Last reviewed: April 27, 2026

## Architecture

Rocket Relay is composed of three primary services:

- Portal: customer and administrator UI.
- API server: account, billing, organization, audit, settings, webhook, and trust operations.
- Proxy server: customer API key authentication, request routing, rate limiting, BYOK routing, balance pre-authorization, and usage capture.

PostgreSQL stores account data, pricing, balances, usage records, audit logs, webhook configuration, encrypted customer secrets, and model quality checks. Redis is used for rate limits, balance caches, in-flight balance reservations, usage billing streams, webhook streams, and refresh sessions.

## Authentication and authorization

- Customer API calls use hashed API keys.
- Portal users authenticate through short-lived access cookies and refresh sessions.
- Organizations support roles for owner, admin, billing admin, developer, and viewer.
- Admin routes require a platform administrator user.
- API keys can be revoked, expired, and scoped by organization.

## Logging posture

The proxy configuration disables prompt/response body logging by default:

- `request-log: false`
- `logging-to-file: false`

Business request logs are metadata-only. They store fields such as customer ID, API key ID, model, provider, method, path, status code, token counts, latency, IP address, user agent, request ID, and timestamp. Prompt and response bodies are not stored in the business request log table.

## Secret protection

Customer BYOK credentials, webhook secrets, Stripe settings, and SMTP secrets use envelope encryption. Each secret is encrypted with a generated DEK, and the DEK is wrapped by the configured KEK provider.

Supported KEK providers:

- Local AES-256 master key for smaller deployments.
- AWS KMS for production deployments where `KMS_PROVIDER=aws` and `KMS_KEY_ID` are configured.

## Traffic controls

The proxy enforces commercial and abuse guardrails before forwarding traffic:

- Requests per minute.
- Tokens per minute, using recently recorded usage.
- Daily request caps.
- Concurrent request caps.
- Balance pre-authorization for non-BYOK requests.
- Balance checks with overdraft policy.

## Webhook safety

Webhook targets are validated before storage and before delivery. Private network targets and insecure HTTP targets are blocked by default unless an operator explicitly enables those settings.

## Monitoring and audit

- Admin actions are recorded in audit logs.
- Usage records are partitioned by month.
- Request metadata logs are available for customer diagnostics.
- Model quality checks record active probe, fingerprint, eval, latency, and route health signals.
- Prometheus metrics are protected by token or loopback-only access depending on deployment configuration.

## Management plane isolation

Production Kubernetes deployments expose CLIProxyAPI management operations through an internal service used by the business API. Public ingress routes only customer API and business API paths, and should not expose `/v0/management/*` or `/management.html`.
