As enterprises quickly undertake AI brokers to automate workflows and improve productiveness, they face a important scaling problem: managing safe entry to 1000’s of instruments throughout their group. Trendy AI deployments not contain a handful of brokers calling a number of APIs—as a substitute, enterprises are constructing unified AI platforms the place a whole bunch of brokers, shopper AI functions, 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 drawback: How do you make certain every calling principal—whether or not it’s an AI agent, person, or utility—solely accesses the instruments they’re approved to make use of? How do you dynamically filter software availability primarily based on person id, agent context, the channel via which entry is requested, and consistently evolving permissions? How do you defend delicate knowledge because it flows via 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 cases for each tenant or use case?
To handle these challenges, we’re launching a brand new function: gateway interceptors for Amazon Bedrock AgentCore Gateway. This highly effective new functionality offers fine-grained safety, dynamic entry management, and versatile schema administration.
Positive-grained entry management for software entry
Enterprise clients are deploying 1000’s of MCP instruments served via a unified AgentCore Gateway. These clients use this single MCP gateway to entry instruments from completely different groups, organizations, shopper AI functions, and AI brokers, every with their corresponding entry permissions assigned to the calling principal. The problem is securing MCP software 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 id, person id, and execution context, the place permissions would possibly change dynamically primarily based on person context, the channel via which the person 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 offers an instance of person primarily based 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
Clients 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 important knowledge safety capabilities akin to redacting or eradicating delicate knowledge like personally identifiable info (PII) or delicate private info (SPI) that customers would possibly ship as a part of prompts to brokers. This prevents delicate knowledge leakage to downstream APIs when such info isn’t wanted for the API name.
Moreover, clients require schema translation capabilities to deal with API contract modifications 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 area 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 advanced multi-tenancy necessities. Clients should deploy their MCP servers for all their customers whereas sustaining correct tenant isolation, requiring each tenant ID and person ID to be handed and validated. Multi-tenant MCP server architectures require completely different clients and workspaces to stay fully remoted, with software 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 software filtering
Clients want real-time, context-aware software filtering that adapts to altering permissions and person 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 important 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 essentially completely different from conventional microservices in that they’re autonomous and non-deterministic of their habits. Not like 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 sources primarily based on person execution context. Nevertheless, sending the unique authorization tokens to downstream providers creates vital safety vulnerabilities, akin to stolen credentials, privilege escalation, and the confused deputy drawback, 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
Clients face a basic safety determination in how id context propagates via 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 person’s JWT token is handed unchanged via every hop within the name chain. Though easier to implement, this method creates vital safety dangers. We don’t suggest this method as a result of following dangers:
- Downstream providers obtain tokens with broader privileges than needed
- 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 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 offers 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 may’t be reused elsewhere
- Higher auditability – A transparent chain of custody reveals which service acted on behalf of the person 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 acceptable headers whereas sustaining the person’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 (prime), when Consumer A connects to the agent, the agent passes Consumer A’s full id token with full scopes ("order: learn, promotions:write") unchanged to each the Order software and Promotions software, which means every software receives extra permissions than it wants. In distinction, the act-on-behalf method (backside) reveals 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" area, which establishes a transparent chain of accountability displaying the agent is performing on behalf of Consumer A. This demonstrates how delegation implements the precept of least privilege by limiting every downstream service to solely the precise 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 offers seamless integration with important third-party enterprise instruments and providers (akin to Jira, Asana, and Zendesk). This unified entry level permits safe integration throughout your enterprise programs. 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 via customized Lambda features at two important 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 person 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 circulation via gateway interceptors.

Let’s look at the precise payload buildings 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 area:
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 area:
Understanding this request-response construction is crucial for implementing the customized interceptor logic we discover later on this submit. Gateway interceptors present important capabilities for securing and managing agentic AI workflows:
- Header administration – Go authentication tokens, correlation IDs, and metadata via 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
- Positive-grained entry management – Safe MCP software 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 person, agent, and tenant identities in a multi-tenant surroundings
- Observability – Add logging, metrics, and tracing info to watch agentic workflows
Gateway interceptors work with AgentCore Gateway goal varieties: 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 programs. This submit showcases three approaches: implementing fine-grained entry management for invoking instruments, dynamic instruments filtering primarily based on person permissions, and id propagation throughout distributed programs.
Implementing fine-grained entry management for invoking instruments
AgentCore Gateway exposes a number of backend instruments via a unified MCP endpoint. Customers with completely different roles require completely different software permissions. You possibly can implement fine-grained entry management utilizing JWT scopes mixed with gateway interceptors to verify customers can solely invoke approved instruments and uncover instruments that belong to their function or workspace. Positive-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 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 easy to audit.
The next diagram illustrates this workflow.

The request interceptor enforces permissions at execution time via the next steps:
- Extract and decode the JWT to retrieve the scope declare.
- Establish which software is being invoked (utilizing
instruments/name). - Block the request if the person 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 software 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 possibly can lengthen the mannequin with further claims (for instance, tenantId and workspaceId) for multi-tenant architectures.
For operational safety, maintain interceptors deterministic, keep away from advanced branching logic, and rely completely on token claims relatively than giant language mannequin (LLM) directions. By implementing authorization on the gateway boundary—earlier than the LLM sees or executes any software—you obtain sturdy isolation throughout roles, tenants, and domains with out modifying software implementations or MCP targets.
Dynamic instruments filtering
Brokers uncover out there instruments via two major strategies: semantic search capabilities that permit pure language queries (like “discover instruments associated to order administration”) and customary (instruments/record) operations that present an entire 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 out there instruments, whatever the requesting agent’s or person’s authorization degree. This unrestricted software discovery creates potential safety vulnerabilities by exposing delicate capabilities to unauthorized customers or brokers.
When a goal returns a listing 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 approved to entry. The workflow consists of the next steps:
- The goal validates the incoming JWT token and returns both the whole software record or a filtered set primarily based 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 person’s permissions.
- For every software within the record, the interceptor evaluates the person’s authorization primarily based on the JWT scopes.
- Instruments that the person isn’t approved to entry are faraway from the record.
- The response interceptor returns a reworked response containing solely the approved 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 record retrieval, and permission-based filtering earlier than returning the reworked response with approved instruments:
The filter_tools_by_scope perform implements an authorization test for every software in opposition to the person’s allowed scopes:
The whole implementation might be discovered within the GitHub repo.
Customized headers propagation
As AI brokers work together with a number of downstream providers, sustaining person id throughout service boundaries turns into important for safety, compliance, and audit trails. When brokers invoke instruments via AgentCore Gateway, the unique person’s id should circulation 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, preserve 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 info 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 circulation and manages interceptor execution.
- The goal invocation receives enriched requests with correctly formatted id info.
The gateway request interceptor helps organizations acquire end-to-end visibility into person actions, implement constant authorization insurance policies throughout service boundaries, and preserve 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. Nevertheless, there could be exceptions the place the agent must name the MCP server with an entry token for downstream APIs.) Alternatively, you possibly can 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 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 stability discoverability with safety. Take into account a state of affairs the place you need to permit AI brokers and functions to find and search out there MCP instruments with out requiring authorization, enabling seamless software exploration and semantic search throughout your software catalog. Nevertheless, on the subject of really invoking these instruments, you want strict OAuth-based authorization to verify solely approved 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 primarily based on the calling principal’s id and context.
AgentCore Gateway now helps this flexibility via 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 methodology degree (ListTools vs. CallTools) or implement per-tool authorization insurance policies, you should use gateway interceptors to look at the inbound JWT, validate it in opposition to the necessities in accordance with RFC 6749 utilizing your authorization server’s discovery URL, and programmatically permit or deny entry to particular strategies or software calls. This method provides you fine-grained management: open discovery for ListTools and SearchTools requests whereas implementing strict OAuth validation for CallTools requests, and even implementing customized authorization logic that varies by software, person function, 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 basic no-auth for all inbound calls. With this configuration, customers can uncover out there instruments with out authorization. Nevertheless, when the person subsequently makes a CallTool request to invoke a selected software, authorization is required. AgentCore Gateway invokes the customized request interceptor Lambda perform, which validates the JWT token from the authorization header and checks the person’s scopes and permissions in opposition to the precise software being invoked. If approved, the interceptor transforms and enriches the request with the required 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, implementing 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 offered by AgentCore Observability is important for monitoring, debugging, and auditing AI agent workflows that work together with a number of instruments and providers via AgentCore Gateway. Gateway interceptors implement authorization, remodel requests, and filter knowledge earlier than downstream providers execute, making the observability layer a important safety boundary. This provides the next key advantages:
- Safety determination visibility – Interceptors generate authoritative logs for authorization outcomes, together with permit/deny choices and the evaluated JWT scopes. This offers a transparent audit path for reviewing rejected requests, validating coverage habits, and analyzing how authorization guidelines are enforced throughout software invocations.
- Request and response traceability – Interceptors seize how MCP requests and responses are modified, akin to 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 habits, together with standing codes, latency, and error responses. This creates constant visibility throughout targets, serving to groups troubleshoot failures, establish reliability points, and perceive end-to-end execution traits.
These logs additionally seize id and context attributes, serving to groups validate authorization habits and isolate points in environments the place a number of person teams or tenants share the identical gateway. Gateway interceptors robotically combine with AgentCore Observability, offering the next options:
- Actual-time monitoring of authorization choices
- Efficiency bottleneck identification via period and invocation metrics
- Finish-to-end traceability throughout multi-hop agentic workflows
- Identification and context attributes for validating authorization habits in multi-tenant environments
The next screenshot reveals pattern metrics from Amazon CloudWatch log teams for a gateway interceptor.

The metrics reveal 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 reveals pattern logs from CloudWatch for a gateway interceptor.

AgentCore Observability integration helps you monitor authorization choices in actual time, establish efficiency bottlenecks, and preserve 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 programs 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, preserve 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 1000’s of instruments, gateway interceptors present the flexibleness and management wanted to take care of safety, compliance, and operational visibility throughout advanced agentic AI deployments whereas aligning with enterprise integration patterns and safety finest practices. AgentCore Gateway with gateway interceptors offers a versatile basis for implementing enterprise-grade safety controls throughout agentic AI architectures. To study extra about the way to apply gateway interceptors to unravel widespread enterprise challenges, consult with the next code samples:
For full documentation on gateway interceptor configuration and deployment, consult with Positive-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 resolution supply. He helps ISVs remodel and modernize their functions on AWS. He’s additionally a part of the AI/ML Technical area 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 programs, he makes a speciality of 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 obsessed with serving to clients construct scalable, safe, and modern programs, 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 obsessed with steady studying and staying on the frontier of recent capabilities within the area. 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 concentrate on enhancing the vendor capabilities by generative AI. When not at work, he enjoys exploring the outside.
Kevin Tsao is a Software program Growth Engineer inside the AgentCore Gateway crew. He has been at Amazon for six years and has been working within the conversational AI and agentic AI area because the starting of his tenure, contributing to providers akin to Bedrock Brokers and Amazon Lex.

