Your Threat Model Was Stale the Day You Saved It

Written by: 
Arshan Dabirsiaghi
Published on: 
Jul 29, 2026
A living threat model that re-draws as code changes, beside a cracked static PDF.
On This Page
Share:

Updated November 2026. Arshan Dabirsiaghi is co-founder and CTO of Pixee. He created OWASP AntiSamy and co-founded Contrast Security.

Short answer. Keep a threat model current by tying updates to code changes instead of the calendar. Generate it from the repository's source, check it again when the default branch changes, record why each change did or didn't need a revision, and keep the previous version visible. Then use the model to rank your findings, so it shapes what gets fixed.

Every security team I talk to believes in threat modeling. Almost none of them do it at the scale they ship.

The reason is mechanical. A good threat model takes a skilled person days to build. It captures how an application is exposed, where its trust boundaries sit, what data it touches, and where an attacker would push. Then someone ships a change, and the document starts drifting from reality.

Six months later that threat model describes an app that has changed underneath it. So when you actually need it, during an incident or a review, you have to spend time re-validating it (and hoping the person who wrote it is still around to help).

The standard pattern is that most threat models get written once, for the handful of applications important enough to justify the effort, and then they age out. The thousands of other services in your portfolio never get one at all. For most software the workaround was a gate: a three-question intake that asks whether the change touched sensitive data, whether it was internet-facing, and whether it was anything more than an internal tool.

So comprehensive threat modeling across your entire exposed software surface was already a losing race. AI coding agents make it worse, because your developers are shipping more software, faster.

The answer is to have agents build and refresh the model from the code.

What we already build

Pixee has been generating threat models under the hood for a while to power our triage and fix agents.

For every repository we work in, we build two views.

The outer view is the system as a whole: how it's exposed to the internet, how it's deployed, and where it sits on the network.

The inner view is the specific code: the entry points, the authentication and authorization paths, and the places sensitive data moves.

We build both against STRIDE, the same framework your architecture team already uses. Understanding entry points, authN/authZ strategy, and asset sensitivity is what lets a reader (human or agent) localize on what matters, surface the threats everyone overlooked, and squash the noise around them.

These models are the working context our system reasons over every time it triages a finding or reviews a design. That context is now yours to see and use directly.

Two views of every repo: an outer view of the system and an inner view of the code, built on STRIDE.
Two views of every repo: outer (the system) and inner (the code), built on STRIDE.

What it looks like

The model is derived from the code itself, not from a README that may or may not still be true. Point Pixee at a repository and it reads how the app is actually reached, how it authenticates, and which data is worth protecting, then rebuilds that read whenever you regenerate it.

Here is the generated Threat Model tab for a public application. It opens with a System Overview, an Exposure profile, and an Attack Surface Summary, all generated by the agent and regenerated whenever you ask.

The Threat Model tab in Pixee, generated by the agent from the repository's code.
The Threat Model tab, generated by the agent and regenerated on demand.

The Exposure profile answers the questions you would otherwise spend an afternoon chasing: is it internet-facing, how is it deployed, where does it sit on the network. For a public, intentionally vulnerable demo app, it reads a directly exposed web application on port 3000, notes the container and cloud deployment paths, and flags that the app is meant to be reachable.

The Exposure profile: internet-facing, deployment environment, and network position.
Exposure: how the app is really reached, read from the code.

The Attack Surface Summary is where it earns its keep. It enumerates the assets that actually matter and ties each one back to the code that touches it: authentication secrets and signing material, user credentials and session data, payment and wallet records, personally identifiable information, and the configuration and keys that govern how the app behaves. Read top to bottom, it's a map of where an attacker would go and what they'd get, with the file paths already attached.

Attack-surface map: exposed edge through the trust boundary to the app and its sensitive-asset nodes.
The attack surface as a map: exposed edge, trust boundary, and the assets that matter.

Can you generate a threat model automatically from source code?

Yes. The source is the most accurate description of a system you have, because it's what actually runs. A diagram describes what someone believed on the day they drew it. Here is how generation works in Pixee.

1. Read the repository. The agent finds the entry points, trust boundaries, sensitive assets, and the risk carried in by dependencies.

2. Cover two views, against STRIDE. The outer view covers exposure, deployment, and network position. The inner view covers entry points, authentication and authorization paths, and where sensitive data moves.

3. Lay it out for a reviewer. The model renders as a narrative overview, an attack surface, and an adjudication view, with a graph of which controls cover which threats and a diagram of how data crosses trust zones.

4. Give it five to ten minutes. Generation runs in five phases and streams its progress. That's quick next to the days a manual model takes, but it isn't instant.

5. Have someone check it. A generated model is a first draft for your reviewer (see what it doesn't do).

A one-off prompt to a chat model also produces a threat model, as a snapshot with no memory of the last version and no connection to your findings. A model earns its keep when it persists, gets regenerated, and feeds the decisions your team makes every day.

The everyday problem it solves

This is built for one situation in particular. You own security for more applications than you could name from memory. Something comes up on one of them, a pull request, an audit request, a report from a bounty hunter, and you have thirty minutes to form an opinion about an app you've never opened.

Today that starts with reading code and asking around. With a current threat model in front of you, it starts with the answers already in hand: how the app is exposed, how it authenticates, which data matters, and where to look first. You get oriented in the time it used to take just to find the right repository.

Enterprise security teams are constantly asked to parachute into an app, out of the thousands they manage, and add value fast. We built this for the agents doing that work, and for the coffee-powered intelligence sitting next to them.

How can a small security team scale threat modeling across hundreds of applications?

Stop modeling applications one at a time by hand. Generate a model for every repository, then spend your people where the models and the findings point.

The reasoning is capacity. If a model takes a skilled person days, headcount sets how many models a team can keep current. Your developers, now working with coding agents, set how many applications there are. Hiring doesn't close that gap, so the work has to change shape.

1. Model every repository you can. Generate a model for every repository, including the ones that never justified a manual review.

2. Pick the first human reviews from the scorecard. Each repository gets a ten-dimension scorecard: attack surface, defense in depth, blast radius, authentication, authorization, input handling, secrets, dependency risk, transport security, and observability. The evidence behind each score is visible.

3. Retire the intake gate. The model answers the three intake questions (sensitive data, internet exposure, internal tool) for every app, not just the ones someone filed a ticket about.

4. Let the model rank the findings. Pixee re-ranks triaged SAST findings against the threat model. Each gets a priority from 0 to 100, a tier, and a rationale naming the part of the model that moved it. Findings also cluster by entry point, actor, trust boundary, sensitive asset, and vulnerability class.

5. Use the same context before and after the code. Foresight reviews designs before code is written on the same context graph, and the findings triage confirms go to remediation as merge-ready fixes. If your teams write specs first, security can start in the spec.

A small team still decides what gets fixed. It just starts each application from a ranked short list instead of a blank page.

Why this is more than a feature

A threat model on its own is useful. A threat model wired into the rest of your security program is a different thing.

Take two applications with the identical finding, a SQL injection in a query builder. In one app, that code sits behind three internal services and touches no regulated data. In the other, it's one hop from a public endpoint and reads customer PII. Same finding, opposite priority, and the only thing that tells them apart is the threat model.

Same SQL injection, opposite priority: Low in App A, Critical in App B.
Same finding, opposite priority. Only the threat model tells them apart.

That's why we built this as shared context, not a standalone report. The same model that lets Foresight review a design before code is written also tells our triage which findings matter most in your environment, and tells our remediation how to fix them in a way that fits the app. One context graph, feeding both the proactive and the reactive side of your program.

How do I keep threat models up to date as the code changes?

Tie updates to code events, decide for each change whether the model needs a revision, and keep a record either way. A calendar review catches drift months after it happened, and attackers now move week to week.

The OWASP Threat Modeling Cheat Sheet says a threat model "should be maintained, updated and refined alongside the system" (OWASP). Here is how Pixee does it.

Today you can regenerate a model at any time, and the previous model stays visible while the new one builds, so the tab is never empty.

Automatic refresh is rolling out. Models refresh when a repository is enrolled and when its default branch receives a push. A reasoning agent reads each change and decides whether the model needs a revision. When it doesn't, the decision is recorded with the reason. An Update History view lists every refresh the agent considered, with its trigger, its state, the commit and pull request behind it, and the reasoning.

The record matters as much as the update. Someone opening a model six months from now needs to know whether it was checked against the change that added a public endpoint, not just when it was last saved.

Here are the ways teams keep a threat model current.

Approach What triggers an update Who updates it Record of why it changed (or didn't) Does it change which findings get fixed?
Periodic manual review (quarterly or per release) The calendar A security architect, by hand Meeting notes, if someone keeps them Not unless someone re-triages against the new model
Diagram or questionnaire platform A filed change, a reopened questionnaire, or a diagram, IaC or cloud import The app team answers, security reviews Whatever version history the tool keeps Not unless someone carries the change into triage
Threat model as code, reviewed in pull requests A developer edits the model file Developers, by hand, alongside the code change The pull request and its review Not unless someone re-triages against it
Model generated by a CI job A pipeline run The job generates, a reviewer reads Build output, or the platform the job pushes to Not unless the output feeds triage
Model generated from the repository's source (Pixee) Regeneration on demand; automatic refresh on enrollment and default-branch pushes rolling out The agent generates, a reviewer corrects Update History, rolling out with automatic refresh: trigger, commit, pull request, and reasoning, including "no revision needed" Yes, triaged SAST findings are re-ranked against the model

For the tools behind each row, compared by name, see threat modeling tools compared.

What it doesn't do

A generated threat model gets a security team oriented in minutes instead of days. It's a strong starting point, not a final verdict. Your reviewers will correct it and go deeper on the parts that matter, and it sharpens as the code it reads gets clearer. It's there to make your experts faster on their first pass, not to stand in for their judgment.

Frequently asked questions

How often should a threat model be updated?

Whenever a change could move the system's exposure, trust boundaries, or sensitive data, which for an active application is far more often than quarterly. The OWASP Threat Modeling Cheat Sheet treats the model as something maintained alongside the system, and the Threat Modeling Manifesto prefers continuous refinement to a single delivery.

What is continuous threat modeling?

Continuous threat modeling keeps a model in step with the code instead of producing it once. In practice, a code change triggers a check, someone or something decides whether the model needs a revision, and the decision is recorded. Without the trigger and the record, the model drifts the same way a manual one does.

Can AI do threat modeling, and can you trust the result?

AI can generate a threat model from source code, and Pixee typically does it in five to ten minutes per repository. Treat the result as a strong first draft.

It gets a reviewer oriented on an unfamiliar app quickly, and the reviewer corrects it and goes deeper where it matters. Your experts still make the call.

Do we need a threat model if we already run SAST?

Yes. A scanner can tell you a SQL injection exists. It doesn't know whether that code is exposed to the internet or touches regulated data, and that is what sets its priority. The same SQL injection can be low priority behind internal services and critical one hop from a public endpoint. Pixee uses the model to re-rank triaged findings and to shape the merge-ready fixes it opens.

Does Pixee do threat modeling?

Yes. Pixee builds a threat model for each repository from its source, with an outer view of the system and an inner view of the code, on STRIDE. The model re-ranks SAST findings, informs merge-ready fixes, and shares one context graph with Foresight's design review. It's part of how Pixee works as your purple team.

Do I buy Pixee threat models separately?

No. Threat Models are included in Pixee Enterprise Server, starting with 6.0, built on STRIDE with an outer view of the system and an inner view of the code. They're off by default, and your account team turns them on per repository. Foresight, which reviews designs before code is written, is licensed separately.

Available now

If you're managing more applications than your team can threat-model by hand, which is nearly everyone I talk to, generated threat models and on-demand regeneration are live in Pixee today, and automatic refresh is rolling out.

Let's talk.

Weekly Intel

AppSec Weekly

The briefing security leaders actually read. CVEs, tooling shifts, and remediation trends — every week in 5 minutes.

Weekly only. No spam. Unsubscribe anytime.