Modification calls with Azure AI Agent Function is causing Security Alerts

Deepankar 205 Reputation points
2025-05-04T11:22:35.1366667+00:00

Trying this below POC with a function which can extract temperature data and print in Console: https://learn.microsoft.com/en-us/azure/ai-services/agents/how-to/tools/function-calling?tabs=csharp&pivots=code-example

This is very strange. I created multiple AI agent functions to retrieve data, and my code was working smoothly. However, when I created a function to submit data, I started receiving security alerts and malware protection warnings indicating that it was trying to access my project DLL. Can someone check and confirm the issue? I understand that running Visual Studio in admin mode might resolve this, but it shouldn't be necessary. Since I can run the function in normal mode, the function related to modification (which isn't actually modifying anything, as I've hardcoded all the values) should also be able to run.

Below is the screenshot regarding which no security alert occurred.

User's image

Below is the code which is throwing security alert. And yes if I keep the property Location, the alert is not coming. Apart from Location, it is throwing Malware alert.
Screenshot 2025-05-04 164758

Below is the security threat error message and build error.
User's image

Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
3,619 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sina Salam 22,031 Reputation points Volunteer Moderator
    2025-05-05T12:53:08.5666667+00:00

    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

    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.