> ## Content Index
> Fetch the complete content index at: https://www.stirup.si/llms.txt
> Use this file to discover other available public pages before exploring further.

# ServiceNow Integration with Bedrock AgentCore Gateway for Token Exchange
- URL: https://www.stirup.si/servicenow-integration-with-bedrock-agentcore-gateway-for-token-exchan-9cc8405f/
- Published: 2026-11-03T17:25:59.000Z
- Updated: 2026-11-03T17:25:59.000Z
- Description: The AgentCore Gateway handles on-behalf-of token exchanges with ServiceNow, preserving user identity through Microsoft Entra ID and scoped JWT tokens.
- Author: Satish Das
- Tags: Cloud, News, Stirup Research

## On-behalf-of Token Exchange Configuration

ServiceNow on-behalf-of token exchange with Bedrock AgentCore Gateway involves configuring the gateway to handle token exchanges on behalf of users while preserving their identity. This process is essential for AI agents that interact with enterprise APIs, ensuring that user context is maintained throughout the request chain. According to the configuration steps outlined, the AgentCore Gateway performs the token exchange on each request, using the on-behalf-of (OBO) flow with Microsoft Entra ID. The agent authenticates to the gateway with a JWT token scoped to its own application registration, and the gateway exchanges that token for a new one scoped to the ServiceNow API connector, preserving the original user’s identity. This setup requires the agent to present a JWT with an audience claim matching its client ID, while ServiceNow expects a token with an audience claim matching its own API connector client ID. The gateway sends the inbound token to the Entra token endpoint along with the agent application’s client credentials, the target scope, and a parameter `requested_token_use: on_behalf_of`.

## Implementation Steps for AgentCore Gateway

Implementation Steps for AgentCore Gateway involve configuring the gateway to handle token exchanges on behalf of users. Step 2 requires creating a new AgentCore Gateway with MCP version 2025-11-25 (Build > Gateways > Create gateway). Step 3 involves adding a target to the gateway pointing to your ServiceNow REST endpoint. Step 4 includes saving and testing the target configuration. Once configured, the AgentCore Gateway automatically exchanges inbound tokens for valid ServiceNow tokens, preserving user identity without requiring custom code. Entra issues a new token with the audience set to the ServiceNow API connector client ID, retaining the original user’s claims. The gateway then forwards the request to ServiceNow with the exchanged token. Native OBO support in AgentCore Gateway eliminates the need for custom AWS Lambda interceptors, as the token exchange is configured directly on the gateway target and handled transparently on every request. For further details, refer to the Amazon Bedrock AgentCore documentation.

## ServiceNow Data Source Integration with Amazon Bedrock

ServiceNow data source integration with Amazon Bedrock involves setting up authentication and storing credentials in AWS Secrets Manager. Once this is done, users can create a ServiceNow data source in their knowledge base through the Amazon Bedrock console or via API. For the console method, users navigate to the Amazon Bedrock console and enter their ServiceNow instance URL in the Host URL field. Using the API, a CreateDataSource request is sent with an Agents for Amazon Bedrock build-time endpoint. Within the connectorParameters, both type and connectorType must be set to SERVICENOW, and the version must be set to 1\. ServiceNow supports a single authentication type, OAUTH2, which also supports ACL crawling. Omitting the field for ACL crawling results in an ACL-enabled data source.

## AgentCore Identity and Security Features

ServiceNow’s integration with Amazon Bedrock AgentCore Gateway introduces robust identity and security features designed to manage AI agent access securely. AgentCore Identity leverages token-based systems that encapsulate an agent’s identity, permissions, issuer details, and validity timeframe, reducing risks associated with unauthorized access \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\]. This approach ensures that agents operate on behalf of users without exposing sensitive credentials, aligning with compliance requirements \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\].Key features include fine-grained access control, which limits agents to only the tools and data they are authorized to use \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\]. Secure communication between agents across accounts is supported through OAuth 2.0 or AWS IAM (SigV4-signed requests) \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\]. A secure token vault stores OAuth 2.0 tokens, client credentials, and API keys with encryption both at rest and in transit \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\]. The AgentCore SDK further simplifies credential handling with annotations like @requires\_access\_token, automating token retrieval and injection \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\].These features collectively reduce operational burden and strengthen an organization’s security posture, supporting trustworthy AI operations \[[techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)\].

## Best Practices for AI Agent Identity Management

Best Practices for AI Agent Identity Management involve adopting a secure and structured approach to ensure that AI agents operate within defined boundaries. ServiceNow, in collaboration with Bedrock AgentCore Gateway, emphasizes the importance of Zero Trust Principles, requiring continuous verification of AI agent identities regardless of location or network environment. Applying Least Privilege Principles is also critical, as it ensures agents are granted only the permissions necessary for their specific tasks, reducing the risk of unauthorized access or privilege escalation. Secure token management is another key component, with scoped, time-bound access tokens issued to agents to limit their access to specific customer data and actions. These tokens are further protected through encrypted credential vaults, ensuring secure backend interactions with core banking systems. Additionally, AgentCore enforces policies to validate agent interactions, allowing for customized rules that check user identity, permissions, or context, and restrict sensitive data exposure through masking and scope limitations.

## Sources and reporting notes

- [AWS Machine Learning](https://aws.amazon.com/blogs/machine-learning/servicenow-on-behalf-of-token-exchange-with-bedrock-agentcore-gateway/?ref=stirup.si)
- [docs.aws.amazon.com](https://docs.aws.amazon.com/bedrock/latest/userguide/kb-managed-ds-servicenow-connect.html?ref=stirup.si)
- [cohash.com](https://cohash.com/tools/aws-bedrock?ref=stirup.si)
- [techmahindra.com](https://www.techmahindra.com/insights/views/ai-agent-identity/?ref=stirup.si)

Based on published source material. No independent hands-on testing is claimed.