Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
  1. Home
  2. Blog
  3. Making Sure the AI Only Shows People What They Should See
AI Integration

Making Sure the AI Only Shows People What They Should See

Access control in retrieval systems — filtering before generation, and why permissions cannot be applied afterwards.

Updated 2 min readBy SpiderHunts Technologies

Free estimateNo obligation

Get a free estimate

Tell us what you need. A senior engineer reads every enquiry.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →

Quick answer — TL;DR

Filter at retrieval, using the asking user's actual permissions. Filtering the answer afterwards does not work, because the model has already read what it should not have.

Filter before, never after

The rule is simple and frequently broken: decide what this user may see, retrieve only from that, then generate.

If restricted content reaches the model, it will influence the answer even when the specific sentence is removed afterwards. There is no reliable way to unring that bell.

Use the source system's permissions

Do not build a second permission model that has to be kept in step with the first. Read the user's actual entitlements from your identity system or the document store and apply those.

A parallel model drifts within months, and the drift is invisible until something leaks.

What needs attention

  • Documents inheriting permissions from folders that have since moved
  • Passages carrying permission metadata that is not refreshed on change
  • Shared conversation history exposing another user's retrieved content
  • Logs containing retrieved passages, readable by administrators
  • Cached answers served to a user with different entitlements

Caching is a permission problem

Answer caching improves speed and cost and it must be keyed by permission scope, not only by question text. Two users asking the same question may be entitled to different answers.

This is one of the easiest mistakes to make and one of the most damaging.

Test it deliberately

  1. Create a low-privilege test account
  2. Ask direct questions about restricted material
  3. Ask indirect questions that would require it to answer well
  4. Check the logs for what was retrieved, not only what was returned

That fourth step is the one that finds the real problems.

FAQ

Frequently asked questions

The questions readers ask us after this guide.

Still have a question?

Ask us directly — a senior engineer will get back to you.

Ask about your project

Can we start without permissions?

Only if every document is genuinely open to everyone using it. That is rarer than people assume, so check before deciding.

Does filtering slow it down?

Marginally. Far less than the cost of an incident, and modern indexes handle filtered search efficiently.

What about people who change roles?

Reading permissions live from the identity system handles it automatically. That is the main argument for not copying entitlements.

Should administrators see everything in the logs?

Log retrieved passage identifiers rather than content where the material is sensitive. It keeps diagnosis possible without creating a second exposure.

Keep reading

More on AI Integration

Start here

Building an assistant over mixed-sensitivity content?

Permissions have to be designed in at retrieval. Tell us how your access control works today and we will map it.

  1. You tell us what you needTwo minutes on the form, or a message on WhatsApp.
  2. A senior engineer reviews itAnd comes back with questions, a realistic range and an honest view on fit.
  3. Free 30-minute scoping callWe talk through scope, options and a realistic estimate — with no obligation.
Free estimateNo obligation

Talk to someone who builds this

Send a short brief and we will come back with an honest view and a realistic range.

Takes under a minute. We never share your details.

  • Free consultation
  • No commitment
  • NDA on request

Prefer to talk? Book a free 30-minute call →