AWS described a pattern that combines verified identity, gateway checks and knowledge-base access controls to scope agent searches per user.
AWS published a technical design on November 12, 2026, for limiting what an AI agent can retrieve from a shared Amazon Bedrock Managed Knowledge Base on behalf of each user. The pattern targets internal assistants and multi-tenant applications where people share an agent but must not see one another’s restricted documents.
The central safeguard is to keep the user identity out of the model’s control. In the example, a user signs in with Amazon Cognito, and a validated access token carries an email claim. An AWS Lambda request interceptor at Amazon Bedrock AgentCore Gateway reads that verified identity and replaces the `userContext` supplied with an MCP tool call. This prevents the model or client from selecting a different user as the search identity.
The design adds separate checks at the gateway and data layers. A gateway authorizer validates the token; Policy in AgentCore checks that the search identity matches the token’s email claim. The Managed Knowledge Base uses ACL awareness to return only documents the identified user may view. A resource-based policy can also restrict searches to the gateway’s execution role, blocking other principals from calling the knowledge base directly.
AWS’s sample uses one knowledge base containing department-specific plans and a shared notice, with two users querying through the same agent. The post emphasizes that ACL awareness filters results but does not authenticate end users: the calling application must pass a verified `userContext`. For ACL-enabled Amazon S3 data sources, document permission changes take effect after the next sync, and documents without an ACL entry are not ingested.
The architecture is presented as a layered implementation pattern, not an automatic guarantee for every deployment. AWS provides a sample deployable through a single Cloud Development Kit stack. The post also identifies prerequisites, including a compatible AWS Region, Node.js 22 or later, and an Amazon Cognito Essentials or Plus plan when adapting the token-customization approach to an existing user pool.
