As enterprises quickly undertake AI brokers to automate workflows and improve productiveness, they face a vital scaling problem: managing safe entry to 1000’s of instruments throughout their group. Fashionable AI deployments now not contain a handful of brokers calling a number of APIs—as an alternative, enterprises are constructing unified AI platforms the place a whole lot of brokers, client AI purposes, and automatic workflows have to entry 1000’s of Mannequin Context Protocol (MCP) instruments spanning completely different groups, organizations, and enterprise items.
This improve in scale creates a basic safety and governance downside: How do you ensure 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 instrument availability primarily based on consumer identification, agent context, the channel by way of which entry is requested, and continuously evolving permissions? How do you shield delicate knowledge because it flows by way of 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 instrument entry
Enterprise prospects are deploying 1000’s of MCP instruments served by way of a unified AgentCore Gateway. These prospects 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 instrument entry primarily based on the calling principal’s entry permissions and contextually responding to ListTools, InvokeTool, and Search calls to AgentCore Gateway.
Device filtering have to be primarily based on a number of dynamic elements, together with agent identification, consumer identification, and execution context, the place permissions may change dynamically primarily based on consumer context, the channel by way of which the consumer is accessing the brokers, workspace entry ranges, and different contextual attributes. This requires security-conscious filtering the place permission adjustments instantly have an effect on instrument availability with out caching stale permission states.
The next diagram gives an instance of consumer primarily based instrument filtering and units the context for a way the gateway evaluates identification and context earlier than returning the allowed instruments.
Schema translation and knowledge safety between MCP and downstream APIs
Prospects face advanced 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 similar to redacting or eradicating delicate knowledge like personally identifiable data (PII) or delicate private data (SPI) that customers may 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, prospects require schema translation capabilities to deal with API contract adjustments whereas maintaining the MCP schema intact and decoupled from downstream implementations. This decoupling permits smoother API evolution and versioning with out breaking the AI agent and power contracts, so backend groups can modify their API implementations, change discipline names, restructure payloads, or replace authentication necessities with out forcing adjustments to the agent layer or requiring retraining of AI fashions which have discovered particular instrument schemas.
Tenant isolation for multi-tenant SaaS
Organizations providing brokers as a service or instruments as a service face advanced 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 prospects and workspaces to stay fully remoted, with instrument entry strictly managed primarily based 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 eventualities with correct isolation ensures.
Dynamic instrument filtering
Prospects want real-time, context-aware instrument 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 instrument lists as a result of permissions may change at any time.
Customized header propagation and identification 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 sometimes depend on service-to-service belief and authorization methods, AI brokers have to execute workflows on behalf of end-users and entry downstream instruments, APIs, and assets primarily based on consumer execution context. Nonetheless, sending the unique authorization tokens to downstream providers creates vital safety vulnerabilities, similar to 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 identification context propagates by way of multi-hop workflows (agent to agent to instrument to API): utilizing an impersonation strategy or an act-on-behalf strategy.
With an impersonation strategy, the unique consumer’s JWT token is handed unchanged by way of every hop within the name chain. Though easier to implement, this strategy creates vital safety dangers. We don’t suggest this strategy as a result of following dangers:
- Downstream providers obtain tokens with broader privileges than crucial
- Elevated threat of privilege escalation if any element is compromised
- Token scope can’t be restricted to particular downstream targets
- Weak to confused deputy assaults, the place compromised providers can abuse overly privileged tokens
In an act-on-behalf strategy, 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 strategy is the beneficial strategy 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
- Lowered blast radius – Compromised tokens have restricted scope and may’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 forestall 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 identification context for auditing and authorization selections—all with out exposing overly privileged credentials to downstream providers. This safe strategy makes positive 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 strategy (high), when Person A connects to the agent, the agent passes Person A’s full identification token with full scopes ("order: learn, promotions:write") unchanged to each the Order instrument and Promotions instrument, which means every instrument receives extra permissions than it wants. In distinction, the act-on-behalf strategy (backside) exhibits the agent creating separate, scoped tokens for every instrument—the Order instrument receives solely the "order: learn" scope, the Promotions instrument receives solely the "promotions:write" scope, and every token consists of an "Act: Agent" discipline, which establishes a transparent chain of duty exhibiting 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 capabilities into agent-compatible instruments, connects to present MCP servers, and gives seamless integration with important third-party enterprise instruments and providers (similar to Jira, Asana, and Zendesk). This unified entry level permits safe integration throughout your enterprise techniques. With AgentCore Identification, 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 way of customized Lambda capabilities at two vital factors:
- Gateway request interceptor – The request interceptor Lambda perform processes incoming requests earlier than they attain their goal instruments, enabling fine-grained entry controlling primarily based on consumer credentials, session context, and organizational insurance policies, audit path creation, schema translation, and extra.
- Gateway response interceptor – The response interceptor Lambda perform 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 record instruments.
The next diagram illustrates the request-response stream by way of 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 perform should return a response with the transformedGatewayRequest discipline:
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 perform should return a response with the transformedGatewayResponse discipline:
Understanding this request-response construction is important for implementing the customized interceptor logic we discover later on this publish. Gateway interceptors present vital capabilities for securing and managing agentic AI workflows:
- Header administration – Go authentication tokens, correlation IDs, and metadata by way of 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 instrument entry primarily based 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 primarily based on calling consumer, agent, and tenant identities in a multi-tenant setting
- Observability – Add logging, metrics, and tracing data to watch agentic workflows
Gateway interceptors work with AgentCore Gateway goal varieties: together with Lambda capabilities, OpenAPI endpoints, and MCP servers.
Use circumstances with gateway interceptors
Gateway interceptors allow versatile safety and entry management patterns for agentic AI techniques. This publish showcases three approaches: implementing fine-grained entry management for invoking instruments, dynamic instruments filtering primarily based on consumer permissions, and identification propagation throughout distributed techniques.
Implementing fine-grained entry management for invoking instruments
AgentCore Gateway exposes a number of backend instruments by way of a unified MCP endpoint. Customers with completely different roles require completely different instrument permissions. You’ll be able to implement fine-grained entry management utilizing JWT scopes mixed with gateway interceptors to verify 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). It’s also possible to implement this utilizing a YAML file or a database with mapped permissions. We comply with 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 instrument permissions within the scope declare as a part of the incoming OAuth token, making the authorization mannequin predictable and easy to audit.
The next diagram illustrates this workflow.

The request interceptor enforces permissions at execution time by way of the next steps:
- Extract and decode the JWT to retrieve the scope declare.
- Establish which instrument is being invoked (utilizing
instruments/name). - Block the request if the consumer lacks both full goal entry or tool-specific permission primarily based on the configuration file or entry coverage knowledge retailer.
- Return a structured MCP error for unauthorized invocations, stopping the backend instrument handler from executing.
The core authorization perform is deliberately minimal:
This sample permits predictable enforcement for each invocation and discovery paths (mentioned additional within the subsequent part). You’ll be able to prolong the mannequin with extra claims (for instance, tenantId and workspaceId) for multi-tenant architectures.
For operational safety, maintain interceptors deterministic, keep away from advanced 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 instrument—you obtain sturdy isolation throughout roles, tenants, and domains with out modifying instrument implementations or MCP targets.
Dynamic instruments filtering
Brokers uncover accessible instruments by way of two main strategies: semantic search capabilities that enable pure language queries (like “discover instruments associated to order administration”) and customary (instruments/record) operations that present a whole stock of accessible instruments. This discovery mechanism is prime to agent performance, however it additionally presents vital safety concerns. With out correct filtering controls, MCP servers would return a complete record of all accessible instruments, whatever the requesting agent’s or consumer’s authorization degree. This unrestricted instrument 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/record 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 whole instrument record or a filtered set primarily based on semantic search, regardless of 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 instrument within the record, the interceptor evaluates the consumer’s authorization primarily based on the JWT scopes.
- Instruments that the consumer isn’t licensed to entry are faraway from the record.
- The response interceptor returns a remodeled 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, instrument record retrieval, and permission-based filtering earlier than returning the remodeled response with licensed instruments:
The filter_tools_by_scope perform implements an authorization test for every instrument towards the consumer’s allowed scopes:
The entire implementation will be discovered within the GitHub repo.
Customized headers propagation
As AI brokers work together with a number of downstream providers, sustaining consumer identification throughout service boundaries turns into vital for safety, compliance, and audit trails. When brokers invoke instruments by way of AgentCore Gateway, the unique consumer’s identification should stream from the agent to the gateway, and from the gateway to focus on providers. With out correct identification 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 identification data from incoming request headers and context, remodel 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 stream and manages interceptor execution.
- The goal invocation receives enriched requests with correctly formatted identification 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 suggest 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 could be 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 remodeled request. The goal has the authorization token handed by the interceptor Lambda perform.
- 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 primarily based authorization
Many enterprises want versatile authorization fashions that steadiness discoverability with safety. Think about a state of affairs the place you need to enable AI brokers and purposes to find and search accessible MCP instruments with out requiring authorization, enabling seamless instrument exploration and semantic search throughout your instrument catalog. Nonetheless, with regards to truly invoking these instruments, you want strict OAuth-based authorization to verify solely licensed brokers and customers can execute instrument calls. You may 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 primarily based on the calling principal’s identification and context.
AgentCore Gateway now helps this flexibility by way of the introduction of a “No Auth” authorization kind 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 use gateway interceptors to look at the inbound JWT, validate it towards the necessities in accordance with RFC 6749 utilizing your authorization server’s discovery URL, and programmatically enable or deny entry to particular strategies or instrument calls. This strategy offers 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 instrument, consumer position, execution context, or different enterprise logic your group requires—all whereas maintaining 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 normal no-auth for all inbound calls. With this configuration, customers can uncover accessible instruments with out authorization. Nonetheless, when the consumer subsequently makes a CallTool request to invoke a particular instrument, authorization is required. AgentCore Gateway invokes the customized request interceptor Lambda perform, which validates the JWT token from the authorization header and checks the consumer’s scopes and permissions towards the particular instrument being invoked. If licensed, the interceptor transforms and enriches the request with the required authorization context, and AgentCore Gateway forwards the remodeled 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 instrument execution whereas sustaining open discovery for instrument 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 way of AgentCore Gateway. Gateway interceptors implement authorization, remodel requests, and filter knowledge earlier than downstream providers execute, making the observability layer a vital safety boundary. This presents the next key advantages:
- Safety resolution visibility – Interceptors generate authoritative logs for authorization outcomes, together with enable/deny selections 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 instrument invocations.
- Request and response traceability – Interceptors seize how MCP requests and responses are modified, similar to header enrichment, schema translation, and delicate knowledge redaction. This delivers full traceability of payload adjustments and helps safe, compliant knowledge dealing with throughout agent workflows.
- Downstream instrument observability – Interceptors log downstream instrument 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 identification 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 robotically combine with AgentCore Observability, offering the next options:
- Actual-time monitoring of authorization selections
- Efficiency bottleneck identification by way of period and invocation metrics
- Finish-to-end traceability throughout multi-hop agentic workflows
- Identification 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 charge, 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 selections 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 elemental safety and entry management challenges organizations face when deploying agentic AI techniques at scale. The three patterns demonstrated—fine-grained entry management for instrument invocation, dynamic instrument filtering, and identification 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 instrument implementations or MCP server architectures. As organizations scale to a whole lot of brokers and 1000’s of instruments, gateway interceptors present the flexibleness and management wanted to keep up safety, compliance, and operational visibility throughout advanced 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 methods to apply gateway interceptors to resolve frequent enterprise challenges, confer with the next code samples:
For full documentation on gateway interceptor configuration and deployment, confer with 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 remodel and modernize their purposes on AWS. He’s additionally a part of the AI/ML Technical discipline neighborhood, serving to prospects 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 techniques, he focuses on serving to prospects 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 prospects to design and implement superior cloud architectures and helps them improve their merchandise through the use of AWS providers. He’s obsessed with serving to prospects construct scalable, safe, and modern techniques, with a powerful 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 prospects to design, optimize, and deploy fashionable AI/ML options. He’s obsessed with steady studying and staying on the frontier of latest capabilities within the discipline. In his free time, he enjoys gaming, digital artwork, and cooking.
Ozan Deniz works as a Software program Improvement Engineer in AWS. He and his group concentrate on enhancing the vendor capabilities by generative AI. When not at work, he enjoys exploring the outside.
Kevin Tsao is a Software program Improvement Engineer throughout the AgentCore Gateway group. He has been at Amazon for six years and has been working within the conversational AI and agentic AI area for the reason that starting of his tenure, contributing to providers similar to Bedrock Brokers and Amazon Lex.
