Modern software engineering practices and technologies have accelerated delivery to the point where teams routinely deploy multiple times per day. This iterative high-velocity model conflicts with traditional threat modeling practices, which align better with linear and slower development cycles. Conventional threat modeling requires security knowledge, consumes substantial resources, and generates a lot of documentation that, while valuable, can quickly become obsolete in fast moving development environments.
To solve this problem, a prototype process was developed that combines threat modeling as a code (TMAC) tool, agentic AI, and the model context protocol. The aim was to make threat modeling more accessible and better aligned with modern DevSecOps workflows. In this process, the agentic AI autonomously gathers relevant system information, drafts and iterates TMAC syntax, and invokes the TMAC tool to generate diagrams and a report. In addition, the AI supplements the TMAC tool identified threats with findings derived from its own contextual reasoning. This design reduces the reliance on security experts and minimizes friction with rapid development practices.
The prototype process was evaluated using two scenarios: one in which the AI had access to only the architectural plans of the application to be threat modeled, and another in which it had access to the application's source code. The evaluation showed that access to source code produced noticeably better results. Each scenario was executed twice to assess reproducibility, revealing significant variation between runs. While promising, problems were noted in the ratio of relevant threats to irrelevant threats.Modernit ohjelmistotuotantoprosessit ja teknologiat ovat mahdollistaneet ohjelmiston päivittämisen monia kertoja päivässä. Tämä iteratiivinen ja nopea ohjelmiston kehitysmalli ei sovi hyvin yhteen perinteisen uhkamallinnuksen kanssa, joka sopii paremmin vaiheittain eteneville, hitaammille ohjelmistokehitysprosesseille.
Ongelman ratkaisemiseksi kehitettiin prototyyppiprosessi, joka yhdistää uhkamallinnus koodina työkalun, itsenäisen tekoälyagentin ja tekoälymallin kontekstiprotokollan (model context protocol). Tavoitteena oli tehdä uhkamallinnuksesta saavutettavampaa ja sopivampaa modernien ohjelmistokehitysmenetelmien kanssa. Kehitetyssä uhkamallinnusprosessissa tekoäly kerää itesenäisesti tarvittavaa tietoa uhkamallinnettavasta järjestelmästä kontekstiprotokollan avulla. Keräämänsä tiedon avulla tekoäly kirjoittaa uhkamallin uhkamallinnuskoodilla, iteroi sitä tarvittaessa ja suorittaa käännöstyökalun, joka tuottaa uhkamallinnusraportin PDF-tiedostona. Lisäksi tekoäly pystyy lisäämään itse löytämiään uhkia uhkamallinnustyökalun uhkien lisäksi. Tekoälyn laaja käyttö vähentää tarvetta tietoturvaeksperteille ja ylläpitää nopeaa ohjelmistokehitystä.
Prototyyppiprosessi arvioitiin kahden koeskenaarion avulla. Ensimmäisessä skenaariossa tekoälyllä oli pääsy vain uhkamallinnettavan ohjelmiston suunnitelmiin. Toisessa skenaariossa tekoälyllä oli pääsy myös ohjelmiston lähdekoodiin. Koe osoitti tekoälyn suoriutuvan paremmin, kun sillä oli pääsy myös uhkamallinnettavan ohjelman lähdekoodiin. Molemmat skenaariot suoritettiin kahdesti selvittääkseen ovatko tekoälyn tekemät uhkamallit toistettavia, osoittaen suuria eroavaisuuksia. Vaikka tulokset olivat lupaavia, ongelmaksi havaittiin merkityksettömien uhkien määrä verrattuna merkityksellisten uhkien määrään.