As enterprises quickly undertake AI brokers to automate workflows and improve productiveness, they face a vital scaling problem: managing safe entry to hundreds of instruments throughout their group. Fashionable AI deployments not contain a handful of brokers calling just a few APIs—as an alternative, enterprises are constructing unified AI platforms the place a whole bunch of brokers, client AI purposes, and automatic workflows must entry hundreds of Mannequin Context Protocol (MCP) instruments spanning completely different groups, organizations, and enterprise models.
This enhance in scale creates a basic safety and governance downside: How do you be certain that every calling principal—whether or not it’s an AI agent, consumer, or software—solely accesses the instruments they’re licensed to make use of? How do you dynamically filter software availability based mostly on consumer id, agent context, the channel by which entry is requested, and consistently evolving permissions? How do you defend delicate knowledge because it flows by multi-hop workflows from brokers to instruments to downstream APIs? And the way do you accomplish all of this with out sacrificing efficiency, creating operational bottlenecks, or forcing groups to deploy separate MCP server situations for each tenant or use case?
To deal with these challenges, we’re launching a brand new function: gateway interceptors for Amazon Bedrock AgentCore Gateway. This highly effective new functionality gives fine-grained safety, dynamic entry management, and versatile schema administration.
High-quality-grained entry management for software entry
Enterprise clients are deploying hundreds of MCP instruments served by a unified AgentCore Gateway. These clients use this single MCP gateway to entry instruments from completely different groups, organizations, client AI purposes, and AI brokers, every with their corresponding entry permissions assigned to the calling principal. The problem is securing MCP software entry based mostly on the calling principal’s entry permissions and contextually responding to ListTools, InvokeTool, and Search calls to AgentCore Gateway.
Device filtering have to be based mostly on a number of dynamic elements, together with agent id, consumer id, and execution context, the place permissions would possibly change dynamically based mostly on consumer context, the channel by which the consumer is accessing the brokers, workspace entry ranges, and different contextual attributes. This requires security-conscious filtering the place permission modifications instantly have an effect on software availability with out caching stale permission states.
The next diagram gives an instance of consumer based mostly software filtering and units the context for the way the gateway evaluates id and context earlier than returning the allowed instruments.
Schema translation and knowledge safety between MCP and downstream APIs
Prospects face complicated challenges in managing the contract between AI brokers and downstream APIs whereas sustaining safety and adaptability. Organizations should dynamically map MCP request schemas to corresponding downstream API schemas, enabling vital knowledge safety capabilities resembling redacting or eradicating delicate knowledge like personally identifiable data (PII) or delicate private data (SPI) that customers would possibly ship as a part of prompts to brokers. This prevents delicate knowledge leakage to downstream APIs when such data isn’t wanted for the API name.
Moreover, clients require schema translation capabilities to deal with API contract modifications whereas preserving the MCP schema intact and decoupled from downstream implementations. This decoupling permits smoother API evolution and versioning with out breaking the AI agent and gear contracts, so backend groups can modify their API implementations, change subject names, restructure payloads, or replace authentication necessities with out forcing modifications to the agent layer or requiring retraining of AI fashions which have realized particular software schemas.
Tenant isolation for multi-tenant SaaS
Organizations providing brokers as a service or instruments as a service face complicated multi-tenancy necessities. Prospects should deploy their MCP servers for all their customers whereas sustaining correct tenant isolation, requiring each tenant ID and consumer ID to be handed and validated. Multi-tenant MCP server architectures require completely different clients and workspaces to stay utterly remoted, with software entry strictly managed based mostly on tenant boundaries. The problem extends to figuring out whether or not separate gateways are wanted per tenant or if a single gateway can safely deal with multi-tenant situations with correct isolation ensures.
Dynamic software filtering
Prospects want real-time, context-aware software filtering that adapts to altering permissions and consumer contexts. Organizations require unified MCP servers that may filter instruments in two levels: first by agent permissions and workspace context, then by semantic search—with vital necessities that no caching happens for dynamically filtered software lists as a result of permissions would possibly change at any time.
Customized header propagation and id context administration
AI brokers are basically completely different from conventional microservices in that they’re autonomous and non-deterministic of their conduct. In contrast to conventional microservice-to-microservice authorization approaches that usually depend on service-to-service belief and authorization methods, AI brokers must execute workflows on behalf of end-users and entry downstream instruments, APIs, and assets based mostly on consumer execution context. Nonetheless, sending the unique authorization tokens to downstream providers creates important safety vulnerabilities, resembling stolen credentials, privilege escalation, and the confused deputy downside, the place a extra privileged service is tricked into performing actions on behalf of a much less privileged attacker.
Impersonation vs. act-on-behalf approaches
Prospects face a basic safety resolution in how id context propagates by multi-hop workflows (agent to agent to software to API): utilizing an impersonation method or an act-on-behalf method.
With an impersonation method, the unique consumer’s JWT token is handed unchanged by every hop within the name chain. Though easier to implement, this method creates important safety dangers. We don’t advocate this method as a result of following dangers:
- Downstream providers obtain tokens with broader privileges than vital
- Elevated threat of privilege escalation if any part is compromised
- Token scope can’t be restricted to particular downstream targets
- Susceptible to confused deputy assaults, the place compromised providers can abuse overly privileged tokens
In an act-on-behalf method, every hop within the workflow receives a separate, scoped token particularly issued for that downstream goal, and JWT is used for propagating the execution context all through. This method is the beneficial method as a result of it gives the next advantages:
- Precept of least privilege – Every service receives solely the permissions it must entry particular downstream APIs
- Diminished blast radius – Compromised tokens have restricted scope and might’t be reused elsewhere
- Higher auditability – A transparent chain of custody exhibits which service acted on behalf of the consumer utilizing AgentCore Observability
- Token scope limitation – Every downstream goal receives tokens or credentials scoped particularly for its APIs
- Safety boundaries – Correct isolation is enforced between completely different providers within the name chain
- Confused Deputy prevention – Restricted-scope tokens and credentials stop providers from being tricked into performing unauthorized actions
The act-on-behalf mannequin requires the gateway to extract execution context from incoming requests, generate new scoped authorization tokens for every downstream goal, and inject applicable headers whereas sustaining the consumer’s id context for auditing and authorization choices—all with out exposing overly privileged credentials to downstream providers. This safe method makes certain AI brokers can execute workflows on behalf of customers whereas sustaining strict safety boundaries at each hop within the name chain.
The next diagram compares the workflows of impersonation vs. act-on-behalf approaches.

Within the impersonation method (high), when Person A connects to the agent, the agent passes Person A’s full id token with full scopes ("order: learn, promotions:write") unchanged to each the Order software and Promotions software, that means every software receives extra permissions than it wants. In distinction, the act-on-behalf method (backside) exhibits the agent creating separate, scoped tokens for every software—the Order software receives solely the "order: learn" scope, the Promotions software receives solely the "promotions:write" scope, and every token contains an "Act: Agent" subject, which establishes a transparent chain of accountability displaying the agent is appearing on behalf of Person A. This demonstrates how delegation implements the precept of least privilege by limiting every downstream service to solely the particular permissions it wants, lowering safety dangers and stopping potential token misuse.
AgentCore Gateway: Safe MCP integration for AI brokers
AgentCore Gateway transforms your present APIs and AWS Lambda features into agent-compatible instruments, connects to present MCP servers, and gives seamless integration with important third-party enterprise instruments and providers (resembling Jira, Asana, and Zendesk). This unified entry level allows safe integration throughout your enterprise methods. With AgentCore Id, brokers can securely entry and function throughout these instruments with correct authentication and authorization utilizing OAuth requirements.
With the launch of gateway interceptors, AgentCore Gateway helps organizations implement fine-grained entry management and credential administration by customized Lambda features at two vital factors:
- Gateway request interceptor – The request interceptor Lambda operate processes incoming requests earlier than they attain their goal instruments, enabling fine-grained entry controlling based mostly on consumer credentials, session context, and organizational insurance policies, audit path creation, schema translation, and extra.
- Gateway response interceptor – The response interceptor Lambda operate processes outgoing responses earlier than they return to the calling agent, permitting for audit path creation, instruments filtering, schema translation, and fine-grained entry controlling the search and checklist instruments.
The next diagram illustrates the request-response movement by gateway interceptors.

Let’s study the particular payload constructions that customized interceptors obtain and should return at every stage of the request-response cycle. The gateway request interceptor receives an occasion with the next construction:
Your gateway request interceptor Lambda operate should return a response with the transformedGatewayRequest subject:
After the goal service responds, the gateway response interceptor is invoked with an occasion containing the unique request and the response:
Your gateway response interceptor Lambda operate should return a response with the transformedGatewayResponse subject:
Understanding this request-response construction is important for implementing the customized interceptor logic we discover later on this submit. Gateway interceptors present vital capabilities for securing and managing agentic AI workflows:
- Header administration – Move authentication tokens, correlation IDs, and metadata by customized headers
- Request transformation – Modify request payloads, add context, or enrich knowledge earlier than it reaches goal providers
- Safety enhancement – Implement customized authentication, authorization, and knowledge sanitization logic
- High-quality-grained entry management – Safe MCP software entry based mostly on the calling principal’s entry permissions and contextually responding to ListTools, InvokeTool, and Search calls to AgentCore Gateway
- Tenant isolation for multi-tenant MCP instruments – Implement tenant isolation and entry controls based mostly on calling consumer, agent, and tenant identities in a multi-tenant atmosphere
- Observability – Add logging, metrics, and tracing data to watch agentic workflows
Gateway interceptors work with AgentCore Gateway goal sorts: together with Lambda features, OpenAPI endpoints, and MCP servers.
Use circumstances with gateway interceptors
Gateway interceptors allow versatile safety and entry management patterns for agentic AI methods. This submit showcases three approaches: implementing fine-grained entry management for invoking instruments, dynamic instruments filtering based mostly on consumer permissions, and id propagation throughout distributed methods.
Implementing fine-grained entry management for invoking instruments
AgentCore Gateway exposes a number of backend instruments by a unified MCP endpoint. Customers with completely different roles require completely different software permissions. You may implement fine-grained entry management utilizing JWT scopes mixed with gateway interceptors to ensure customers can solely invoke licensed instruments and uncover instruments that belong to their position or workspace. High-quality-grained entry management makes use of JWT scope values issued by Amazon Cognito (or one other OAuth 2 supplier). You may also implement this utilizing a YAML file or a database with mapped permissions. We observe a easy naming conference: customers obtain both full entry to an MCP goal (for instance, mcp-target-123) or tool-level entry (for instance, mcp-target-123:getOrder). These scopes map on to software permissions within the scope declare as a part of the incoming OAuth token, making the authorization mannequin predictable and simple to audit.
The next diagram illustrates this workflow.

The request interceptor enforces permissions at execution time by the next steps:
- Extract and decode the JWT to retrieve the scope declare.
- Determine which software is being invoked (utilizing
instruments/name). - Block the request if the consumer lacks both full goal entry or tool-specific permission based mostly on the configuration file or entry coverage knowledge retailer.
- Return a structured MCP error for unauthorized invocations, stopping the backend software handler from executing.
The core authorization operate is deliberately minimal:
This sample allows predictable enforcement for each invocation and discovery paths (mentioned additional within the subsequent part). You may prolong the mannequin with further claims (for instance, tenantId and workspaceId) for multi-tenant architectures.
For operational safety, preserve interceptors deterministic, keep away from complicated branching logic, and rely solely on token claims slightly than giant language mannequin (LLM) directions. By imposing authorization on the gateway boundary—earlier than the LLM sees or executes any software—you obtain robust isolation throughout roles, tenants, and domains with out modifying software implementations or MCP targets.
Dynamic instruments filtering
Brokers uncover obtainable instruments by two main strategies: semantic search capabilities that enable pure language queries (like “discover instruments associated to order administration”) and normal (instruments/checklist) operations that present a whole stock of obtainable instruments. This discovery mechanism is prime to agent performance, however it additionally presents important safety concerns. With out correct filtering controls, MCP servers would return a complete checklist of all obtainable instruments, whatever the requesting agent’s or consumer’s authorization degree. This unrestricted software discovery creates potential safety vulnerabilities by exposing delicate capabilities to unauthorized customers or brokers.
When a goal returns an inventory of instruments in response to semantic search or MCP instruments/checklist requests, the gateway response interceptor can be utilized to implement fine-grained entry management. The interceptor processes the response earlier than it reaches the requesting agent, so customers can solely uncover instruments they’re licensed to entry. The workflow consists of the next steps:
- The goal validates the incoming JWT token and returns both the entire software checklist or a filtered set based mostly on semantic search, no matter fine-grained entry management.
- The configured response interceptor is invoked by AgentCore Gateway. The response interceptor extracts and decodes the JWT from the payload, retrieving the scope claims that outline the consumer’s permissions.
- For every software within the checklist, the interceptor evaluates the consumer’s authorization based mostly on the JWT scopes.
- Instruments that the consumer isn’t licensed to entry are faraway from the checklist.
- The response interceptor returns a reworked response containing solely the licensed instruments.
The next diagrams illustrate this workflow for each instruments.


The next is a code snippet of the response interceptor Lambda handler that performs JWT token extraction, software checklist retrieval, and permission-based filtering earlier than returning the reworked response with licensed instruments:
The filter_tools_by_scope operate implements an authorization examine for every software in opposition to the consumer’s allowed scopes:
The entire implementation might be discovered within the GitHub repo.
Customized headers propagation
As AI brokers work together with a number of downstream providers, sustaining consumer id throughout service boundaries turns into vital for safety, compliance, and audit trails. When brokers invoke instruments by AgentCore Gateway, the unique consumer’s id should movement from the agent to the gateway, and from the gateway to focus on providers. With out correct id propagation, downstream providers can’t implement user-specific authorization insurance policies, keep correct audit logs, or implement tenant isolation. This problem intensifies in multi-tenant environments the place completely different customers share the identical agent infrastructure however require strict knowledge separation.
Gateway request interceptors extract id data from incoming request headers and context, rework it into the format anticipated by downstream providers, and enrich requests earlier than they attain goal providers by following these steps:
- The gateway request interceptor extracts authorization headers from incoming requests and transforms them for downstream providers.
- AgentCore Gateway orchestrates the request movement and manages interceptor execution.
- The goal invocation receives enriched requests with correctly formatted id data.
The gateway request interceptor helps organizations achieve end-to-end visibility into consumer actions, implement constant authorization insurance policies throughout service boundaries, and keep compliance with knowledge sovereignty necessities.
The workflow consists of the next steps:
- The MCP shopper calls AgentCore Gateway.
- AgentCore Gateway authenticates the inbound request.
- AgentCore Gateway invokes the customized interceptor.
- The gateway request interceptor transforms the incoming request payload by including an authorization token as a parameter to ship to the downstream Lambda goal. (We don’t advocate sending the incoming JWT as-is to downstream APIs as a result of it’s insecure as a result of threat of privilege escalation and stolen credentials. Nonetheless, there is perhaps exceptions the place the agent must name the MCP server with an entry token for downstream APIs.) Alternatively, you’ll be able to take away the inbound JWT coming from the request and add a brand new JWT with a least-privileged scoped-down token for calling related downstream APIs.
- AgentCore Gateway calls the goal with the reworked request. The goal has the authorization token handed by the interceptor Lambda operate.
- AgentCore Gateway returns the response from the goal.
The next diagram illustrates this workflow.

The next is a code snippet of the interceptor Lambda handler that performs customized header propagation:
No auth and OAuth based mostly authorization
Many enterprises want versatile authorization fashions that stability discoverability with safety. Take into account a situation the place you need to enable AI brokers and purposes to find and search obtainable MCP instruments with out requiring authorization, enabling seamless software exploration and semantic search throughout your software catalog. Nonetheless, in the case of really invoking these instruments, you want strict OAuth-based authorization to ensure solely licensed brokers and customers can execute software calls. You would possibly even want per-tool authorization insurance policies, the place some instruments require authentication whereas others stay publicly accessible, or the place completely different instruments require completely different permission ranges based mostly on the calling principal’s id and context.
AgentCore Gateway now helps this flexibility by the introduction of a “No Auth” authorization sort on the gateway degree for all inbound calls. When configured, this makes all targets and instruments accessible with out authentication for discovery functions. To implement OAuth authorization on the technique degree (ListTools vs. CallTools) or implement per-tool authorization insurance policies, you should utilize gateway interceptors to look at the inbound JWT, validate it in opposition to the necessities based on RFC 6749 utilizing your authorization server’s discovery URL, and programmatically enable or deny entry to particular strategies or software calls. This method provides you fine-grained management: open discovery for ListTools and SearchTools requests whereas imposing strict OAuth validation for CallTools requests, and even implementing customized authorization logic that varies by software, consumer position, execution context, or different enterprise logic your group requires—all whereas preserving your MCP calls safe and compliant together with your safety insurance policies.
The next diagram illustrates this workflow.

The method begins with a ListTools name with No Auth to the AgentCore Gateway, which is configured with basic no-auth for all inbound calls. With this configuration, customers can uncover obtainable instruments with out authorization. Nonetheless, when the consumer subsequently makes a CallTool request to invoke a particular software, authorization is required. AgentCore Gateway invokes the customized request interceptor Lambda operate, which validates the JWT token from the authorization header and checks the consumer’s scopes and permissions in opposition to the particular software being invoked. If licensed, the interceptor transforms and enriches the request with the mandatory authorization context, and AgentCore Gateway forwards the reworked request to the goal service. The goal processes the request and returns a response, which AgentCore Gateway then returns to the shopper, imposing strict OAuth-based authorization for precise software execution whereas sustaining open discovery for software itemizing.
To create a gateway configured with No Auth for inbound calls, use authorizerType as NONE, as proven within the following CreateGateway API:
Observability
Complete observability supplied by AgentCore Observability is vital for monitoring, debugging, and auditing AI agent workflows that work together with a number of instruments and providers by AgentCore Gateway. Gateway interceptors implement authorization, rework requests, and filter knowledge earlier than downstream providers execute, making the observability layer a vital safety boundary. This provides the next key advantages:
- Safety resolution visibility – Interceptors generate authoritative logs for authorization outcomes, together with enable/deny choices and the evaluated JWT scopes. This gives a transparent audit path for reviewing rejected requests, validating coverage conduct, and analyzing how authorization guidelines are enforced throughout software invocations.
- Request and response traceability – Interceptors seize how MCP requests and responses are modified, resembling header enrichment, schema translation, and delicate knowledge redaction. This delivers full traceability of payload modifications and helps safe, compliant knowledge dealing with throughout agent workflows.
- Downstream software observability – Interceptors log downstream software conduct, together with standing codes, latency, and error responses. This creates constant visibility throughout targets, serving to groups troubleshoot failures, determine reliability points, and perceive end-to-end execution traits.
These logs additionally seize id and context attributes, serving to groups validate authorization conduct and isolate points in environments the place a number of consumer teams or tenants share the identical gateway. Gateway interceptors routinely combine with AgentCore Observability, offering the next options:
- Actual-time monitoring of authorization choices
- Efficiency bottleneck identification by length and invocation metrics
- Finish-to-end traceability throughout multi-hop agentic workflows
- Id and context attributes for validating authorization conduct in multi-tenant environments
The next screenshot exhibits pattern metrics from Amazon CloudWatch log teams for a gateway interceptor.

The metrics show wholesome gateway interceptor efficiency with a 100% success fee, minimal latency (4.47 milliseconds common), and no throttling points, indicating the system is working inside optimum parameters.
The next screenshot exhibits pattern logs from CloudWatch for a gateway interceptor.

AgentCore Observability integration helps you monitor authorization choices in actual time, determine efficiency bottlenecks, and keep end-to-end traceability throughout multi-hop agentic workflows.
Conclusion
AgentCore Gateway with gateway interceptors addresses the basic safety and entry management challenges organizations face when deploying agentic AI methods at scale. The three patterns demonstrated—fine-grained entry management for software invocation, dynamic software filtering, and id propagation—present foundational constructing blocks for safe agentic architectures that bridge authentication gaps, keep credential isolation, and implement customized safety insurance policies. By offering programmable interception factors for each requests and responses, organizations can implement fine-grained entry management with out modifying underlying software implementations or MCP server architectures. As organizations scale to a whole bunch of brokers and hundreds of instruments, gateway interceptors present the flexibleness and management wanted to take care of safety, compliance, and operational visibility throughout complicated agentic AI deployments whereas aligning with enterprise integration patterns and safety greatest practices. AgentCore Gateway with gateway interceptors gives a versatile basis for implementing enterprise-grade safety controls throughout agentic AI architectures. To be taught extra about how one can apply gateway interceptors to resolve widespread enterprise challenges, seek advice from the next code samples:
For full documentation on gateway interceptor configuration and deployment, seek advice from High-quality-grained entry management for Amazon Bedrock AgentCore Gateway.
Concerning the Authors
Dhawal Patel is a Principal Generative AI Tech lead at AWS. He has labored with organizations starting from giant enterprises to mid-sized startups on issues associated to agentic AI, deep studying, and distributed computing.
Ganesh Thiyagarajan is a Senior Options Architect at AWS with over 20 years of expertise in software program structure, IT consulting, and answer supply. He helps ISVs rework and modernize their purposes on AWS. He’s additionally a part of the AI/ML Technical subject neighborhood, serving to clients construct and scale generative AI options.
Avinash Kolluri is a Sr Options Architect at AWS. He works with Amazon and its subsidiaries to design and implement cloud options that speed up innovation and operational excellence. With deep experience in AI/ML infrastructure and distributed methods, he focuses on serving to clients use AWS providers for constructing foundational fashions, workflow automation, and generative AI options.
Bhuvan Annamreddi is a Options Architect at AWS. He works with ISV clients to design and implement superior cloud architectures and helps them improve their merchandise through the use of AWS providers. He’s enthusiastic about serving to clients construct scalable, safe, and modern methods, with a robust curiosity in generative AI and serverless structure as enablers for delivering significant enterprise worth.
Mohammad Tahsin is a Generative AI Specialist Options Architect at AWS, the place he works with clients to design, optimize, and deploy fashionable AI/ML options. He’s enthusiastic about steady studying and staying on the frontier of latest capabilities within the subject. In his free time, he enjoys gaming, digital artwork, and cooking.
Ozan Deniz works as a Software program Growth Engineer in AWS. He and his crew deal with enhancing the vendor capabilities by generative AI. When not at work, he enjoys exploring the outside.
Kevin Tsao is a Software program Growth Engineer throughout the AgentCore Gateway crew. He has been at Amazon for six years and has been working within the conversational AI and agentic AI house because the starting of his tenure, contributing to providers resembling Bedrock Brokers and Amazon Lex.

