Back to Blog
AI

When Internal AI Answers From Documents It Shouldn't See: Permission-Aware RAG and Oversharing Controls

Internal AI assistants create a distinct class of incident: employees read restricted content through AI answers even though they cannot open the source documents. This article examines why standard RAG pipelines discard ACLs at indexing time, and lays out permission-aware RAG design principles along with the preparation and operational checks that make them work.

POLYGLOTSOFT Tech Team2026-09-078 min read0
RAGAccess ControlEnterprise AIInformation GovernanceAI Security

A New Kind of Incident Created by Internal AI Search

Organizations that deploy AI assistants over internal documents keep running into the same class of incident. Nothing leaks outside the company. Instead, an employee who cannot open a document reads its contents through an AI answer. Someone asks about executive compensation and gets a tidy summary. Key terms from an in-progress acquisition review surface in a regular employee's chat window.

The root cause predates the AI. Most organizations have run shared drives for years on a pattern of "upload it company-wide now, clean it up later." Audits routinely turn up performance review drafts, salary bands, and signed contracts sitting in company-wide folders. When humans searched, you had to know the filename to find anything, so these files were effectively hidden. Semantic search collapses that security by obscurity overnight.

The nature of the problem also makes it hard to handle. Because this is internal oversharing rather than external leakage, it does not trip existing DLP rules, it sits in a gray zone for breach reporting, and employees have little incentive to report it since "the AI told me." Discovery therefore tends to lag the actual exposure by months.

Why Standard RAG Architectures Struggle to Prevent It

A typical RAG pipeline splits documents into chunks, embeds them, and stores them in a vector database. In the process, the ACLs attached to the source documents are usually discarded. The index retains text and embeddings; the fact that a passage was restricted to HR disappears. There is simply no basis for an authorization decision at retrieval time.

The common retrofit is post-generation filtering: produce the answer, check the permissions on cited documents, then block. Three problems follow.

  • The model has already read the content. With streaming responses, the opening tokens can reach the screen before the block decision lands.
  • Uncited disclosure slips through. If the model summarizes without naming sources, there is nothing for the check to inspect.
  • You pay twice. Tokens and several seconds of latency are spent generating an answer that gets thrown away.
  • Summarization also blurs boundaries. When a public document A and a confidential document B are synthesized into one answer, the response may carry information from B while citing only A. Logs alone then cannot reconstruct what was actually exposed.

    Design Principles for Permission-Aware RAG

    The core idea is to move enforcement from after generation to before retrieval.

  • Store ACLs as index metadata. Attach the list of authorized group IDs to each chunk and restrict candidates to chunks that intersect the requesting user's group set. Most vector databases support metadata pre-filtering. Filtering after retrieval is not advised: the entire top-K can be filtered out, leaving the model with nothing to answer from.
  • Propagate user identity end to end. Reading everything through a single service account is convenient, but that account's permissions effectively become every user's permissions. Use on-behalf-of token delegation so the requester's identity reaches the retrieval layer.
  • Manage permission sync lag. When access is revoked on resignation, transfer, or project close-out, a stale index leaves a window open. Rather than freezing group membership into the index, resolve it against the IdP at query time; propagate document permission changes through events for immediate effect, with a nightly full resync as a correction pass.
  • Combine chunk-level masking. Often a document is broadly readable but specific fields — national ID numbers, bank accounts, salary figures — must be hidden. Tag sensitive fields with a classifier and substitute values by user tier, which separates document-level access from field-level access.
  • Preparation Work That Must Happen First

    Before connecting any AI, run a sharing permission audit: inventory folders set to company-wide, files open to anyone with the link, and external guest accounts that never expired. It is not unusual for a meaningful share of documents to land on the remediation list at this stage — skipping the audit is the riskier path.

    If your organization has no classification scheme at all, do not attempt a perfect taxonomy. Start with three tiers: public, internal, restricted. Define only the restricted tier precisely and let everything else fall to the default; that covers most of the risk without classifying every file. Layer on automatic tagging based on file path, owning department, and document type to establish initial coverage.

    Finally, secure after-the-fact verifiability. For each answer, record who asked what, which chunks were retrieved, and which documents grounded the response. Without this trail, you cannot scope an exposure when something goes wrong, and the only remaining option is shutting the service off entirely.

    Ongoing Operational Checks

    Permission design is not a one-time build; it needs continuous verification.

  • Maintain a permission-bypass regression suite. Create test accounts per tier, fire dozens of questions aimed at documents they should not see, and automatically score whether restricted information appears. Include indirect phrasings ("the headcount adjustment figures mentioned in last year's reorg document"), multilingual queries, and summarization requests — not just direct questions.
  • Balance against false positives. Over-tightened filters hide documents users are entitled to see, and trust in the assistant erodes fast. Provide a dedicated channel for "I have access but the AI couldn't find it," and give users a minimal block reason ("this answer would require documents you are not authorized to access").
  • Read the logs regularly. A user repeatedly probing sensitive topics, or a sudden spike in filtered retrievals, signals either a misconfigured permission or deliberate exploration.
  • POLYGLOTSOFT designs permission-aware retrieval as a default component of every enterprise AI assistant we build. We connect ACLs from your existing groupware and document systems into the index and deliver identity propagation, chunk-level masking, and answer-grounding logs as part of the implementation. We also support the pre-deployment sharing audit and the three-tier classification rollout, so if you are evaluating an internal AI deployment, we would be glad to talk it through.

    Need Technical Consultation?

    Our expert consultants in smart factory, AI, and logistics automation will analyze your requirements.

    Request Free Consultation