As organizations continue to develop applications and services, identifying security vulnerabilities within application code remains an important part of protecting their environments. Developers are producing more code than ever, particularly with the growing adoption of AI-assisted development tools. While these tools can improve productivity and accelerate development, they also introduce challenges in ensuring the resulting code is secure.
Microsoft is introducing a new capability within Microsoft Defender called Codename MDASH, an agentic code security scanner designed to help organizations identify, investigate, and address security vulnerabilities in their source code. The solution combines artificial intelligence with traditional code analysis techniques to provide a deeper understanding of potential security issues. In this article, we will explore what this new capability is, why organizations might want to use it, and the basic steps required to prepare an environment for using it.
What Is Agentic Code Security?
Agentic code security is a new capability available through Microsoft Security Exposure Management that uses AI agents to analyze application source code and identify potential vulnerabilities. Unlike traditional static application security testing tools, which often rely heavily on predefined rules and patterns, agentic code security uses multiple specialized AI agents to examine code and understand how different components interact.
Microsoft refers to this capability as Codename MDASH, and it is currently available in preview. It is integrated into the Microsoft Defender experience, allowing security teams to connect their development environments and manage identified vulnerabilities through a centralized security interface.
The idea is relatively straightforward. Rather than simply looking for potentially insecure functions or known coding mistakes, the AI agents examine how the code works and how information moves between different parts of an application. This can help identify more complex vulnerabilities that might otherwise require considerable manual investigation.
The solution supports several programming languages, including C#, Java, JavaScript, TypeScript, Python, and C/C++. Additional languages, including Go, PHP, Ruby, Rust, and Swift, can also be examined using general-purpose AI agents, although the depth and quality of analysis may vary.
How Does Agentic Code Security Work?
Behind the scenes, Codename MDASH uses a multistage analysis process that brings together more than 100 specialized AI agents. These agents are designed to investigate different classes of security vulnerabilities, such as injection attacks, authentication bypasses, and memory safety issues.
The process begins by analyzing the application’s structure and complexity to identify areas that may present a higher security risk. The AI agents then examine those areas for potential vulnerabilities, using different models and analysis techniques to investigate how the application behaves. Potential findings are further evaluated using code analysis techniques to help determine whether they represent genuine security concerns, rather than simply suspicious-looking code.
Once the analysis is complete, duplicate findings are consolidated, and the results are assigned confidence scores to help security teams determine which issues deserve attention. The solution also provides AI-assisted code fixes through the Defender command-line interface, helping developers understand and potentially resolve identified vulnerabilities.
What makes this interesting is that the solution is not simply another AI assistant suggesting ways to write better code. It is designed to investigate existing applications, identify security weaknesses, and provide information that developers and security teams can act upon. Findings can also be made available through Microsoft Security Exposure Management, providing greater visibility across an organization’s application environment.
Why Would Organizations Use It?
One of the biggest challenges with application security is the amount of code that organizations need to review. Development teams constantly make changes, introduce new features, and maintain existing applications. Even when code reviews and security testing are already in place, identifying every potential vulnerability can be difficult, particularly in larger applications with complex dependencies.
Agentic code security adds another layer of analysis that can help organizations identify vulnerabilities earlier and reduce the manual work required during security investigations. Rather than relying exclusively on developers to recognize security weaknesses, organizations can use the solution to examine their repositories and highlight areas that deserve additional attention.
Another benefit is the integration with the broader Microsoft Defender environment. Organizations already using Microsoft Security Exposure Management can bring application code findings into their existing security management processes, making it easier to review and prioritize issues alongside other security exposures.
For development teams, the ability to generate suggested fixes can also help reduce the time between identifying a vulnerability and implementing a correction. However, these suggestions should still be reviewed and tested before they are accepted. AI-assisted security analysis is a useful addition to existing security practices, but it does not replace secure development standards, code reviews, or application testing.
Preparing Your Environment for Agentic Code Security
Before organizations can begin using Codename MDASH, several components need to be configured. The solution uses the Microsoft Defender portal for management, Microsoft Foundry to provide the required AI models, and connections to development environments such as GitHub or Azure DevOps.
Step 1: Review the Requirements and Permissions
The first step is to confirm that your organization has access to the required Microsoft services and the appropriate permissions. Administrators need access to the Microsoft Defender portal at security.microsoft.com and the Global Administrator or Security Administrator role in Microsoft Entra ID to complete onboarding.
You will also need an active Azure subscription, a resource group, and sufficient permissions to create and configure Microsoft Foundry resources. During onboarding, an administrator must also be authorized to accept the terms and conditions on behalf of the organization.
Microsoft Defender uses unified role-based access control (RBAC) to manage access to agentic code security. Custom roles can be configured to allow users to run scans, upload results, view findings, or manage findings. This is useful because developers and security analysts may need different access levels. Organizations should review these permissions and assign only what each role requires.
It is also important to confirm that the service is available in your Azure environment. Microsoft currently documents support for selected regions within the commercial Azure cloud, so organizations using sovereign or government cloud environments should verify availability before proceeding.
Step 2: Configure Microsoft Foundry
Codename MDASH relies on Microsoft Foundry to host the AI models used during the analysis process. Organizations must create a dedicated Microsoft Foundry resource and deploy the models the service requires.
To begin, sign in to Microsoft Foundry and create a new project. During creation, select the Azure subscription, resource group, and supported region where the resources will be deployed. Once the project is created, you can deploy the required AI models from the Models or Deployments area.
Microsoft documents three required models for the Standard configuration: gpt-5.4, gpt-5.3-codex, and gpt-5.4-mini. There is also an MAI Cyber preview configuration that requires an additional model. The model deployments need sufficient token capacity, and Microsoft currently specifies a minimum of one million tokens per minute for each of the three required models.
There are also some additional configuration requirements relating to content filtering and network access. Microsoft recommends using a dedicated Foundry resource because the scanner requires less restrictive content-filter settings to examine potentially malicious code. These settings should be reviewed carefully and should not be applied to a Foundry resource shared with other AI workloads.
Remember that using Microsoft Foundry introduces Azure consumption costs, so organizations should review expected usage, model quotas, and associated costs before enabling the service.
For the complete configuration requirements, Microsoft provides a Microsoft Foundry integration guide.
Step 3: Enable Agentic Code Security in Microsoft Defender
Once Microsoft Foundry has been configured, the next step is to connect it to Microsoft Defender. Sign in to the Microsoft Defender portal and navigate to Exposure Management > Overview, where the Agentic Code Security option provides access to the onboarding experience. Alternatively, navigate to Exposure Management > Initiatives and open the Codename MDASH initiative.
The onboarding process begins with an authorized administrator reviewing and accepting the service terms and conditions. You then configure the connection to the Microsoft Foundry project created earlier.
Microsoft supports API key authentication and keyless authentication, with keyless authentication recommended. The keyless option uses managed identity and role-based permissions, helping organizations avoid storing API keys and managing their rotation. Depending on the selected authentication method, additional identity configuration may be required before completing the connection.
After entering the required connection details, use the Validate option to confirm that Microsoft Defender can communicate with the Foundry resource. Once validation succeeds, save the configuration to complete the initial onboarding process.
Step 4: Connect Your Source Code Repositories
With the service configured, the next step is to connect the source code repositories that you want to analyze. Microsoft currently provides connectors for both GitHub and Azure DevOps, allowing organizations to integrate their existing development environments directly with Microsoft Defender.
For GitHub, an administrator needs the appropriate permissions within the GitHub organization, including the Organization Owner role. Azure DevOps requires Project Collection Administrator permissions and the appropriate Azure DevOps access level. Both connectors are configured through the agentic code security settings in Microsoft Defender.
During connector configuration, administrators review the permissions that Microsoft Defender will receive. Read access is sufficient for repository discovery and security scanning, while optional write permissions support additional capabilities such as creating pull requests or updating information within the development environment.
Organizations should consider which repositories they want to onboard and whether all of them require access immediately. For an initial evaluation, connecting a limited set of repositories can provide a useful opportunity to understand how the service works before expanding its use.
Once the connector is activated, the repositories are discovered and made available to the agentic code security service. Microsoft indicates that this discovery process can take up to an hour.
There is also an alternative for organizations that do not want to use repository connectors. The Defender CLI supports local and CI/CD-based scanning, providing developers with another way to integrate agentic code security into their development processes. We will look at how scanning works in the next article.
A Few Things to Consider Before Getting Started
Although agentic code security offers some interesting capabilities, there are several considerations worth reviewing before introducing it into a production development environment.
First, the service is currently in preview, so capabilities, requirements, and configuration options may change as Microsoft continues developing it. Organizations should review the latest documentation and consider beginning with a small pilot rather than immediately connecting every application repository.
Second, because the service uses AI models hosted through Microsoft Foundry, administrators need to understand the associated consumption costs and resource requirements. Application size, code complexity, and the number of scans performed can influence resource usage. It is also sensible to involve the development and security teams when deciding which repositories to analyze and how findings will be reviewed.
Finally, the results should form part of an existing application security process. AI-generated findings and suggested fixes still require validation, and no single scanning solution can guarantee that an application is free from vulnerabilities.
Final Thoughts
Microsoft’s introduction of Codename MDASH represents an interesting development in application security, particularly as organizations increasingly use AI to accelerate software development. By combining specialized AI agents, code analysis, and integration with Microsoft Defender, the solution provides another way for security and development teams to identify and investigate potential vulnerabilities within their applications.
For organizations already using Microsoft Defender and Azure, managing application code security through a familiar security platform may be particularly useful. However, getting started requires some preparation, including configuring Microsoft Foundry, establishing the correct permissions, completing onboarding, and connecting the relevant source code repositories.