Requirements

Everything to prepare before installing a self-hosted AI Runtime gateway: where it runs, how much it needs, the data stores behind it, what to expose, and which connections it opens.

Starting points, not limits

The figures on this page are starting points. Final sizing depends on your traffic volume and detection options, and is agreed with ByteHide for your deployment. Contact sales to scope it.


Platform

ItemRequirement
CloudAWS, Microsoft Azure or Google Cloud. Virtual machines also run in your own data center
OrchestrationManaged Kubernetes (EKS, AKS, GKE) with Helm, recommended for production. Docker Compose on virtual machines. Managed container services (ECS/Fargate, Container Apps, Cloud Run) from a reference design
Infrastructure as codeTerraform or Pulumi
Container registryAccess to ByteHide's registry with read-only credentials, or your own registry with the image mirrored to it

Sizing

Gateway

The gateway scales by adding replicas, never by making one replica bigger. Each replica is a single process, and memory, not CPU, is what limits it: a production replica typically uses well under 1 vCPU.

Detection profileCPU (minimum / recommended)Memory (minimum / recommended)
Standard PII detection (recommended for production)1 / 2 vCPU2 / 4 GB
Extended PII detection, two languages2 / 4 vCPU16 GB
Extended PII detection, one language2 / 4 vCPU3 / 4 GB
Patterns only0.5 / 1 vCPU0.5 / 1 GB

The PII detection profile is the setting that moves memory the most. Plan 16 GB per replica for extended detection in two languages until your own load tests show otherwise.

A replica takes 60 to 180 seconds to start with full PII detection, and under 5 seconds with patterns only. Configure the startup probe with a margin of 180 to 300 seconds.

Data Stores

ComponentStarting sizeNote
PostgreSQL2 vCPU, 4 GB memoryStorage grows with traffic: one incidence per inspected request
Redis1 vCPU, 1 to 2 GB memoryNo persistence needed

High Availability

Starting points for a production deployment that survives the loss of one replica or one availability zone:

ComponentStarting point
GatewayAt least 2 replicas in different availability zones, each sized for your detection profile (table above). 3 replicas across 3 zones keep 2 serving while one is replaced or a zone fails. Roll out without dropping below your running replica count, and roll back automatically when a new version fails its health checks
PostgreSQL2 vCPU and 4 to 8 GB of memory on a non-burstable class, with a synchronous standby in a second zone and automatic failover (Multi-AZ, zone-redundant or regional high availability, depending on your cloud). Storage autoscaling, and at least 7 days of point-in-time recovery
RedisA primary and at least one replica in another zone, with automatic failover and cluster mode disabled. 1 to 2 vCPU and 1 to 2 GB per node, with TLS and authentication
Load balancer and egressThe load balancer enabled in every zone where replicas run, and one NAT gateway per zone so egress survives a zone failure. Each NAT adds one fixed egress address to allow-list

PostgreSQL

ItemRequirement
Version12 or later. 14 or later recommended
Managed servicesRDS for PostgreSQL or Aurora PostgreSQL, Azure Database for PostgreSQL Flexible Server, Cloud SQL for PostgreSQL or AlloyDB. Any standard connection string works
Connection poolingPut PgBouncer or your provider's proxy in front. Without a pooler, the gateway opens a connection per request
Two connection stringsA pooled one for the gateway, and a direct one, with schema-change privileges, used only by the migration job
AvailabilityRequired to start and to serve traffic: if it goes down, routes stop resolving
BackupsAutomated backups and point-in-time recovery, with a tested restore
RetentionDefine a retention and purge policy before production. The gateway does not purge incidences on its own

Redis

ItemRequirement
Version6.0 or later. 7 recommended. Needs sorted sets with expiry and Lua scripting
Managed servicesElastiCache for Redis or MemoryDB, Azure Cache for Redis, Memorystore for Redis
Cluster modeDisabled
When requiredWith more than one gateway replica. It shares rate limits, token limits, automatic bans and the gateway key map across replicas
AvailabilityMake it highly available. By default the gateway rejects requests when Redis is down

Network

Ports

FromToPort
Your load balancerGateway8080 (HTTP, configurable). The only port the gateway listens on: there is no separate metrics or management port
GatewayPostgreSQL5432
GatewayRedis6379
GatewayByteHide classification service, ByteHide platform, IP reputation443 (HTTPS)
GatewayModel providers, MCP servers, identity providers443, or the port your private MCP servers use

TLS

  • The gateway does not terminate TLS. Terminate it at your load balancer or ingress, with TLS 1.2 as the minimum and TLS 1.3 preferred.
  • Use certificates from your cloud provider or your corporate PKI.

Paths to Expose

Your load balancer routes by path. Expose only what your callers need:

PathExpose toUsed by
/{org}/{route} and the provider-native paths under itYour applicationsGateway mode
/mcp/{org}/{route}Your agents and MCP clientsMCP protection
/mcp-oauth/callbackThe browsers of the people who sign inOAuth sign-in for MCP servers
/validate, /monitor/validate, /monitor/configYour applicationsIn-app mode. Blocking them leaves in-app applications without a verdict
/healthYour load balancerLiveness probe
Control APIYour operators' network only, on a separate internal hostnameThe console, from your team's browsers

Block every other path at the load balancer, including administration and development paths. The hardening guide delivered with the deployment lists them.

The control API URL must use HTTPS on the default port, and ByteHide registers it on your organization so the console can reach it.

Load Balancer

  • Configure the gateway to trust the X-Forwarded-For header only when a trusted load balancer sits in front of it. Otherwise a forged header would bypass per-IP limits.
  • If browsers call the gateway directly, restrict CORS to your origins at the load balancer.
  • Session affinity on the conversation ID improves the gateway's cache hit rate with several replicas.

Outbound Connections

DestinationRequiredIf blocked
ByteHide classification serviceYes, in every deployment optionThe gateway fails closed with 503
Model providers you configuredIn gateway mode onlyNo completion works
MCP servers you connectedIf you use MCP routesThose routes return transport errors
Identity providers of your MCP routes and MCP serversIf you use themCallers or servers authenticated with those providers stop working
ByteHide platformNoConsole sign-in, alert notifications and SIEM forwarding stop. Inspection keeps working
IP reputation serviceNoIncidences lose country, network and reputation

MCP servers inside your network are reached over your internal network, not the internet; see Integrations for how internal addresses are handled. See Network Requirements for the traffic paths.


Secrets

Keep every secret in your cloud's secret manager (AWS Secrets Manager, Azure Key Vault or Google Secret Manager), never in plain environment variables or repositories:

SecretPurpose
Gateway keysAuthenticate callers on the data plane
Admin keysService credential for the control API, for automation only. Expose it on your private network only, and rotate it when staff with access changes
Classification service keyIssued by ByteHide for your gateway
Encryption keyEncrypts provider secrets at rest. Back it up separately. It rotates through a key ring
Hash pepperKeeps hashed values from being reversed. It must stay stable: changing it breaks correlation with past hashes
Database and Redis connection stringsData store access
Scheduler secretAuthenticates the scheduler on the internal paths

Container Security Context

The gateway image runs as a non-root user (UID and GID 10001), with no compilers in the final image. It supports a read-only root filesystem when /tmp and its cache directory are writable, no-new-privileges, dropped capabilities and the default seccomp profile.


Identity

WhoHow they authenticate
Your team, in the consoleByteHide sign-in, with TOTP multi-factor authentication. Members can sign in with Microsoft Entra ID single sign-on over OpenID Connect, configured in your organization's security settings
ApplicationsGateway key or consumer credentials
People calling MCP routesYour own identity provider (Okta, Entra ID, Auth0...) over OAuth. See MCP Authentication

Next Steps

On-Premises Deployment

Install options, steps and upgrades

Network Requirements

Traffic paths and outbound destinations

Architecture

Components, request paths and failure modes

Previous
On-Premises Deployment