AgentCore Gateway vs kloia AI Gateway

By Halit Altuner on Dec 1, 2026, 9:06:23 PM

amazon-bedrock-gateway-ai-governance

One of the first tests we wrote for our own agent gateway was the simplest one: send a request without a token, get a 401, move on to the next test.

The request went through.

We stared at the screen for a while. The config had jwtAuth, the issuer was right, the keys were in place. The problem was a single setting: JWT validation had been left in optional mode. If a token arrived, it was checked. If not, the door stayed open. We set mode: strict, the request was refused, and we moved on.

It was a small mistake, but it taught us what running your own gateway really means: every default is yours to get right, on every upgrade. That lesson shapes how we work today. When the agents and the data live on AWS, we start with Amazon Bedrock AgentCore Gateway, where inbound authorization is a choice you make when you create the gateway, not a default you have to remember to tighten. We keep our own gateway, kloia AI Gateway, for the places AWS cannot go: data that has to stay on-prem or inside the country, and networks no cloud service should reach into.

Why agents need a gateway

Most of the agents we write at kloia look at customer systems. The assessment agent reads an account's configuration, the SRE agent works out what is happening in an EKS cluster, incident analysis digs into traces in Instana. They all want the same thing: permission to read.

The shortcut is to give the agent the customer's access key. We never took it seriously, because you cannot control where that key ends up. It goes into a prompt, lands in a log, stays in the model's context. A key handed out for a five-minute investigation stays valid for months. And when a customer says "cut off your access", you have to find out which agent holds what, one by one.

What we want is simple. The agent proves who it is but never sees the customer's key. There is one gate in between: every call is recorded there, and there is one place to close it.

Why AgentCore Gateway is our default on AWS

Amazon Bedrock AgentCore Gateway is that gate as a managed AWS service, and in 2026 it covers almost everything we used to build by hand.

It turns APIs, Lambda functions, and OpenAPI and Smithy definitions into MCP tools, and it ships ready-made integrations for Salesforce, Slack, Jira, Asana and Zendesk. When the tool count reaches the hundreds, the agent does not load them all into its prompt; it finds the ones it needs with a built-in semantic search tool. Passthrough targets reach other agents (A2A included) and plain HTTP services, and model calls can be routed across providers through the same endpoint.

Identity is handled on both sides. Inbound, the gateway accepts JWTs, IAM (SigV4) or an authenticate-only mode. Outbound, each target gets its own credential: the gateway's service role, the caller's own IAM identity, OAuth, an API key or token passthrough. AgentCore Identity manages the OAuth flows, and using it through the Gateway costs nothing extra.

Policy, generally available since March 2026, puts Cedar rules in front of every tool call. Security teams can write the rules in natural language, have them converted to Cedar and change them without touching agent code. Lambda interceptors add dynamic checks where a static rule is not enough.

The network is private by default. Agents reach the Gateway over a PrivateLink interface endpoint, and the Gateway reaches private targets through VPC Lattice, VPC Link or a Lambda function inside the VPC, including on-prem systems over Direct Connect or VPN. Observability and auditing are built in, the service scales on its own, and it runs in about twenty AWS Regions, Frankfurt and Ireland among them. It is also cheap: a thousand gateway calls cost half a cent.

One design point deserves care. The gateway's service role is shared by every target that uses it, and its permissions are the ceiling for every caller, so keep it narrow. When an agent has to read many customers' AWS accounts, put the cross-account step in a Lambda target that assumes a per-customer role with an external ID. The customer's trust policy then stays their off switch.

Where AgentCore Gateway stops

AgentCore is a regional AWS service, and for us that is its only real limit. Some data is not allowed to travel to an AWS Region at all.

In Türkiye, BDDK, the banking regulator, requires banks to keep their primary and secondary systems in the country and allows cloud services only on that condition. There is no AWS Region in Türkiye, and the closest AgentCore Region is Frankfurt. The same question comes up with air-gapped environments, with models that run in a customer's own data center, and with factory networks that accept no inbound connections.

For these cases we built kloia AI Gateway.

kloia AI Gateway: the same idea, where AWS cannot go

Our first design treated the gate as a credential service. A service we called "Access" handed short-lived credentials to agents and kept a record of who was allowed what. As the code grew, we saw that as long as we gave the agent a credential, however short-lived, we were still putting the thing we wanted to protect in the agent's hands.

So we turned the approach around and built a gateway that brokers the request itself. The agent brings its request to the gateway; the gateway checks who it is, enters the target system on its own and gives the agent only the response. Along the way we also tried Vault's AWS secrets engine, but it could not set a separate source identity for each caller, so customers would not have been able to tell our agents apart in CloudTrail.

One request, end to end

The agent first sends a single request, signed with its own IAM role, to a small Lambda function. Lambda sees the caller as already verified by AWS and has KMS sign a five-minute JWT. The token carries the agent's role and nothing else. No secret is stored, so there is no secret to rotate or leak.

One request, end to end. The customer's credentials stay between the gateway and the customer account.

Figure 1. One request, end to end. The customer's credentials stay between the gateway and the customer account.

The gateway validates the token (in strict mode this time), then checks the route's rule: is this the role allowed to use this route? The rule is a one-line CEL expression. If it passes, the gateway assumes the read-only role the customer created for us, with an external ID and a session tag, signs the request and returns the response. The agent never sees the customer's credentials, and the customer can end our access at any moment by changing that role's trust policy. We write the token's jti into every log line, so a call can be followed from the signer's log to the gateway's log and on to the customer's CloudTrail.

A route looks like this:

routes:
- name: customer-x-aws-ec2
gateways: [default]
matches:
- path:
pathPrefix: /customer-x/aws/ec2
method: GET
policies:
authorization:
rules:
- require: 'jwt.sub == "arn:aws:iam::111122223333:role/assessment-agent"'
urlRewrite:
path:
full: "/"
backends:
- host: ec2.eu-west-1.amazonaws.com:443
policies:
backendTLS: {}
backendAuth:
aws:
region: eu-west-1
serviceName: ec2
assumeRole:
roleArn: arn:aws:iam::444455556666:role/kloia-readonly
externalId: example-external-id

  

The first deployment is small: two tasks of the smallest size on ECS Fargate, a load balancer reachable only from inside the VPC, an RDS database for the routes, and the signer. Nothing is reachable from the internet, the admin UI is only reachable through a Cloudflare Access tunnel, and adding a route needs no deploy. Because the gateway runs as a single container, the same pattern fits a customer's OpenShift or an air-gapped data center.

What owning a gateway costs

The token-less request was not the only surprise. Our first AWS call failed with "Credential should be scoped to correct service: 'sts'" because we had not set serviceName and region on the backend. Our configuration check (--validate-only) approved a rule with a made-up function in it, because it never compiled the CEL expressions. And opening routes only to GET does not make them read-only: some AWS query APIs accept write actions over GET, so the customer's read-only role is the real barrier.

None of this is hard to fix. All of it is ours to find, and that is exactly the work a managed gateway takes off the table.

In AIOps, agents go through the same gate

The AIOps Orchestrator is the platform we use at kloia to run agents as pipelines. Each agent starts in its own sandbox pod with its own IAM role, does its job and shuts down. When it needs to ask a model, read a file on GitHub or touch a customer integration, there is one place it can go: kloia AI Gateway. The sandbox's network rules do not let it go anywhere else.

The gateway opens three doors here. /llm takes model calls to Amazon Bedrock. /internal/mcp/<name> sits in front of the MCP servers for kloia's own integrations, and /customer/<tenant>/mcp/<name> in front of customer integrations. The five-minute token now carries a list of grants next to the role. There are two layers, both closed by default: the route check looks at the grant, then the MCP policy decides which tools this role may call. Some values never come from the agent: the gateway adds the GitHub organization to every call itself and refuses calls that send a different one.

The Orchestrator compiles per-role tool lists from what each agent needs and sends them to the gateway as a pull request with a data file, which the gateway team reviews and merges. These rules can only narrow access: no rule can open a door the grant has not opened.

The first agents: sorting out leaked secrets

The first workflow running this way is secret triage. When our security scans find something that looks like a secret in a repository, they open an issue. Some are real leaks; most are test data or sample values. Two agents share the load.

secret-fp-analyzer can only read. It can list and read issues on GitHub and look at the file in question; it has no other tools. It masks the lines it finds, sends them to the model through /llm and decides whether this is a real leak or a false alarm.

secret-remediator can propose a fix: it can create a branch, push the change, open a draft pull request and comment on the issue. Its write token is bound to a limited list of repositories, and there is no merge in its tool list. A person always reviews the draft PR.

Figure 2. The secret triage agents. Each gets its own token and grant, and every call goes through the gateway.

We tested these rules one by one in the sandbox: a call without a token gets a 401, a tool outside the allowlist gets a 400, and a call aimed at another organization is refused. The organization the gateway adds is not a security boundary on its own; the real boundary is the list of repositories the write token can reach. The first real run starts by hand with a single issue, and if it goes cleanly we connect it to a webhook.

Every piece of this maps onto AgentCore Gateway. Grants become inbound authorization and Cedar policy, the per-role tool lists become Policy rules, and the values we inject can live in a request interceptor. For a tenant whose agents and data are all on AWS, that is the setup we would reach for first.

Side by side

Here is how the two compare:

 

AgentCore Gateway

kloia AI Gateway

Best fit

Agents and data on AWS

On-prem, in-country or air-gapped data

Model

Fully managed, serverless

Built by kloia, self-hosted; ECS Fargate, Kubernetes or a single container

Main job

Tool hub: turns APIs into MCP tools, with passthrough and model routing

Credential broker and single gate for model and MCP traffic

What the agent sees

MCP tool list with semantic search

Customer APIs and MCP tools, limited by grants

Inbound identity

JWT, IAM (SigV4), authenticate-only

5-minute JWT from the agent's IAM role, with grants

Outbound identity

Per target: service role, caller IAM, OAuth, API key, token passthrough

Per route: AssumeRole into the customer's role with external ID and session tag

Authorization

Cedar policy on every tool call; Lambda interceptors

Grant check and per-role tool lists, deny by default

Network

PrivateLink ingress; VPC Lattice, VPC Link or Lambda to private and on-prem targets

Runs inside the private network it serves

Audit trail

Built-in observability and auditing, CloudWatch

One log line per request; jti links it to the customer's CloudTrail

Location

About 20 AWS Regions, including Frankfurt and Ireland

Anywhere: on-prem, in-country, air-gapped

Operations

AWS: scaling, patching, availability

kloia: HA, upgrades, alarms, backups

Cost

Usage-based; 0.005 USD per thousand calls

About 55 USD a month for the first deployment, plus the people who run it

 

Four industries, four stories

The table only goes so far; the decision comes from the industry and from where the data lives. Two of the stories below end with AgentCore Gateway, one with kloia AI Gateway and one with both. They come from our own work and from conversations with customers in recent months, and we leave the names out on purpose.

An e-commerce company: campaign week

An e-commerce company that runs entirely on AWS prepares an agent for its customer service team during campaign week. The agent will look up orders, open tickets in Zendesk, file bugs in Jira and start refunds under a certain amount.

This is AgentCore Gateway's home ground. Tools come out of the order service's OpenAPI definition in minutes. The Zendesk and Jira integrations are ready, AgentCore Identity handles the OAuth flows, and the agent acts on behalf of each representative with that person's permissions. The refund limit lives in a Cedar policy on the Gateway rather than in the agent's code, so the security team can change it without a single line from the agent team. When traffic multiplies on campaign day, scaling is AWS's job.

A managed service provider: a 5xx alarm at night

The error rate climbs on the payment service of a customer whose AWS accounts are run by a managed service provider. The alarm wakes an SRE agent that needs to read CloudWatch metrics, EKS events and APM traces across that customer's accounts.

With everything on AWS, AgentCore Gateway does the job. Each customer gets a Lambda target that assumes a read-only role in their account with an external ID, so the customer keeps their own off switch in the role's trust policy. Cedar policy keeps each agent to its own customers, and a SaaS APM tool connects as an API-key target. When the Lambda sets the session name from the calling agent, the customer's security team sees in their own CloudTrail which agent made each call.

A bank: the data cannot leave Türkiye

A bank's platform team wants an agent that investigates incidents in services running on OpenShift. The model runs in the bank's own data center, and the logs may contain customer secrets.

In the first meeting the conversation never got to technology. Under BDDK rules the bank's primary and secondary systems stay in the country, and there is no AWS Region in Türkiye. This is the case kloia AI Gateway was built for. It runs as a single container on the bank's OpenShift, its /llm door can point to the bank's own model, and the credentials for the bank's systems never leave the bank. We are clear about the trade-off: the gateway has to be deployed as an isolated component, hold no long-lived secret, run a pinned version, and someone has to own it.

A factory: without touching the OT network

A manufacturer wants an agent its shift supervisors can ask, "Why did line 3 stop last night?" Half of the answer is on the IT side, in ServiceNow records and Slack threads. The other half is in the plant's historian and MES, on an OT network that accepts no inbound connections.

Here we use both. AgentCore Gateway is the agent's single door and offers the IT tools as MCP tools, with Cedar policy deciding who may see which line's data. In the plant's DMZ, kloia AI Gateway exposes the read-only APIs of the historian and the MES. AgentCore reaches it over Direct Connect on a private link, and our gateway validates the incoming JWT, holds the OT service account itself and allows nothing but GET.

Figure 3. The factory scenario. AgentCore Gateway in the cloud, kloia AI Gateway in the plant DMZ.

OT credentials never leave the plant, and the OT team owns its own gate. Tool discovery, policy and scaling stay with AWS. This design is still on paper; we will write about it once we have tried it.

The bill

Cost points the same way. In AgentCore, a million tool calls cost 5 dollars in call charges. Policy evaluations, semantic search and CloudWatch add to that, but for most workloads the total stays small.

The first deployment of kloia AI Gateway costs about 55 dollars a month: 14.42 for two Fargate tasks, 19.40 for the load balancer, 14.95 for RDS, and the rest for KMS, Secrets Manager, alarms and logs, before the NAT gateway we share with other workloads. On call charges alone, AgentCore only catches up at around 11 million calls a month. The bigger cost of our own gateway is not on the bill at all: upgrades, alarms, database backups and the on-call engineer who gets up at night.

How we decide

These are the questions we ask in a first meeting with a customer, in this order:

Figure 4. Which gateway? AgentCore Gateway is the default on AWS; data and network rules decide when we move away from it.

It is a map for the conversation rather than a rule, but most of our AWS conversations end with AgentCore Gateway.

Where we are today

On AWS, we start with AgentCore Gateway. kloia AI Gateway is live with one customer route and has been tested end to end with a real agent; in the AIOps sandbox the secret triage agents have their grants and their first manual run is next. Its job from here is clear: carry the same model into the places AWS cannot reach.

As for that token-less request, it is the first thing we should try after every upgrade of our own gateway, and one more reason we let AWS run the gate wherever it can.

References:

 

FAQ

Is AgentCore Gateway only for MCP tools?

No. It started as an MCP tool gateway, but it now also fronts other agents and plain HTTP services through passthrough targets, A2A traffic included, and it routes model calls across providers through the same endpoint.

Can AgentCore Gateway reach systems in our own data center?

Yes, as long as the data is allowed to pass through an AWS Region. The Gateway reaches private targets through VPC Lattice, VPC Link or a Lambda function in your VPC, and from there on-prem systems over Direct Connect or VPN. When the data must not leave the site or the country, that is the point where kloia AI Gateway comes in.

How do we control which tools an agent may call?

With Policy in AgentCore. Cedar rules attached to the Gateway are checked on every tool call before it reaches the target, and they can validate inputs too, such as a refund limit. You can write the rules in natural language and have them converted to Cedar. In kloia AI Gateway, the grants in the token and the per-role tool lists do the same job.

Can one agent safely read many customers' AWS accounts through AgentCore?

Yes, with one design choice. Keep the gateway's service role narrow, because every target that uses it shares it. Put the cross-account step in a Lambda target that assumes a read-only role in each customer's account with an external ID, so every customer can cut access from their own trust policy.

Why do Turkish banks need a self-hosted gateway?

BDDK rules require banks to keep their primary and secondary systems in Türkiye, and there is no AWS Region in the country; the closest AgentCore Region is Frankfurt. For agents that touch that data, kloia AI Gateway runs inside the bank, next to the bank's own model and systems.

Which one costs less?

For most workloads, AgentCore Gateway. Gateway calls cost half a cent per thousand, so a million tool calls come to 5 dollars before Policy, search and CloudWatch. The first deployment of kloia AI Gateway costs about 55 dollars a month, and the bigger cost is the people who upgrade, monitor and back it up.

Back to top

 

Get Email Notifications

No Comments Yet

Let us know what you think