Agent Gateway

Maintain network isolation with VPC peering

Peer your Agent Gateway appliance with a VPC in your AWS account, so agents reach your MCP servers, agents, and internal APIs by private address and those services keep no public endpoint.

Compliance, security, and data residency rules often require traffic to internal systems to stay on private networks. Your MCP servers, agents, and internal APIs run in an AWS virtual private cloud (VPC), and giving each one a public endpoint so the gateway can reach it widens the attack surface and adds another endpoint to secure for every new service.

What you can do

  • Peer your Agent Gateway appliance with a VPC in your AWS account, so that traffic between the gateway and your services stays on a private network path.
  • Point a surface at a service by its private IP address or its internal load balancer’s DNS name, so that the service keeps no public endpoint.
  • Peer with a VPC in another AWS region, so that the appliance and your services can each run where they need to.
  • Keep callers on the gateway’s public entry point while the services behind it stay private, so that only the gateway faces the internet.

How it works

Callers reach Agent Gateway, the focus of the diagram, at its entry point in the Affinidi-hosted appliance. Through an AWS VPC peering connection between the appliance's network and a VPC in your AWS account, the gateway calls an MCP server and an internal API by their private IP addresses, so neither service needs a public endpoint. Callers reach Agent Gateway, the focus of the diagram, at its entry point in the Affinidi-hosted appliance. Through an AWS VPC peering connection between the appliance's network and a VPC in your AWS account, the gateway calls an MCP server and an internal API by their private IP addresses, so neither service needs a public endpoint.

VPC peering is an AWS network connection between two VPCs. Once the appliance’s network and your VPC are peered, the gateway reaches a service in your VPC by its private IP address, as it would a service in its own network.

You set up peering in Affinidi Portal when you create the appliance configuration, on any size except Basic. You give the details of your VPC and of an AWS Identity and Access Management (IAM) role in your account that lets Affinidi set up the peering connection. Affinidi then creates the peering connection and routes your VPC’s address range from the appliance’s side. On your side, you route the appliance’s address range through the peering connection and allow the gateway in your services’ security groups. AWS peers only VPCs whose address ranges don’t overlap, so your VPC needs a range distinct from the appliance’s.

In a surface, the managed agent’s Direct URL target or a Transit Point’s destination can then be a private address in your VPC, such as http://10.0.1.12:8080. Callers keep reaching the surface at its Entry point URL, so peering changes only how the gateway reaches your services. Cloud metadata endpoints stay blocked as targets, so a misconfigured target can’t read the cloud instance’s credentials.

The peering details are fixed once the configuration is created. To peer with a different VPC, create a new configuration with the new details. Each configuration peers with one VPC, and because every peered appliance uses the same address range, each VPC peers with one appliance.

Setting up VPC peering

Setting up peering takes these steps, covered in full in Reach services in your AWS VPC over VPC peering:

  1. Get Affinidi’s AWS account ID and the appliance’s address range from Affinidi support.
  2. In your AWS account, create an IAM role that Affinidi’s account can assume to accept a peering connection into your VPC.
  3. In Affinidi Portal, create an Agent Gateway configuration on a size other than Basic, and enter your VPC’s details and the role’s ARN in VPC Peering Details (optional).
  4. Once the deployment shows Complete, route the appliance’s address range through the peering connection in your VPC’s route tables.
  5. Allow the appliance’s address range in the security groups of the services the gateway calls.
  6. Point a surface’s Direct URL target at a service’s private IP address or an internal load balancer’s DNS name.