Hi Deepankar,
Welcome to Microsoft Q&A and thank you for posting your question here.
Without proper code review this might be hard for a better solution.
Regarding the code sample, nothing wrong so far: https://learn.microsoft.com/en-us/azure/ai-services/agents/how-to/tools/function-calling?tabs=csharp&pivots=code-example
- Sometimes, functions that modify data or interact with certain resources require elevated permissions - https://learn.microsoft.com/en-us/azure/ai-services/agents/how-to/tools/azure-functions
- Ensure that your Visual Studio settings and project configurations are correctly set up to avoid unnecessary security scans - https://learn.microsoft.com/en-us/visualstudio/ide/user-permissions-and-visual-studio?view=vs-2022
- Also, consider adding exclusions for your project files and directories in your security software. This can prevent the security software from scanning these files and triggering false positives.
- You can check the detailed logs and alerts from your security software to provide more context on why the alerts are being triggered. Look for specific details about the DLL access that is causing the alert.
I hope this is helpful! Do not hesitate to let me know if you have any other questions or clarifications.
Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful.