a month ago
I am developing a Conversational BI Solution using Genie. There are users from different roles and we need to restrict the rows returned based on the user's role. Typically RLS. I understand from documentation Genie leverage the RLS setup on the Unity catalog. This approach expects to onboard the users to Databricks workspace, which is not feasible in my case.
The approach is to use the Genie API to customize the chat experience for the users.
My request is, how can we pass the user ID on every conversation and use this to filter the rows using RLS? Or is there any documentation on the best practices?
3 weeks ago
Hi @GunaR - Are you saying these users are not set up in Databricks at all, or are you saying these users are set up in an IDP (such as Azure Entra ID) and then synced with Databricks?
3 weeks ago
Yes, these users are not in Databricks at all. The approach is to expose the custom build chatbot to 500+ users and pass the email ID to custom API, which invoke the Genie API internally. I need to build the mechanism to handle RLS with this approach. Is it feasible?
2 weeks ago
Hi Guna , Same Kind of use I have . Did u able to achieve this?
2 weeks ago
Not yet, still on-research to achieve without onboarding to Databricks. Will keep posted here if I found any,
a week ago
Hi @GunaR ,
Building a Databricks App integrated with AI/BI Genie could be a clean way to handle this. Apps allow you to expose Genie (or any model endpoint) to external users without onboarding them into the workspace.
You can authenticate users through your existing IDP (e.g., Entra ID, Okta) and pass their identity or email to the Genie API. That context can then be used to enforce row-level and column-level security via Unity Catalog.
This pattern Databricks App + Genie + Unity Catalog is the recommended way to serve governed, chat-style analytics to larger user groups securely.
a week ago
Hello @bianca_unifeye Thank you for your response. I am on the same approach. But the Genie API doesn't have option to send the email as request param. https://docs.databricks.com/api/workspace/genie/startconversation
a week ago
@GunaR let me check with my team as I believe we had a workaround this.
a week ago
Hi @GunaR
This one is a tricky one as the users are not onboarded to databricks workspace. There is a custom solution you will require to build.
- Use Service Principal for the external application to authenitcate with Genie API. This SP will. have broader access to the table(s) data.
- Use a RLS Policy that uses a parametere which is dynamically passed by Genie.
- Genie API: Passing the User ID and Enforcing the Filter
Tuesday
Noted. Thank you for the suggestion and this make more logical.
Wednesday
You can implement RLS in Genie without adding users to Databricks by passing a user identifier with each API call and having your queries filter rows based on that ID. Typically, you’d set up parameterized queries or session variables that enforce row restrictions per user role. Check if Genie’s API supports context or metadata fields for each conversation—these can carry the user ID and drive the RLS logic.
yesterday
Thank you for the response @CharlotteMarti2 .
I am on the same lines, Unfortunately I don't see an option in the Genie API to set the context/metadata fields. https://docs.databricks.com/api/workspace/genie/startconversation
Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!
Sign Up Now