ZICQ
中 Log in / Sign up
Newsroom Agentic #AWS #Amazon Bedrock AgentCore #VPC Lattice #Private APIs #Network Security

AWS Publishes a Hub-and-Spoke Pattern for Inspecting AgentCore Gateway Traffic to Private APIs

Avatar of Mr.Xu

By Mr.Xu Compiled & Reviewed by Editorial

Published:

中文阅读 (Chinese) English Version
Co-reading Select any sentence in the article to highlight, annotate, or copy a quote card. Join discussion ↓

Summary:AWS has published and tested a reference architecture for connecting Amazon Bedrock AgentCore Gateway to private APIs and MCP servers in a centrally governed hub-and-spoke network. The network account owns a VPC Lattice Resource Gateway, routes its traffic through an inspection VPC and Transit Gateway, and shares backend Resource Configurations with the AgentCore account through AWS RAM. The repository includes CloudFormation templates, test scripts, troubleshooting guidance, and a 14-check val


Architectural Finding

AWS did not introduce a new AgentCore networking capability here. It published a tested reference architecture that modifies the self-managed private endpoint mode of Amazon Bedrock AgentCore Gateway: the VPC Lattice Resource Gateway is placed in a dedicated VPC owned by the network account, and its traffic is routed through a Transit Gateway and inspection VPC so both requests and responses cross the central firewall.

This resolves a common enterprise account-boundary problem. The network team retains ownership of every VPC, subnet, and route; application teams manage only their ALBs, APIs, identity providers, and security groups; and the AgentCore team does not need direct administrative access to the tool VPCs.

Request Path and Mechanism

A private tool invocation follows this sequence:

  1. The agent runs in an AWS RAM-shared subnet without an internet route and resolves the Gateway URL through private DNS on a Gateway Interface Endpoint.
  2. Optional AWS WAF rules inspect tool-call arguments. The Gateway then checks its resource policy and inbound JWT before selecting a target.
  3. The Gateway acquires an OAuth access token using the tool account's client credentials and asks VPC Lattice to deliver the connection to the Resource Gateway associated with the shared Resource Configuration. This AWS-managed leg does not cross the enterprise firewall.
  4. The Resource Gateway ENIs sit in dedicated subnets whose default route points to the Transit Gateway. In appliance mode, the TGW sends traffic through the inspection VPC, and the firewall forwards it to an internal ALB or a private execute-api endpoint in the tool account.
  5. The ALB validates the JWT with a jwt-validation action, while a private API Gateway uses an authorizer. Only then is the request forwarded to the backend.
  6. The response returns over the same path, causing both the request and reply from the Resource Gateway to the backend to pass through stateful firewall inspection.

A critical boundary is easy to miss: the first leg from AgentCore Gateway to the Resource Gateway is created through a VPC Lattice service-network association and does not traverse the Transit Gateway or central firewall. The centrally inspected segment begins at the Resource Gateway and ends at the tool backend.

Ownership and Control Boundaries

| Owner | Primary assets | Main controls | |---|---|---| | Network team | Resource Gateway, dedicated VPC, subnets, routes, firewall, Gateway Interface Endpoint, and AWS RAM share | Determines whether traffic enters the inspection VPC and restricts reachable networks | | Tool team | Internal ALB, API, certificate, security groups, identity provider, and OAuth application client | Validates Gateway identity and scope before traffic reaches the backend | | AgentCore team | Gateway, inbound authorizer, resource policy, optional WAF, Gateway Targets, and OAuth Credential Provider | Pins tools and tokens and references shared Resource Configurations |

Six Design Decisions

1. Isolate the Resource Gateway by Trust Zone

The Resource Gateway should not share a VPC with tool backends or centralized endpoints. AWS recommends a dedicated VPC and subnet set per trust zone, with one Resource Gateway per trust zone. This limits the blast radius and allows network policy to scale along business-domain boundaries.

When used only by AgentCore, the Resource Gateway consumes one IP address per subnet, so small subnets are sufficient. However, Ipv4AddressesPerENI and ResourceConfigDnsResolution cannot be changed after creation. Availability Zones must also be supported by both VPC Lattice and the relevant AgentCore features.

2. Create One Resource Configuration per Backend Load Balancer

A Resource Configuration points to an internal ALB's DNS name and port 443, then is shared with the AgentCore account through AWS RAM. Its name must not use the reserved rcfg- prefix.

The Gateway sends the target hostname as TLS SNI, so the ALB certificate's Subject Alternative Name must match it; the hostname itself does not need to be resolvable through DNS. For a private API Gateway REST API, the Resource Configuration points to the network account's execute-api Interface Endpoint, while an aws:SourceVpce endpoint policy restricts which APIs can be reached.

3. Permit Only Required Stateful Flows

The core rules allow traffic from the Resource Gateway subnets to the tool VPC on port 443 and traffic from the ALB subnets to the identity provider's JWKS endpoint on port 443. With AWS Network Firewall in strict rule order, the first rule permits tool calls, while the second uses TLS SNI to restrict signing-key retrieval.

Without the JWKS rule, the lab's ALB returned HTTP 500 and the agent saw only MCP invocation failed. This small outbound rule is nevertheless necessary to close the token-validation chain.

4. Validate Tokens Again at the Tool Boundary

The internal ALB's default action should be a fixed 404 response, with jwt-validation attached only to forwarding rules. Validation should cover the issuer, JWKS, the tools/invoke scope, and a client_id pinned to the Gateway application client. In testing, requests with no token, a token from the wrong identity provider, and a token from another client in the same user pool all received HTTP 401 before the backend ran.

A private API Gateway must not treat an API key as caller identity. Every method still needs an authorizer, combined with an endpoint policy that limits accessible APIs and accounts.

5. Use SCPs to Prevent Resource Bypass

The AWS-managed RAM permission also allows the recipient account to create VPC endpoints. In principle, the AgentCore account could bypass the designated Resource Gateway and create its own endpoint to the same backend. A customer-managed permission cannot simply remove this capability because Gateway Targets also require vpc-lattice:AssociateViaAWSService.

The workable control is an SCP that denies ec2:CreateVpcEndpoint for shared Resource Configurations and denies custom Service Network Resource Associations whenever aws:ViaAWSService is not true. In testing, both bypass attempts were denied while a new Gateway Target still reached READY. SCPs do not apply to the organization management account, so AgentCore should not run there.

6. A Private Endpoint Does Not Close the Public Endpoint

An Interface Endpoint policy can restrict which Gateway ARNs may be invoked, but the public Gateway URL remains reachable unless a separate Gateway resource policy is applied. The policy should allow bedrock-agentcore:InvokeGateway only when aws:SourceVpce matches the designated endpoint and deny other sources.

After the public path was closed in the lab, external calls returned JSON-RPC -32002 while calls through the private endpoint continued to work. The observed propagation took about 30 seconds, but AWS documents a window of up to 15 minutes, so automated acceptance tests need an appropriate timeout.

Security Is Not Payload Inspection

The architecture supplies network-path control, identity validation, and metadata inspection. It does not decrypt TLS payloads:

  • TLS remains end to end between the Gateway and ALB, so the firewall sees flow metadata and TLS SNI rather than tool arguments or response bodies.
  • The agent-to-Interface-Endpoint leg, the Gateway-to-Resource-Gateway leg, and AgentCore's OAuth token requests do not cross the central firewall.
  • With the client credentials grant, the tool sees the Gateway's client identity rather than the end user's identity. User-level tracing requires the inbound JWT claims in the Gateway application logs.
  • Optional WAF inspection examines only the first 16 KB of the request body by default and can be adjusted to 64 KB. Larger tool calls require explicit segmentation, blocking, or alternative inspection policies.
  • A private endpoint Target cannot use NO_AUTH unless an interceptor function is configured.

If compliance requirements demand inspection of prompts, tool arguments, or response content, the deployment needs a controlled TLS-terminating proxy or application-level audit pipeline. A Network Firewall in this pattern alone cannot provide it.

Test Evidence and Limitations

AWS validated the design in a lab containing one management account and three member accounts. The companion repository provides 14 complete checks. The principal observations were:

| Validation target | Observed result | Scope | |---|---|---| | Request source | ALB access logs show a source address in the Resource Gateway range | No source NAT | | Requests cross the firewall | Firewall flow logs record TLS flows from the Resource Gateway to the tool VPC on port 443 | AWS Network Firewall in appliance mode | | Replies cross the firewall | A temporary reply-direction drop causes timeouts and to_client drop logs | Stateful firewall | | Tool-boundary authentication | Missing, wrong-IdP, and wrong-client tokens receive 401 before backend execution | ALB JWT validation | | Public endpoint closure | External calls return -32002 while private endpoint calls continue working | Subject to resource-policy propagation | | Multi-account backends | A second account's API uses the same Resource Configuration without network changes | Private API Gateway variant |

These results establish that the routing and identity paths work, but they are not performance benchmarks. AWS publishes no end-to-end latency, throughput, inspection capacity, or firewall overhead figures, and there is no independent third-party reproduction. The test matrix covers only us-east-1, AWS Network Firewall, and deployments without source NAT. Multi-Region operation, private identity providers, and additional OpenAPI limitations were not exercised in the same experiment.

Engineering Trade-offs

  • Performance: The TGW and central firewall add network hops and can become bottlenecks. Since AWS reports no latency data, the design should not be described as lossless relative to the native path. Load testing should use the target VPC topology, tool-call rate, and payload sizes.
  • Cost: VPC Lattice Service Network Resource Associations incur hourly charges plus data-processing fees, and each Target commonly creates an association. Consolidate operations belonging to one API or MCP Server instead of splitting tools into many small Targets.
  • Quotas: Gateway tool-call quotas apply at both account and Gateway levels. AWS recommends one AgentCore account per environment and early partitioning by domain or agent group rather than waiting for a quota breach.
  • Long-lived connections: VPC Lattice closes idle connections, so long-running MCP streams need keepalives to avoid intermittent failures.
  • Source NAT: If the firewall performs source NAT, the tool security group must allow the firewall addresses. The effective boundary then becomes the combination of firewall allowlists and tool-side token validation.
  • Identity egress: The agent's inbound token request, ALB JWKS retrieval, and AgentCore OAuth token acquisition can leave the private tool path. Each requires an explicit route, DNS, and egress policy.

Deployment Guidance

  1. Map trust boundaries first: Inventory accounts, VPCs, subnets, TGW attachments, tool accounts, and identity providers. Confirm that the central network team really owns every subnet and route.
  2. Reproduce in non-production: Deploy the official CloudFormation templates, pin the AWS CLI or Boto3 version, and adapt the address plan, Availability Zones, and quotas to the target organization.
  3. Build networking before identity: Create the Resource Gateway, TGW routes, Resource Configurations, and RAM share. Then configure OAuth Credential Providers, ALB JWT validation, and API authorizers.
  4. Test both directions: Do more than confirm successful calls. Temporarily drop reply traffic to prove that requests and responses traverse the firewall, then test absent, invalid, and unauthorized tokens.
  5. Verify that bypass is blocked: Attempt to create a Resource VPC Endpoint and a custom Service Network Resource Association in the AgentCore account. Confirm that the SCP rejects both while the Gateway Target reaches READY.
  6. Close the public path with propagation-aware tests: After applying the resource policy, wait up to 15 minutes and compare public and Interface Endpoint calls.
  7. Plan revocation order: To remove access, delete the Gateway Target or Service Network Resource Association before removing the Resource Configuration from the RAM share. Removing the share alone does not terminate existing associations.
  8. Add continuous auditing: Monitor CreateServiceNetworkResourceAssociationBySharee through EventBridge and correlate CloudTrail, ALB, WAF, Gateway application, and firewall flow logs into an end-to-end call trace.

Applicability

This pattern fits organizations where the network account owns every VPC, subnet, and TGW attachment; application subnets are shared through RAM; all cross-VPC traffic must pass a central inspection VPC; and application teams manage only their own services and security groups.

If the Gateway account can own subnets that reach the tools, managed mode is simpler. If centralized inspection is unnecessary, the standard self-managed mode is sufficient. Publicly reachable tools do not need a Resource Gateway at all. The value of this design is not a new connection primitive, but a clear, auditable way to combine AgentCore Gateway, VPC Lattice, Transit Gateway, RAM, ALB, and firewalls into an enterprise private-tool access path with explicit trust boundaries.


Source: AWS Machine Learning Blog (2026-11-18)

— END —

Tags: #AWS #Amazon Bedrock AgentCore #VPC Lattice #Private APIs #Network Security

Editorial & Fact-Checking Note: This article is compiled from primary research, official release documentation, and source papers by the ZICQ Newsroom pipeline with automated entity verification and human editorial review. If you notice any technical inaccuracy, please submit a correction via our corrections policy or email our editorial desk directly.

What's your take on this story?
🚀 Explore & Submit Works

Community Comments

Loading live comments and annotations…