AI coding assistants now generate around half of all newly committed code, but the security pass rate for that code has remained at 56%, according to Veracode’s 2026 GenAI Code Security Report. That difference often begins before any code is even written. Threat modeling catches the structural flaws behind it before they ever reach a codebase.
That said, traditional threat modeling approaches struggle to keep pace with this volume of change. That’s why it’s a good idea to embed threat modeling directly into a DevSecOps pipeline by choosing the right methodology and automating model updates in CI/CD.

Threat modeling in DevSecOps, and in general, is a proactive, collaborative process of mapping system architecture, identifying potential security flaws, and defining defenses before any code is written. Instead of relying on late-stage security gates, teams integrate continuous risk assessment directly into sprints and CI/CD pipelines.
The idea is to find design weaknesses early, when fixing them costs the least. The problem with traditional threat modeling is that it often happens once during initial design, producing a document that quickly becomes outdated. In a DevSecOps context, threat models are updated continuously as the application changes.
It helps organizations shift security left, or move toward earlier security involvement in the software development lifecycle (SDLC). When developers understand potential attack vectors during design, they make better architectural decisions from the start.
In a DevSecOps pipeline, decisions move fast and get built into the system quickly. Threat modeling gives teams a chance to examine the security implications before those decisions are hard to roll back.
Threat modeling helps teams understand how an application could be attacked and where its security controls could be bypassed. It gives architects a better picture of the risks they need to address as they design the system.
Security issues are generally easier and less expensive to fix when they are found early. For example, if a broken authorization model is discovered after deployment, it could mean reworking entire components. However, catching it during design might need only a change to the architecture.
Threat modeling used to be something teams did when time allowed, but today it’s becoming a much more integral part of an SDLC. Frameworks such as OWASP ASVS and NIST recommend it, and requirements for PCI DSS, HIPAA, and SOC 2 ask for documented security risk assessments. Organizations need to show they considered security risks during design rather than addressing them only after deployment.
Threat models should be updated along with changes in the application. Common situations that should prompt a review include:
New features or user stories: Changes that introduce new functionality, handle sensitive data, or create new ways to interact with the application.
Architecture changes: These include moving to microservices, adding databases, changing authentication methods, or introducing new components.
Third-party integrations: Adding APIs, SDKs, or external services that create new trust relationships or data flows.
Deployment environment changes: Moving from on-premises to the cloud or adopting containers and other new infrastructure.
Threat modeling becomes more useful when it includes people who understand the application from different angles. Developers can bring practical implementation knowledge that security engineers may not have.
This shared ownership, often supported by a security champions program, makes security everyone’s responsibility rather than a gate that slows down releases.
Security engineers: Set the approach for threat modeling and help teams assess whether the model covers the most important security risks.
Developers: Bring their knowledge of the architecture and code to identify where an application could be exposed and put the right controls in place.
Product owners: Help determine which risks matter most to the business and how they fit with delivery priorities.
Operations teams: Identify risks that emerge in the production environment when applications are deployed and run.
There are several established frameworks that help teams systematically identify threats. The choice depends on an organization’s maturity, compliance requirements, and the type of systems being built.
STRIDE: Microsoft developed STRIDE to categorize threats into six types: Spoofing, Tampering, Repudiation, Information Disclosure, Denial of Service, and Elevation of Privilege. It’s particularly effective for application-level threats and integrates well with data flow diagrams.
PASTA: This stands for the Process for Attack Simulation and Threat Analysis, and takes a risk-centric approach, aligning threats directly to business objectives. PASTA involves seven stages, from defining objectives through vulnerability analysis to attack modeling.
LINDDUN: Another useful framework, especially for applications handling personal data, as it focuses on privacy threats. It stands for Linkability, Identifiability, Non-repudiation, Detectability, Disclosure of information, Unawareness, and Non-compliance.
RaD-TM: Rapid Developer-Driven Threat Modeling (RaD-TM) is a SecureFlag methodology that focuses on individual features rather than an entire system. It allows developers who understand a feature to build a threat model without having to bring together senior stakeholders.
AI agents change the threat modeling picture because their behavior can vary depending on the task they are performing. Traditional frameworks such as STRIDE, PASTA, and LINDDUN can miss some of these scenarios because they generally assume components have more defined roles.
However, traditional frameworks can be adapted for AI, and STRIDE is a good example. Researchers have extended it for AI and machine learning through an approach known as STRIDE-AI. It keeps the familiar categories while applying them to AI-specific risks, including training data poisoning and jailbreaking.
MAESTRO (Multi-Agent Environment, Security, Threat, Risk, and Outcome) was introduced by the Cloud Security Alliance to help teams threat model agentic AI systems. It breaks the analysis into seven architectural layers, covering everything from foundation models to the wider system. Teams can also use it alongside MITRE ATLAS, which provides a knowledge base of AI-specific adversarial techniques such as prompt injection and training data poisoning.
The OWASP GenAI Security Project has also published a Multi-Agentic System Threat Modeling Guide that applies MAESTRO in more detail for teams building multi-agent systems.
When threat modeling becomes part of the pipeline, it needs to work with the way teams already develop and ship software.
The first step is to create data flow diagrams that show how the system is structured and where information moves between components. The diagrams don’t need to be perfect, but they should be accurate enough to identify possible threats.
Automation helps here. Tools can generate initial diagrams from Infrastructure as Code templates, system descriptions, or existing architecture documentation.
With the diagram in place, it’s time to work through the chosen methodology. For STRIDE, walk through each threat category for every component. Document potential attack vectors and the threat actors who might exploit them.
This can also uncover design choices that haven’t been properly considered by developers, such as whether one internal service should trust input from another.
Some threats need attention sooner than others, so it’s best to use risk ratings based on likelihood and impact to help teams decide which ones to prioritize.
From there, link higher-priority threats to the controls that address them, using frameworks such as OWASP ASVS. This gives teams a clear way to move from identifying a risk to deciding how it should be addressed.
It’s worth integrating threat model generation into CI/CD pipelines so models update automatically when architecture changes. For example, a pull request that adds a new component or changes the infrastructure can then alert the team to look at the threat model again.
Once threats have been identified, they need to reach the people responsible for addressing them. Sending findings to tools such as Jira or Azure DevOps puts them into the same workflow developers already use, with proper ownership for each issue.
Linking findings to just-in-time training can also give developers more context around the issue. They can see what needs to change and understand why the risk is important, helping them avoid similar problems in the future.
A threat model can become outdated as the application changes. Architectural changes, new vulnerabilities, and changes to the deployment environment can all affect the risks that need to be considered, so the model should be revisited when those changes occur.
It’s a good idea to have regular reviews to catch differences between the documented architecture and how the system works. For some teams, a quarterly review can provide a useful check alongside reviews following significant changes.
Threat modeling as code brings the model into the same development workflows used for the rest of the application. Instead of keeping it in a static document or diagram, teams can store the model in a version-controlled format and update it as the system changes.
Version control: Store the threat model in Git so teams can review changes and track them.
Automation: Use CI/CD workflows to validate or analyze models as part of development.
Auditability: Keep a history of model changes so teams can see how security decisions have evolved.
Tools can also help create initial models from architecture descriptions, diagrams, source code, or IaC templates such as Terraform or CloudFormation. This can take some of the manual work out of threat modeling and make it easier to keep the model aligned with the application as it changes.
Making threat modeling part of everyday development comes with a few practical challenges, particularly as teams and systems grow.
Lack of security expertise: Developers may not always recognize common threat patterns or know which security controls to apply.
Time pressure in sprints: Threat modeling can feel like extra work when teams are working toward strict delivery deadlines.
Keeping models current: Applications can change faster than their documentation, leaving threat models out of date.
Scaling across teams: An approach that works well for one team may be harder to apply across teams working with different technologies and architectures.
These challenges can be addressed by building threat modeling into the development process and giving teams the tools and knowledge they need to use it effectively. The aim is for threat modeling to become part of how teams develop software rather than another task added to the process.
ThreatCanvas addresses the challenges outlined above by making automated threat modeling accessible to development teams as well as security specialists. It generates threat models in seconds from textual descriptions, images, existing diagrams, IaC templates, and code repositories. ThreatCanvas is available through GUIs, APIs, MCP, and native integration with popular software development tools.
Teams can also use built-in risk templates based on frameworks such as OWASP Top 10, PCI DSS, HIPAA, STRIDE, and LINDDUN, giving them guidance without needing deep security expertise. Integrations with Jira and Azure DevOps make it easier to take identified threats from the model into the workflows developers already use.
ThreatCanvas links identified threats to hands-on training labs. Developers can use a relevant lab to understand the vulnerability and practice fixing it, turning a finding in the threat model into an opportunity to build practical security skills.
Get in touch to see how SecureFlag can help.
Common threat categories include identity spoofing, data tampering, repudiation of actions, and information disclosure—the first four elements of the STRIDE framework. STRIDE also covers denial of service and elevation of privilege, making six categories total.
Traditional threat modeling typically happens once during design as a manual, document-heavy exercise. DevSecOps threat modeling is continuous, automated, and integrated directly into CI/CD pipelines so models stay current as code changes.
Teams benefit from performing threat modeling at initial design and then continuously thereafter. Update when major architecture changes occur, new integrations are added, or the system enters a new deployment environment.
Tools such as ThreatCanvas, IriusRisk, ThreatModeler, and OWASP Threat Dragon support automated threat modeling with varying levels of CI/CD integration, diagram generation, and framework alignment. ThreatCanvas can also import existing OWASP Threat Dragon models directly. The right choice depends on the existing toolchain and compliance requirements.