Building a Slack Company Brain with AWS Context
By Orhan Burak Bozan on Dec 1, 2026, 7:08:54 PM
Every company wants an assistant that knows everything. Nobody wants an assistant that tells everyone everything.
We are building one for kloia: a Slack bot that answers questions from company knowledge and from each person's own tools, Drive, Calendar, Jira and the rest. In September we designed it the way most teams do, with a vector index and access control lists copied onto every chunk. In October we chose a design without an index, because it fit our content better. Today, at re:Invent, AWS made AWS Context generally available: a managed way to give agents governed company context, including the index work we chose not to build ourselves.
The two are not alternatives. They solve different parts of the same problem, and they are stronger together. Here is how.
TL;DR
- Our company brain reads a curated map of where knowledge lives, then asks each source directly, under the asker's own permissions.
- That design is simple to secure, always current, and a good fit for content that every employee can see.
- AWS Context is a managed context graph. For documents it copies each source ACL onto the graph and filters on it at query time, and it takes the user's identity from AWS trusted identity propagation, not from the request.
- It takes on the index work: ingestion, permission sync and semantic search across sources. The Slack-specific rule, who else is reading the answer, stays in the application, where it belongs.
- Used together, each does what it is best at: the assistant keeps the rules about who is in the room, and AWS Context provides governed business context and search across sources.
The problem is the audience, not the user
Most writing about access control in RAG, including our own post from October, is about one question: may this user see this document? Carry the permissions from the source into the index, filter at retrieval time, fail closed.
Slack adds a second question. A channel is a broadcast surface. If someone asks the bot a question in a channel and the bot answers there, everyone in the channel reads an answer that was filtered for the person who asked. The filter can be perfectly correct and the answer is still a leak. Hiding the citation does not help either: the answer is the payload.
Any design for an internal assistant in Slack has to answer both questions. They have different answers.
What we built: a map and the sources
When we sized the content we wanted to embed (policies and procedures, our internal wiki, and our knowledge base repository), it came to about 2,670 chunks, and all of it was visible to every employee. Keeping an index of it would have meant an indexer, ACLs on every chunk, a nightly job to reconcile permission changes, and an embedding model chosen and paid for. That is a lot of machinery to guard content that everyone could already open.
So the current design works in two layers.
The map. A git repository of short entries: "the onboarding documents are in this drive", "the leave policy is this document, and here is its summary", plus the few facts that live nowhere else. The agent reads it with three tools, list, grep and read, and cites answers by file and line. There is no copy of it in a database.
The terrain. The sources themselves. The agent follows a reference from the map, or uses the source's own search: Drive full-text search, the wiki's search API, Slack search. Personal sources are queried with the asker's own OAuth token, so the source enforces its own permissions and we keep no copy of anyone's permissions.
The audience question is handled by tool class, not by content:
|
Asked in |
Tools the agent gets |
Answer goes to |
|---|---|---|
|
A DM with the bot |
All tools, under the asker's own tokens |
The DM |
|
A channel with employees only |
Only org-wide tools, whose credential sees what every employee may see |
The channel |
|
A channel with a guest or an external member |
None |
A short note in the channel, the answer in DM |
The rule is structural. The run that produces a channel answer has no personal tool registered, so personal data cannot reach the channel, whatever a document or a prompt says.
Every design has trade-offs, and we chose these on purpose. The agent relies on each source's own search and on a well-kept map, and a question that spans several sources takes several tool calls. For our content today that is the right balance: answers are always current, and permissions are always the source's own.
We track it with an answer-quality evaluation: real Turkish and English questions, scored on how often the agent finds the right source. When our content or our questions outgrow source search, the next step is an index of org-wide content, and that is where AWS Context comes in.
What AWS Context is
AWS Context builds a context graph over a company's data and documents: what business terms mean, how numbers are calculated, which rules apply, and how documents and records relate. Agents search it, retrieve from it and query it through MCP tools. It is generally available in US East (N. Virginia), US West (Oregon) and Europe (Ireland).
It connects to AWS data services (the Glue Data Catalog, S3, Redshift, Aurora, RDS, DynamoDB) and, through Amazon Bedrock Managed Knowledge Bases, to documents and applications. The managed knowledge base connectors include S3, SharePoint, Confluence, Google Drive, OneDrive and a web crawler, with a direct ingestion API for anything else.
The part we read most carefully was access control. According to the documentation:
- When a knowledge base sends a document, it sends the document's ACL with it. AWS Context records that ACL on the document node and on every entity extracted from the document. An entity is never more visible than the document it came from.
- Where a source has levels (a site, a library, a folder), the caller must be allowed at every level, and a deny wins over an allow.
- An edge between two nodes is visible only when both nodes are visible.
- The end user comes from the trusted identity on the call, through IAM Identity Center or an IAM identity provider. It never comes from a user named in the request. A call with no trusted identity sees public nodes only.
- For structured sources, AWS Context records no ACL and leaves enforcement to the source, for example AWS Lake Formation grants, at query time.
- For Google Drive, the managed knowledge base filters on the ACLs from the last crawl and then checks the user's current access in Drive in real time before returning a document.
That is the layered design from our October post, run as a service: permissions carried from the source, one filtered retrieval path, fail closed. It also gets one detail right that many homemade designs miss: identity comes from the credential, not from an argument the agent passes. An agent's context contains document text, which is untrusted input, and a tool that accepts a user id as a parameter turns prompt injection into impersonation.
This is where AWS Context goes well beyond a document index. Teams add data dictionaries, query examples and retrieval instructions; curation policies and evaluation tests keep the context accurate; and expert corrections improve the graph for every agent that uses it, with learning from agent feedback in preview. Structured data is read under the source's own permissions, such as Lake Formation grants, so an agent can answer a question that needs both a policy document and live numbers. AWS quotes early customer results. BBVA reports that agent accuracy on a loan-risk question rose from 54% on raw data to 89% with AWS Context, and to 97% after specialists' corrections were applied.
Side by side
|
Our current design |
AWS Context |
|
|---|---|---|
|
Where knowledge lives |
In the sources; we store references, not content |
In a managed graph built from the sources |
|
Who enforces document permissions |
The source, at query time, under the asker's token |
AWS Context, from ACLs copied at ingestion; Drive also checked live |
|
Identity |
The asker's Slack identity, mapped to their Google account |
AWS trusted identity propagation |
|
Search quality |
Each source's own search, guided by the map |
Semantic search and graph relationships across sources |
|
Channel audience |
Handled by tool class |
Left to the application, by design |
|
Turkish and English |
Test with your own Turkish and English questions |
Test with your own Turkish and English questions |
|
Cost model |
A small database and model calls |
Agent units billed per second; graph creation and storage free for AWS database services |
|
Best fit |
A small, company-visible corpus and each person's own tools |
Large or cross-source content, structured data, shared business definitions |
How the two fit together
It adds cross-source search. Semantic search and one ranked result across sources is what an index brings. When we add one, AWS Context provides it as a managed service, with ingestion and permission sync handled by AWS instead of by code we maintain.
Start with org-wide content. Our design keeps references, not copies. With AWS Context, the graph lives in our own AWS account and every node carries the source's ACLs. Starting with org-wide content, what every employee can already open, keeps the first step simple and matches how we already treat channels.
Plan the Drive connection. To carry Google Drive ACLs, the connector uses a Google service account with domain-wide delegation. Scope the sync to shared drives, so personal drives stay out of the graph.
Connect identity once. AWS Context takes the user from IAM Identity Center or an IAM identity provider. For a Slack assistant, that means mapping each Slack user to their corporate identity, which our design already does for Google. It is the security boundary, so it is worth doing carefully.
The channel question stays ours. AWS Context answers "what may this user see". It does not answer "what may everyone in this channel see", and it should not: that is an application concern. Our tool-class rule keeps working on top of it. One detail to plan for: a call with no identity sees only documents with no ACL at the source, while a document shared with the whole company does carry an ACL. A channel answer would therefore need a service identity that stands for "every employee", the same idea as our org-wide tools.
Include your languages in the evaluation. Our content is mixed Turkish and English, and the document that answers a Turkish question is often in English. Whatever retrieval layer you use, put questions like that in your evaluation set.
What to check in your own environment
If you evaluate AWS Context for an internal assistant, these are the checks we would start with, in a separate AWS account with synthetic documents and test users:
- User A cannot retrieve a document that only user B may read, through search, through an extracted entity, or through a relationship to a visible node.
- A Turkish question finds the English document that answers it, in a corpus that also holds unrelated Turkish documents.
- A call with no end-user identity, and a call with an "every employee" service identity, return what we expect from a document shared with the whole company.
- Removing a user's access in the source removes the document from their results, and how quickly that applies.
These are the same checks we apply to any retrieval layer, managed or our own.
What we would tell another team building this
- Size the content before you design the index. Ours was small and fully company-visible, and that changed the design.
- Ask the audience question as well as the user question. In Slack, the person who asked is not the only reader.
- Take identity from a signed credential, never from a parameter the model fills in.
- Let the managed service enforce source ACLs, and keep your product's rules about who is in the room in your own code.
Building an internal AI assistant?
The hard part is not the model. It is deciding who may see what, in every place an answer can appear, and enforcing it in code rather than in a prompt. As an AWS Partner, kloia helps teams put AWS Context and their assistant's own rules together, so the first answer that reaches a channel is right for everyone reading it. Let's look at your architecture together.
References
- AWS Context is now generally available
- AWS Context product page and pricing
- AWS Context User Guide: Unstructured sources, ACLs attached at ingestion
- AWS Context User Guide: User-level access with trusted identity propagation
- AWS Context User Guide: Google Drive
- Amazon Bedrock User Guide: Google Drive document-level access controls
- Build enterprise search for agents with Amazon Bedrock Managed Knowledge Base
- kloia: Access Control for Enterprise RAG, The Silent Security Gap
FAQ
No. It is a managed context graph with search, retrieval and query tools for agents. For documents it works with Amazon Bedrock Managed Knowledge Bases, which handle parsing, chunking, embedding and search.
For documents from a managed knowledge base, it copies each document's ACL onto the graph and filters on it at query time. For structured sources, it leaves enforcement to the source, such as Lake Formation. In both cases the user comes from AWS trusted identity propagation.
The application. AWS Context returns what the requesting user may see. Which of that appears in a channel, where others read it too, is a product rule the assistant enforces.
Not always. If the content is small and every employee can see it, a curated map plus each source's own search can be enough. Measure answer quality on real questions before deciding.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi.
You May Also Like
These Related Stories
Access Control for Enterprise RAG: The Silent Security Gap

Deploy DeepSeek R1 Distill-Llama 8B on AWS: Setup Guide
No Comments Yet
Let us know what you think