Artificial Intelligence1 min read

ServiceNow on-behalf-of token exchange with Bedrock AgentCore Gateway

By · Published by Everything Blog

In short

The integration architecture positions the gateway as a Model Context Protocol server linking the AI agent directly to ServiceNow. When a user presents a JSON Web Token to invoke the agent, the gateway exchanges it via Entra ID for a token scoped to the ServiceNow connector. In addition to securing user-level access controls, production environments can incorporate Amazon Bedrock Guardrails to filter harmful content and evaluate inputs and outputs.

Key points

  • On-behalf-of token exchanges preserve the principle of least privilege and protect enterp…: On-behalf-of token exchanges preserve the principle of least privilege and protect enterprise audit logs.
  • Administrators must establish two distinct Entra ID app registrations, including one with…: Administrators must establish two distinct Entra ID app registrations, including one with a user impersonation scope.
  • Teams can implement Amazon Bedrock Guardrails alongside this identity architecture to saf…: Teams can implement Amazon Bedrock Guardrails alongside this identity architecture to safeguard and validate agent inputs.

Sources checked by our analysis pipeline: 1

Artificial Intelligence

ServiceNow on-behalf-of token exchange with Bedrock AgentCore Gateway

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

Artificial Intelligence