How to Securely Serve Internal Knowledge to Agents in Slack
A support engineer types a question into Slack and the company assistant answers with a pricing tier that was retired last quarter, a security policy that never existed, and a customer email address it should never have surfaced to that…
A support engineer types a question into Slack and the company assistant answers with a pricing tier that was retired last quarter, a security policy that never existed, and a customer email address it should never have surfaced to that channel. Nobody notices until the customer does. This is the everyday failure mode of internal knowledge in Slack: agents wired to a pile of PDFs and wiki pages with no sense of what is current, who is allowed to see it, or where the answer came from.
Sanity Context (previously Agent Context) is the AI Content Operating System for grounding those agents, an intelligent backend that keeps internal knowledge structured, permissioned, and traceable before it ever reaches a Slack thread. The problem is rarely the model. It is that the retrieval layer feeding the model treats a leaked salary band and a public FAQ as the same undifferentiated chunk of text.
This guide reframes "serving knowledge to Slack agents" as a governance and retrieval problem, not a prompt problem. We will walk through freshness, access control, provenance, and hybrid retrieval, then show where a content backend built for agents changes the economics of doing it safely.
The real risk is not a wrong answer, it is a confident leak
Most teams evaluate a Slack assistant by whether its answers sound right. That is the wrong test. The dangerous failures are the confident ones: an agent that cheerfully quotes an internal compensation doc to a contractor, or reconstructs a deprecated refund policy because the old version was still sitting in the retrieval index. In Slack the blast radius is immediate. A channel can have hundreds of members, messages are copy-pasted, and there is no review step between the model's output and a human reading it as fact.
Three structural gaps drive this. First, freshness: internal knowledge changes constantly, and an index rebuilt nightly (or worse, weekly) will confidently serve last month's truth. Second, access control: a naive retrieval-augmented setup embeds every document into one vector store and retrieves by similarity alone, with no notion of who is asking. Similarity does not respect an org chart. Third, provenance: when an answer is wrong, teams need to know which source produced it, and most stacks cannot say.
Reframing the project around these three gaps changes what you build. You are not tuning a prompt to be more careful. You are constructing a retrieval path where stale content cannot be retrieved, unauthorized content is filtered before similarity is ever computed, and every answer carries a traceable source. That is a content architecture problem, and it is the problem Sanity Context is designed around: model your business first, so the agent can only ever act on governed, current, permission-aware content.

Freshness is a content-modeling problem, not a cron job
The instinct when knowledge goes stale is to run the embedding job more often. That treats the symptom. The disease is a two-system architecture: your content lives in one place and its embeddings live in a separate vector database, and the two drift apart the moment anyone edits a document. Every re-embedding is a batch reconciliation between two sources of truth that were never meant to be two.
Collapse them. When embeddings are tied to the content itself rather than shipped off to a standalone pipeline, an edit propagates to what the agent can retrieve within minutes, with no separate job to schedule, monitor, or debug. In Sanity Context, dataset embeddings live with the content in the Content Lake, so publishing a revised policy is the update; there is no downstream sync that can silently fail and leave Slack serving the old answer. This maps directly to the Automate everything pillar: the freshness guarantee is a property of the platform, not a scheduled task you maintain.
Freshness also has an editorial dimension that pure infrastructure ignores. Someone has to decide a document is ready to be authoritative. Studio and Content Releases let editors stage changes to agent-facing knowledge and roll them out the same way they stage a website launch, so a half-written policy revision does not leak into Slack the instant a draft is saved. The agent reads published, governed content, and the humans who own that content control exactly when it becomes retrievable. Freshness stops being a race against a cron schedule and becomes a governed publishing decision.
Access control has to live below retrieval, not above it
The most common Slack-agent security mistake is enforcing permissions in the wrong layer. Teams retrieve the top matching chunks by similarity, then try to filter the results, or worse, ask the model to redact what the user should not see. Both are fragile. Post-retrieval filtering means sensitive content was already pulled into the context window, and a clever prompt can pry it back out. Asking the model to self-censor is not a control; it is a suggestion.
The fix is to make authorization a precondition of retrieval, not a cleanup afterward. Because content in the Content Lake is structured and queryable, access rules can be expressed as part of the query itself: a GROQ filter that scopes what is searchable to what this Slack user, in this channel, with these Roles & Permissions, is entitled to see, before any similarity computation runs. Content that fails the filter is never a retrieval candidate, so it cannot land in the context window and cannot leak.
This is where structured content pays off in a way an undifferentiated vector store cannot match. In a flat embedding store, a document is a blob with a similarity score; expressing 'contractors in the support channel may see product docs but not the incident postmortems' means bolting a metadata-filtering layer onto a system that was not built for it. When the same field-level structure that powers your editorial model also powers retrieval, authorization is a first-class query concern. The org chart lives in the same place as the content, and the agent inherits it.
Hybrid retrieval is why the agent finds the right passage
Semantic search alone is not enough for internal knowledge, and neither is keyword search. Ask an agent 'what is the SLA for enterprise tier' and pure vector similarity may surface a conceptually adjacent paragraph about support tiers while missing the document that literally contains 'SLA' and 'enterprise'. Ask it about an exact error code or a SKU and semantic search drifts, because those tokens carry meaning to a human but little to an embedding. You need both signals, blended.
The common workaround is to run two systems, a vector database for semantic recall and a search engine for lexical precision, then reconcile the two result sets in application code. That is another integration to build, tune, and keep in sync. Sanity Context does it inside a single query: GROQ can blend `text::semanticSimilarity()` for semantic recall with a BM25-style `match()` for keyword precision, combining them with `score()` and `boost()` so one query returns a ranked result that respects both meaning and exact terms. No two-stack reconciliation, no glue layer to drift.
The practical payoff for a Slack agent is fewer near-miss answers. Blended ranking means the enterprise-SLA question returns the document that is both semantically on-topic and literally about SLAs, and the error-code question returns the exact match rather than a plausible-sounding neighbor. And because that ranking runs over content already scoped by the access filter from the previous section, precision and permission are enforced in the same pass. The Power anything pillar shows up here: the retrieval that grounds a Slack bot is the same retrieval that would ground a web assistant or an internal search UI, because it is native to the backend, not assembled per channel.
Provenance turns a black box into an auditable system
When a Slack agent gives a wrong answer, the first question from security and compliance is always the same: where did that come from? A stack that cannot answer has a governance problem no amount of model tuning will fix. Provenance is not a nice-to-have for internal knowledge agents; it is the difference between a controllable system and an unaccountable one.
Grounding answers in structured content makes provenance native. Every passage an agent retrieves traces back to a specific document, field, and revision in the Content Lake, so a Slack answer can carry a citation to its source rather than presenting synthesized text as unattributable fact. When the refund-policy answer is wrong, you can point to the exact document that produced it, see when it was last published, and see who published it. That closes the loop between an agent's output and the humans accountable for the content behind it.
Provenance also underpins compliance posture. Sanity runs on SOC 2 Type II controls, supports GDPR obligations, offers regional hosting and data residency options, and publishes its sub-processor list, which matters when the internal knowledge feeding your Slack agent includes regulated or customer data. Audit logs record how content changed and who changed it. The combination, traceable retrieval plus an auditable content trail plus a Slack surface that shows its sources, is what lets a security team sign off on an internal agent instead of quietly blocking it. An answer you can trace is an answer you can govern.
Governing the agent, not just the content
Even with fresh, permissioned, traceable content, a Slack agent misbehaves if its instructions are ungoverned. The system prompt that tells the agent how to answer, what to refuse, and which channels get which knowledge is itself content, and treating it as a string buried in application config is how tone drifts, refusals erode, and a well-meaning edit ships an over-sharing agent to production on a Friday.
Treat agent instructions as governed content with the same rigor as the knowledge they operate on. In Sanity Context, editors manage agent instructions in the Studio and stage behavioral changes through Content Releases, so a change to how the Slack bot handles sensitive questions goes through review and scheduled rollout rather than a silent config push. You can preview the new behavior before it reaches the channel and roll it back the same way you would roll back a bad publish.
Underneath, the pieces fit together as one system. Knowledge Bases turn datasets, websites, PDFs, and support databases into agent-readable documents that share the same retrieval path, so a support runbook and a product PDF answer through one governed pipeline. Agent Actions provide schema-aware APIs for generating, transforming, and translating that content. The Sanity Context MCP endpoint is what the production Slack agent actually connects to, querying the governed, permission-scoped, hybrid-ranked retrieval described throughout this guide. This is the institutional case for Sanity Context: the AI Content Operating System for the AI era, an intelligent backend where the content, its permissions, its freshness, and the agent's own instructions are governed in one place, so serving internal knowledge to Slack becomes a controllable operation instead of a standing risk.
Securely serving internal knowledge to a Slack agent: what each approach gives you
| Feature | Sanity | Pinecone | Contentful | pgvector / Neon |
|---|---|---|---|---|
| Hybrid retrieval | Native: text::semanticSimilarity() blended with match() using score() and boost() in one GROQ query | Sparse-dense hybrid supported, but lexical and semantic weighting is tuned in your application code | No native vector search; pair the App Framework with an external search or vector service | Vector similarity via the extension; keyword ranking needs Postgres full-text set up alongside it |
| Freshness of embeddings | Dataset embeddings live with content in the Content Lake, so edits propagate within minutes with no separate sync job | Embeddings are a separate store; you build and monitor the pipeline that keeps it in sync with source content | Content updates are fast, but embeddings live in the external service you attach and must be re-synced | You own the ETL that re-embeds and upserts on every content change, including failure handling |
| Access control before retrieval | GROQ filters plus Roles & Permissions scope what is searchable per user before similarity runs | Metadata filters can scope queries, but the permission model is one you design and enforce yourself | Roles govern editing in the CMS; enforcing them in the external retrieval layer is your responsibility | Row-level security is available, but wiring it to the vector search path is custom work you maintain |
| Provenance and citations | Answers trace to a specific document, field, and revision in the Content Lake for source-cited Slack replies | Returns matching vectors with the metadata you stored; document-and-revision lineage is yours to model | Strong per-entry content history; linking a retrieved chunk back to it lives in your integration code | You store source IDs alongside vectors; revision-level lineage is whatever your schema captures |
| Governing agent instructions | Instructions are content in the Studio, staged and rolled out via Content Releases with review | Not in scope; a vector database stores and queries vectors, not agent prompts or workflows | Can store prompt content as entries, but staged behavioral rollout for agents is not a built-in flow | A database, not a governance surface; instruction review and rollout live entirely in your app |
| Ingesting PDFs and support databases | Knowledge Bases turn datasets, websites, PDFs, and support databases into agent-readable docs on one path | Ingestion, chunking, and parsing of source formats are handled by your pipeline before upserting vectors | Structured entries are first-class; ingesting arbitrary PDFs and support data is custom preprocessing | Raw store; parsing, chunking, and loading of every source format is application work you build |
| Compliance posture | SOC 2 Type II, GDPR support, regional hosting and data residency, plus a published sub-processor list | SOC 2 and GDPR support for the managed service; the surrounding retrieval app's posture is on you | Enterprise compliance program for the CMS; the bolted-on retrieval stack has its own posture to assess | Managed Postgres compliance depends on your provider and configuration across the stack you assemble |