microsoft / sample-app-aoai-chatGPT

Sample code for a simple web chat experience through Azure OpenAI, including Azure OpenAI On Your Data.
MIT License
1.65k stars 2.58k forks source link

Document-level security is not working as expected #1148

Open oliver-chao opened 1 week ago

oliver-chao commented 1 week ago

I attempted to implement document-level security in the chatbot by creating a group_ids field in my Azure AI Search index and adding it to the environment variables in App Service. However, I'm still receiving results that should be restricted based on my login group information. I’ve verified in the logs that the group data is correctly obtained and passed to the search filter, yet it still isn’t functioning as expected. Has anyone else encountered this issue, or is there a step I might have missed?

oliver-chao commented 1 week ago

I didn\t see filter in the request body. The filter is dumped into model's paramters. Shouldn't we set filter: Optional[str] = Field(default=None, exclude=False) instead of (exclude = True) ?