AWS shows how to route Bedrock agents to private APIs through a central firewall
In large companies, the network team owns every subnet, and traffic between VPCs must pass through a central firewall. AWS has shown a setup in which AgentCore Gateway reaches private APIs and MCP servers through a VPC Lattice resource gateway in the network team's account. Requests and responses travel through Transit Gateway, and the firewall inspects them in both directions. The setup was tested in us-east-1 across three accounts.
AI-processed from AWS Machine Learning Blog; edited by Hamidun News
Enterprise agents sooner or later run into a network problem, not a model problem. An agent has to call an internal REST API or MCP server, but the network team owns all VPCs and subnets, and any traffic between them must pass through a central firewall, both there and back. AWS has published a detailed walkthrough of how to reconcile that requirement with Amazon Bedrock AgentCore Gateway.
What is the problem
AgentCore Gateway has two modes for reaching private targets. In managed mode, AgentCore itself creates a VPC Lattice resource gateway in the Gateway account. That works if the account can own its own subnets. In self-managed mode, as described in the documentation, you place the gateway in subnets with direct access to the backend, and no inspection between Gateway and the tool is provided. If the subnets belong to the network team and a firewall is mandatory, neither option fits.
AWS's solution is self-managed mode with one change: the network account creates and holds the resource gateway. It gets a dedicated VPC and subnets that are not handed to anyone else and contain no backends. The subnets route into Transit Gateway, which sends traffic through an inspection VPC to an internal ALB or an execute-api endpoint in the account of the team that owns the tool. The response returns along the same path.
How it works
For each backend, you create one resource configuration and share it with the AgentCore account through AWS RAM. When you create a target, AgentCore attaches it to its own service network in VPC Lattice, and the connection then reaches the resource gateway's network interfaces in your VPC. AWS operates that segment; after it, your routes and firewall take over. For that reason, you do not need to connect the AgentCore account to Transit Gateway.
The firewall needs two rules. The first allows port 443 from the resource gateway subnets to the tools VPC. The second lets the ALB reach the identity provider for signing keys (JWKS), only from the ALB subnets and only to the required hostname. In tests without the second rule, the ALB returned HTTP 500, and the agent got an MCP call error. To prove that responses really do pass through the firewall, the authors added a rule blocking the return direction: calls hung until timeout, and dropped packets appeared in the logs. After the rule was removed, everything worked.
The tool side validates tokens. On the internal ALB, each forward rule gets a jwt-validation action, and client_id is bound to the Gateway's app client, so tokens from other clients in the same user pool are rejected. In tests, requests with no token, with a token from a different provider, and with a token from a different client all received a 401 before reaching the backend. The agent saw only "An internal error occurred" in these cases, so look for the causes in the ALB access logs. Private API Gateway REST APIs need an authorizer on every method (an API key does not authenticate the caller) and an endpoint policy that restricts API access to approved accounts.
Limitations and takeaways
The design is candid about its weak spots. There is no content inspection: TLS runs from Gateway to the ALB, the firewall sees flow metadata and SNI, and request bodies remain visible only in Gateway, AWS WAF and ALB logs. The firewall is bypassed on some segments: the path from the agent to the interface endpoint, the path from Gateway to the resource gateway, and token requests to providers. Finally, with client credentials, the tool sees only the identity of the Gateway itself, and a specific user can be reconstructed only from the claims of the incoming JWT in the Gateway logs.
The practical takeaway for platform and security teams: split the roles up front. The network team owns the resource gateway, routes and firewall rules. The tool team is responsible for the ALB, the certificate (its SAN must match the target's hostname) and the app client.
The agent team creates the Gateway and one target per API or MCP server. A new tool on an already connected ALB requires no network changes; it is enough to update the OpenAPI specification or sync the MCP server. Two resource gateway settings cannot be changed after creation (Ipv4AddressesPerEni and ResourceConfigDnsResolution), so choose them carefully from the start.
The CloudFormation templates and test scripts are in the repository accompanying the post, but treat the design as a reference point and adapt it to your own account architecture.
- Nov 18, 2026AWS adds Dynamo to HyperPod: Qwen3-235B delivers 207 tokens/s per GPU instead of 101
- Nov 18, 2026Airbnb switched coding-agent models — heavy users' spending dropped 7x
- Nov 18, 2026Duco cuts agent context by 90% and onboards bank reconciliations 10x faster
- Nov 18, 2026Epic to remove Blueprints from Unreal Engine 6: AI works with code, not diagrams
Key Questions Answered
What is the problem?
AgentCore Gateway has two modes for reaching private targets. In managed mode, AgentCore itself creates a VPC Lattice resource gateway in the Gateway account. That works if the account can own its own subnets. In self-managed mode, as described in the documentation, you place the gateway in subnets with direct access to the backend, and no inspection between Gateway and the tool is provided. If the subnets belong to the network team and a firewall is mandatory, neither option fits.
How it works?
For each backend, you create one resource configuration and share it with the AgentCore account through AWS RAM. When you create a target, AgentCore attaches it to its own service network in VPC Lattice, and the connection then reaches the resource gateway's network interfaces in your VPC. AWS operates that segment; after it, your routes and firewall take over. For that reason, you do not need to connect the AgentCore account to Transit Gateway. The firewall needs two rules.
What are the key details on Limitations and takeaways?
The design is candid about its weak spots. There is no content inspection: TLS runs from Gateway to the ALB, the firewall sees flow metadata and SNI, and request bodies remain visible only in Gateway, AWS WAF and ALB logs. The firewall is bypassed on some segments: the path from the agent to the interface endpoint, the path from Gateway to the resource gateway, and token requests to providers.
Build & Ship Production AI Agents Without Boilerplate Code
Start your free 72-hour trial at Hamidun Academy (academy.hamidun.com) — interactive lessons on Claude Code & Cursor, live Tech Radar, and production agent templates.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.