Secure AI agents with Amazon Bedrock AgentCore Identity on Amazon ECS
Machine Learning Blog
This article explains how to secure AI agents running on Amazon ECS using Amazon Bedrock AgentCore Identity with OAuth 2.0 and session binding.
- Implements Authorization Code Grant (3-legged OAuth) for secure user-delegated access
- Uses session binding to prevent CSRF and browser-swapping attacks
- Separates agentic workload from session binding service for independent scaling
- Integrates AWS ALB OIDC authentication with Microsoft Entra ID as identity provider
- Stores scoped OAuth tokens in AgentCore Identity Token Vault
- Demonstrates GitHub API integration with least-privilege scoped permissions
- Provides complete working implementation with code examples on GitHub
The solution secures AI agents across compute platforms (ECS, EKS, Lambda, on-premises) by combining inbound OIDC authentication, outbound OAuth 2.0 authorization, and cryptographic session binding to prevent unauthorized access.
The AWS News Feed is currently looking for gold sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.
Related articles
2025
2026
2026
2025
The AWS News Feed is currently looking for silver sponsors. If you want to support the AWS community and reach a large audience of AWS professionals, consider sponsoring the AWS News Feed.