Think Build Implement Repeat
London, UK +44 7367 067226
WhatsApp FOLLOW f in X
AI Integration

Making Sure the AI Only Shows People What They Should See

Last updated:

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.

Frequently asked questions

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

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.

Book a free 30-minute call Get a project estimate WhatsApp us

Related services

What we build for problems like this one

AI IntegrationEnterprise AIAI Agents