← Back
AWS ML Blog

Fine-grained access control for Amazon Bedrock Managed Knowledge Base tools

•24 min read•
#bedrock#agents#llm
Level:Advanced
For:AI Engineers
✦TL;DR

This article presents a pattern for enforcing fine‑grained access control in Amazon Bedrock agents by injecting verified user attributes into Model Context Protocol (MCP) tool calls via the AgentCore Gateway, then leveraging Managed Knowledge Base’s ACL‑aware search that filters results based on the userContext userId. The design ensures the LLM never decides the search identity, preventing cross‑department or cross‑tenant data leakage. Engineers can adopt this approach to build multi‑tenant, agent‑driven assistants that respect per‑user document permissions without modifying the LLM itself.

⚡ Key Takeaways

  • Managed Knowledge Base supports ACL awareness: a userContext object containing userId (email) restricts search results to documents the user may view.
  • AgentCore Gateway acts as the tool layer that injects verified identity attributes into MCP tool arguments, removing the LLM from deciding the search identity.
  • The solution adds defense‑in‑depth by validating user attributes both at the gateway (tool) layer and at the Managed Knowledge Base (resource) layer.
  • Sample implementation stores three documents (department A plan, department B plan, shared notice) in a single knowledge base to demonstrate scoped search.
  • The approach works for both internal multi‑department use cases and multi‑tenant SaaS scenarios where multiple customers share one assistant.
💡 Why It Matters

By separating identity verification from LLM‑driven tool selection, engineers can safely expose powerful agentic search capabilities on shared knowledge bases while guaranteeing that users only see data they’re authorized to access, reducing compliance risk in enterprise AI deployments.

✅ Practical Steps

  1. In your AgentCore Gateway implementation, replace the LLM‑generated userContext argument with the authenticated user’s email obtained from your identity provider before forwarding the tool call.
  2. Configure Managed Knowledge Base search requests to include the userContext object with the verified userId so that ACL‑aware filtering is applied automatically.
  3. Deploy the agent using Amazon Bedrock AgentCore, ensuring the gateway layer enforces the identity injection for every MCP tool invocation.

Want the full story? Read the original article.

Read on AWS ML Blog ↗

More like this

Introducing Gemini 4 Neon

Google DeepMind•#llm

DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency

Hugging Face Blog•#llm

Mathematical proof, powered by AI. And no hallucinations!

Amazon Science•#agents

AI’s GPU focus meets a CPU reality check at Dell and AMD

SiliconANGLE AI•#agents

EXPLORE AI NEWS

Daily hand-picked stories on LLMs, RAG, agents and production AI — curated for engineers who ship.

BROWSE NEWS

GET THE WEEKLY DIGEST

Join engineers getting the Monday signal-over-noise AI breakdown. No spam, unsubscribe anytime.

LEARN AI ENGINEERING

Curated courses, research papers, repos and tutorials built for engineers leveling up in AI.

START LEARNING