Skip to content
Latest (currently 2026.10.2) has the newest features, bug fixes, and CVE patches of Solo Enterprise for agentgateway.

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Backend tunnel proxy

Page as Markdown

Use the tunnel policy to route backend connections through an HTTP proxy for JWKS fetching and other outbound traffic.

Use the EnterpriseAgentgatewayBackend tunnel policy to route backend connections through an HTTP proxy server. This is useful in environments where outbound traffic must pass through a corporate proxy, such as for JWKS retrieval or accessing AI providers behind a network egress point.

About the tunnel policy

The tunnel field on an EnterpriseAgentgatewayBackend configures an HTTP CONNECT tunnel to the target backend. Agentgateway establishes an HTTP tunnel through the proxy and forwards all requests to the upstream endpoint.

The tunnel supports Service and EnterpriseAgentgatewayBackend types as the proxy target.

The tunnel policy applies to one backend. To send every request that the agentgateway proxy makes on its own behalf through a forward proxy, such as external authorization and guardrail requests, see Callout proxy. For callouts to a backend that has its own tunnel policy, that tunnel takes precedence over the callout proxy.

Before you begin

  1. Set up an agentgateway proxy.
  2. Have access to an HTTP proxy (forward proxy) in your cluster, such as Squid.

Configure a tunnel for JWKS fetching

This example configures an agentgateway backend that connects to an upstream identity provider (IdP) through a Squid forward proxy. The tunnel is used for JWKS (JSON Web Key Set) retrieval.

  1. Deploy the proxy backend EnterpriseAgentgatewayBackend that points to your proxy server.

    kubectl apply -f- <<EOF
    apiVersion: enterpriseagentgateway.solo.io/v1alpha1
    kind: EnterpriseAgentgatewayBackend
    metadata:
      name: squid-proxy
      namespace: agentgateway-system
    spec:
      static:
        host: squid-proxy.proxy-namespace.svc.cluster.local
        port: 3128
    EOF
  2. Create the main backend with the tunnel policy that references the proxy.

    kubectl apply -f- <<EOF
    apiVersion: enterpriseagentgateway.solo.io/v1alpha1
    kind: EnterpriseAgentgatewayBackend
    metadata:
      name: idp-proxied
      namespace: agentgateway-system
    spec:
      static:
        host: idp.provider.com
        port: 443
      policies:
        tls:
          insecureSkipVerify: All
        tunnel:
          backendRef:
            group: enterpriseagentgateway.solo.io
            kind: EnterpriseAgentgatewayBackend
            name: squid-proxy
            port: 3128
    EOF
    SettingDescription
    spec.static.hostThe upstream backend host (the actual service you want to reach)
    spec.policies.tunnel.backendRef.nameThe EnterpriseAgentgatewayBackend or Service that represents the proxy
    spec.policies.tunnel.backendRef.portThe port the proxy listens on
    spec.policies.tls.insecureSkipVerifySkip TLS certificate validation when connecting to the upstream backend. Set to All to skip all verification or Hostname to skip only hostname verification. Use with caution — only in trusted environments.

    If your forward proxy inspects TLS traffic and re-signs the upstream certificate with its own CA, verify that CA instead of skipping verification. Replace insecureSkipVerify with caCertificateRefs, which reads the CA certificate from a ConfigMap (the default) or a Secret in the same namespace as the EnterpriseAgentgatewayBackend. The certificate is read from the ca.crt key, unless you set key to another key name.

      policies:
        tls:
          caCertificateRefs:
          - name: proxy-ca
            kind: Secret
  3. Agentgateway now routes all outbound connections from idp-proxied through the squid-proxy tunnel. When the control plane needs to fetch JWKS keys, it does so via the proxy.