---
title: "Discussion on \"Your AI assistant can leak files people aren't allowed to see — here's how to fix it\" | Hashnode"
description: "Discussion on \"Your AI assistant can leak files people aren't allowed to see — here's how to fix it\". Permission-aware RAG with Authorizer + OpenFGA + Qdrant: a runnable demo where two users ask the same question and get different answers — because the vector search itself respects who can see what. Fully self-hosted."
url: "https://hashnode.com/posts/permission-aware-rag-authorizer-openfga-qdrant/6a3156e774fb77e00e966b16"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Your AI assistant can leak files people aren't allowed to see — here's how to fix it](https://blog.authorizer.dev/permission-aware-rag-authorizer-openfga-qdrant?utm_source=hashnode&utm_medium=feed)

Permission-aware RAG with Authorizer + OpenFGA + Qdrant: a runnable demo where two users ask the same question and get different answers — because the vector search itself respects who can see what. Fully self-hosted.

Jun 16 · 11 min read · blog.authorizer.dev  
Read the article

-   [#opensource](https://hashnode.com/tag/opensource)
-   [#ai](https://hashnode.com/tag/ai)
-   [#rag](https://hashnode.com/tag/rag)
-   [#authorization](https://hashnode.com/tag/authorization)
-   [#authentication](https://hashnode.com/tag/authentication)
-   [#vector-database](https://hashnode.com/tag/vector-database)
-   [#vector-embeddings](https://hashnode.com/tag/vector-embeddings)
-   [#vector-search](https://hashnode.com/tag/vector-search)
-   [#qdrant](https://hashnode.com/tag/qdrant)

## Written by

[Lakhan Samani](https://hashnode.com/@lakhansamani)

@lakhansamani · Vadodara, India

  
[View profile](https://hashnode.com/@lakhansamani)

Software Engineer | Consultant

I’m Lakhan Samani from India 🇮🇳. I’m the creator and maintainer of authorizer.dev | Freelance Software Engineer | Prev: Cloud Software Engineer at ArangoDB. I am passionate about building products and developer tools. This website is my internet space, where I write about Building Software | Open Source | Finance and Life.

## Responses 6

Markdown supported · ⌘↵ to post

[Julian Neagu](https://hashnode.com/@julianneagulab)

[Jun 19](https://hashnode.com/posts/permission-aware-rag-authorizer-openfga-qdrant/6a3156e774fb77e00e966b16/comment/6a3543a8d5331e1a51317555)

Fail-closed design is doing more security work here than the entire LLM layer. Most systems quietly degrade to “best effort answers” when auth fails, which is exactly how leaks slip through. Treating truncation/unreachable auth as hard deny is the part teams usually avoid until production incident

[Zaryab Khan](https://hashnode.com/@zaryab-khan)

[Jun 18](https://hashnode.com/posts/permission-aware-rag-authorizer-openfga-qdrant/6a3156e774fb77e00e966b16/comment/6a33cef531f5651848f29b94)

AI can already help create new ideas, but truly revolutionary breakthroughs usually come from understanding a problem deeply, not just generating possibilities. My guess is that AI will become an incredible creative partner finding patterns and connections humans miss but the biggest leaps will still come from humans deciding which ideas are worth pursuing.

[Synfinity Dynamics Pvt Ltd](https://hashnode.com/@synfinity-dynamics)

[Jun 18](https://hashnode.com/posts/permission-aware-rag-authorizer-openfga-qdrant/6a3156e774fb77e00e966b16/comment/6a33c1af9a8aaa0f53c6d552)

Excellent breakdown of a problem that's becoming increasingly common in enterprise AI systems. We've noticed many teams focus on prompt injection defenses while overlooking retrieval-level authorization. The "authorization before retrieval" approach makes a lot of sense, especially for multi-tenant SaaS platforms where document access policies can vary significantly between customers. Curious how this approach performs when permission graphs scale to thousands of users and documents.

[Robert Smith](https://hashnode.com/@rsmith09)

[Jun 17](https://hashnode.com/posts/permission-aware-rag-authorizer-openfga-qdrant/6a3156e774fb77e00e966b16/comment/6a32f3a64d5f9c6f2d53e6d2)

Excellent write-up! I really liked the pre-filter approach with OpenFGA and Qdrant. Preventing unauthorized chunks from reaching the LLM is much safer than filtering after retrieval. We've been researching similar RAG security patterns and AI infrastructure on our blog , especially around secure vector search and permission-aware AI systems. It's great to see a practical implementation with real tests and a fail-closed approach. Thanks for sharing this detailed guide.

[InferHaven](https://hashnode.com/@inferhaven)

[Jun 16](https://hashnode.com/posts/permission-aware-rag-authorizer-openfga-qdrant/6a3156e774fb77e00e966b16/comment/6a31c9f753b3b0855dd046c1)

This makes perfect sense, love to see securities like this being engineered, kudos!
