Secure AI agents with Amazon Bedrock AgentCore Identity on Amazon ECS
AWS•How-to••by Julian Grüber, Satveer Khurpa and Tobias Nickl•AWS Artificial Intelligence Blog
AI agents in production require secure access to external services. Amazon Bedrock AgentCore Identity, available as a standalone service, secures how your AI agents access external services whether they run on compute platforms like Amazon ECS, Amazon EKS, AWS Lambda, or on-premises. This post implements Authorization Code Grant (3-legged OAuth) on Amazon ECS with secure session binding and scoped tokens.
Shows how to run AI agents on Amazon ECS with OAuth 2.0 Authorization Code Grant, a customer-hosted session binding endpoint, and per-user scoped tokens from AgentCore Identity.
Who it is for
Teams running self-hosted AI agents on ECS that need user-delegated access to third-party services like GitHub.
Key points
Uses Microsoft Entra ID as the OIDC identity provider; other OIDC providers are said to work.
ALB OIDC flow is incompatible with GetWorkloadAccessTokenForJWT, so the post uses GetWorkloadAccessTokenForUserId instead.
Session binding protects against CSRF and browser-swapping attacks by matching user IDs across both services.
AgentCore Identity refreshes tokens automatically when a refresh token is issued; otherwise the user must re-authorize.
AI:Trovata, a treasury platform, describes autonomous treasury agents it built on Amazon Bedrock and AgentCore, with RBAC-controlled access to bank data.
AI:A serverless MCP server on ECS Fargate lets AI agents query an enterprise data lake, and new datasets are added by a metadata JSON file instead of code.
AI:A reference architecture uses X.509 PKI from Keyfactor EJBCA with AWS services to give AI agents cryptographic identity, signed request envelopes, delegation, scoped tokens and OCSP revocation.