TRUSTED_CUSTOM_HOSTS allowlist on the gateway.
You need this when the gateway calls any of these on a private address:
- An internal MCP server registered in the MCP Registry
- A custom host such as a self-hosted model endpoint
- A custom guardrail webhook
TRUSTED_CUSTOM_HOSTS is available only on hybrid and air-gapped deployments. On AI Gateway SaaS, upstream URLs must be publicly reachable.Recognize the error
When the gateway blocks a request, the log entry in Strata Cloud Manager → AI Security → AI Gateway → Observability → Logs looks like this:initialize call may just return a generic error such as Failed to restore session. Please reinitialize.. If an internal MCP server fails to connect, check the Observability logs for the SSRF message first.
Allowlist the hostname, not the IP
The allowlist is checked against the hostname in the upstream URL. When the hostname is trusted, the gateway also accepts whatever private IPs it resolves to. Adding only the resolved IP doesn’t help if the URL uses a hostname.
Other rules to keep in mind:
- Setting the variable replaces the defaults. When
NODE_ENVisproduction, the allowlist is empty until you set it. If you still needlocalhost,127.0.0.1,::1, orhost.docker.internal, include them in your list. - A bare domain doesn’t cover its subdomains.
example.netdoesn’t trustmcp.example.net. Use*.example.netto trust the domain and all of its subdomains. - Some destinations can never be trusted. Cloud metadata endpoints, metadata hostname suffixes such as
cluster.local, and non-HTTP ports such as5432stay blocked even when listed. See Custom hosts for the full list.
Set TRUSTED_CUSTOM_HOSTS
Set the variable on the gateway service, which also serves the MCP Gateway when SERVER_MODE / server_mode is mcp or all. The value is a comma-separated list with no spaces. The variable is read at startup, so running containers must be restarted to pick up a change.
- Helm (EKS, AKS, GKE)
- Terraform (ECS, ACA)
- Docker Compose (EC2)
Add the variable under Apply the change and restart the gateway pods:
environment.data in values.yaml:Verify the allowlist
Startup logs don’t print the allowlist, so check the environment inside the running gateway container:initialize call:
Troubleshooting
Related
Custom hosts
The full SSRF rule set and allowlist entry format.
Internal MCP servers
Register a private MCP server in the MCP Registry.

