AWS Builder Center
Sekisho: I Tried to Make VPC Lattice the Only Checkpoint Between AI Agents

Sekisho: I Tried to Make VPC Lattice the Only Checkpoint Between AI Agents

I tried gating AI-to-AI calls with VPC Lattice IAM policies alone. The policies worked, but AgentCore Runtime couldn't reach Lattice at all.

Cloud Engineer
Every AI agent guardrail I've built so far has lived in code somewhere: a human-approval gate before a payment fires, an IAM role scoped down to one action. VPC Lattice does something I hadn't tried yet — it lets you stack IAM policies at the network layer, per service, so a request either has an explicit  Allow  from a real AWS principal or it never reaches the target at all. That felt like a more literal kind of guardrail: not "the agent was told not to," but "the network wouldn't let it." So I built Sekisho (関所, the checkpoint stations that controlled traffic on Japan's Edo-period highways) — three Amazon Bedrock AgentCore Runtime agents that are only allowed to call each other in specific directions, enforced entirely by VPC Lattice auth policies. I got the network built and the agents running inside it, then ran into a wall that AWS's own documentation doesn't spell out until you go looking for it.

The idea: three agents, one checkpoint, zero code enforcement

Sekisho models a small storefront with three agents:  uketsuke  (reception) takes an order,  zaiko  (inventory) checks stock,  kessai  (payment) charges the customer. The interesting part isn't the agents — it's the wiring between them. Each agent sits behind its own VPC Lattice Service, and the only thing deciding whether  zaiko  is allowed to call  kessai  directly is a JSON auth policy attached to that Service, stacked on top of a broader policy on the Service Network itself. Nothing in the agent's own code checks who's allowed to call whom. If an agent tried to skip the chain of custody — say,  zaiko  calling  kessai  directly instead of routing back through  uketsuke  — the policy would deny it before the request ever reached a target, and the agent would get a 403 back like any other error.
That's the part I wanted to prove out: authorization as a property of the network, not the prompt.

What I actually got running

The VPC has no NAT Gateway and no Internet Gateway. AgentCore Runtime in VPC mode doesn't get public internet by default, so I leaned into that instead of fighting it — a Bedrock Runtime interface endpoint, a CloudWatch Logs interface endpoint, and an S3 gateway endpoint cover everything an agent actually needs.
Two agents came up clean in VPC mode and answered real invocations.  uketsuke  confirmed an order in Japanese ("ご注文ありがとうございます。内容を確認いたします...."), and  zaiko  checked its (fake) stock table through a tool call and answered correctly: "現在、モバイルバッテリーの在庫は3個です。" On the Lattice side, I got a Service Network with  AWS_IAM  auth, one Service ( zaiko-service ) fronted by a Lambda target that forwards to  zaiko 's  InvokeAgentRuntime  call, and a working DNS name resolving inside the VPC. All of that is real, verified infrastructure, not a diagram I drew and hoped would work.


Four gotchas before anything ran

Getting AgentCore Runtime and VPC Lattice to cooperate through CloudFormation surfaced a handful of failures worth writing down, because none of them showed up in the docs I read first.
AgentCore Runtime's VPC mode won't take just any subnet. My first attempt put one subnet in  us-east-1b , which CloudFormation happily created, and then  create-agent-runtime  rejected it: "Supported availability zones are: use1-az4, use1-az1, use1-az2." AZ names map to AZ IDs differently per account, so  us-east-1b  on my account happened to be the unsupported one ( use1-az6 ). There's no way to know this without running  aws ec2 describe-availability-zones  first.
 direct_code_deploy  doesn't install your dependencies for you, at least not in VPC mode. I shipped  agent.py  and  requirements.txt  as-is, the Runtime hit  READY , and every invocation timed out with  ModuleNotFoundError: No module named 'bedrock_agentcore' . Without a NAT Gateway, the Runtime can't reach PyPI to install anything at boot, so pinning dependencies in  requirements.txt  alone silently does nothing behind a NAT-less VPC. I switched to  pip install --platform manylinux2014_aarch64 --only-binary=:all:  and vendored the whole dependency tree into the zip myself, which surfaced two more rejections in a row: x86_64 wheels my Mac had grabbed by default (AgentCore Runtime is ARM64-only), then leftover  __pycache__  files the packager refused outright.
A cross-region inference profile can route around a region-scoped IAM policy. I'd scoped the Bedrock  InvokeModel  permission to  arn:aws:bedrock:us-east-1::foundation-model/* , which looked correctly minimal. It wasn't:  us.anthropic.claude-sonnet-4-6  is a US cross-region inference profile, and one invocation got silently routed to  us-east-2 , where my resource ARN didn't match and IAM denied it. The fix was a region wildcard, a small reminder that a "cross-region" inference profile means your IAM policy needs to think cross-region too.
VPC Lattice won't let you name a resource with its own reserved prefix. I named my Service  svc-zaiko , following the same convention the console uses for auto-generated IDs, and CloudFormation's early property validation rejected it outright. Every Lattice resource type reserves its own prefix for itself ( svc- ,  tg- ,  servicenetwork- ,  listener- ), and you can't reuse it in a  Name  field even though nothing in the UI warns you about it.

The wall: a route that exists and doesn't work

This is the part where I expected a quick security-group fix and didn't get one.
Once the Service Network's  PrivateDnsEnabled  was actually set to  true  — its own small trap, since it's an immutable, create-only field on an unnamed resource, so CloudFormation can't replace it during an update, and I had to delete the association by hand and eventually delete the whole stack to get a clean create — DNS resolution worked exactly as documented.  zaiko-service-*.vpc-lattice-svcs.us-east-1.on.aws  resolved to  169.254.171.1 , VPC Lattice's link-local gateway address. The route table had a  169.254.171.0/24 -> VpcLattice  entry, auto-added the moment the Service Network was associated with the VPC. Security groups allowed all outbound traffic. The default NACL allowed everything. On paper, every layer said yes.
The actual request still failed, every single time:
OSError: [Errno 113] No route to host
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='zaiko-service-....vpc-lattice-svcs.us-east-1.on.aws', port=443):
Max retries exceeded (Caused by NewConnectionError(...Failed to establish a new connection: [Errno 113] No route to host))
I deleted the Runtime and recreated it from scratch, forcing a brand-new ENI, on the theory that maybe the first one had cached a stale route. Same error. I went back to AWS's own docs on  connecting to private VPC resources over Lattice  looking for a missing step, and found the actual answer in the "Supported Amazon Bedrock AgentCore services" section: that private-connectivity path, managed or self-managed resource gateways alike, is documented for AgentCore Gateway and AgentCore Identity. AgentCore Runtime isn't listed.
As far as I can tell from what I observed, Runtime's VPC mode is a plainer feature than it looks: it gives your agent an ENI in your subnet and lets it reach ordinary VPC-addressable resources — interface endpoints, an EC2 host, a normal private IP. What it doesn't appear to do is participate in VPC Lattice's link-local gateway routing, even though the route sits right there in the table, visible and correctly configured. I can't point to a single AWS sentence that says "Runtime cannot reach Lattice services." I can only report what a route table that looks correct and a connection that never completes look like together, across four independent attempts in a row.

Where this leaves the idea

The checkpoint concept itself didn't fail, the specific pairing did. VPC Lattice's stacked auth policies genuinely do what I wanted: a Service-level policy and a Service-Network-level policy both have to say yes, independently, before a caller's IAM identity gets through, regardless of what's on the calling end. What doesn't currently work is having a Bedrock AgentCore Runtime agent be that caller directly. The same pattern would very likely work if the calling side were a Lambda function or an ECS task in the same VPC instead, ordinary compute that VPC Lattice's routing was actually built to reach. I haven't verified that yet. It's the natural next step, not a guess I'm dressing up as a conclusion.

Sources

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article