---
title: "Comment by Ahmet Özel on \"Multi-Tenant RAG Data Isolation\" | Hashnode"
description: "Enforcing both USING and WITH CHECK clauses in PostgreSQL Row-Level Security alongside FORCE ROW LEVEL SECURITY and a dedicated NOBYPASSRLS runtime role is a so"
url: "https://hashnode.com/posts/multi-tenant-rag-data-isolation/6b0857d47c54d94fd759d27a/comment/6b0ad2ec1ff8e7ec68778d16"
---

[Discussion](https://hashnode.com/posts/multi-tenant-rag-data-isolation/6b0857d47c54d94fd759d27a)

Comment [Multi-Tenant RAG Data Isolation](https://hashnode.com/posts/multi-tenant-rag-data-isolation/6b0857d47c54d94fd759d27a)

[Ahmet Özel](https://hashnode.com/@ahmetozel)

[13h ago](https://hashnode.com/posts/multi-tenant-rag-data-isolation/6b0857d47c54d94fd759d27a/comment/6b0ad2ec1ff8e7ec68778d16)

Enforcing both USING and WITH CHECK clauses in PostgreSQL Row-Level Security alongside FORCE ROW LEVEL SECURITY and a dedicated NOBYPASSRLS runtime role is a solid defense-in-depth blueprint. Separating migration ownership from the runtime role stops a forgotten WHERE clause in application code or a background worker from quietly crossing tenant boundaries.

Extending the exact same server-verified tenant context to caches, reranker inputs, file links, and conversation memory closes the secondary leak paths that teams routinely overlook. Verifying the full path with two synthetic workspaces—including background ingestion jobs—gives real confidence that isolation holds outside interactive HTTP handlers too.
