AgentCore Gateway原生支持Entra ID令牌交换
AWS的一篇技术教程介绍了Amazon Bedrock AgentCore Gateway如何原生使用Microsoft Entra ID执行on-behalf-of令牌交换。该配置允许AI智能体调用ServiceNow REST API并保留调用用户身份,无需自定义AWS Lambda拦截器;网关会在每次请求时执行交换。AWS称,这一模式也可应用于其他受OAuth保护的REST API,并可与Amazon Bedrock Guardrails配合使用。原生on-behalf-of支持要求AgentCore Gateway使用MCP版本2025-11-25,并且无法为使用更早MCP版本创建的网关启用。
教程称,在整个请求链中保留身份有助于维持用户级访问控制和审计追踪,而原生令牌交换可免去需要单独维护的自定义代码。供应的来源未对这一能力进行独立验证。
AI agents that interact with enterprise APIs on behalf of users need to maintain user identity throughout the request chain. Without identity propagation, API calls arrive at downstream services as the application itself rather than the user who initiated the action. This breaks audit trails, bypasses user-level access controls, and violates the principle of least privilege.
Amazon Bedrock AgentCore is a platform to build, connect, and optimize agents at scale, with any framework or model. This post shows how to configure AgentCore Gateway, a capability of Amazon Bedrock AgentCore, for an on-behalf-of (OBO) token exchange with Microsoft Entra ID. An AI agent can then call the ServiceNow REST API while preserving the calling user’s identity. You configure the token exchange on the gateway target, and AgentCore Gateway performs the exchange on each request. The pattern can be applied to other REST APIs protected by OAuth.
In production, you can additionally pair identity propagation with Amazon Bedrock Guardrails to filter harmful content and validate the agent’s inputs and outputs.
Solution overview
The architecture involves three key components connected through AgentCore Gateway:
#Amazon Bedrock AgentCore Gateway#Microsoft Entra ID#ServiceNow REST API#Amazon Bedrock Guardrails#AWS Lambda#Model Context Protocol