start	end	text
0	7660	All right. It is with great honor that I welcome to the stage Adam Shostak.
13110	18630	Thank you. Thank you. It's a pleasure to be here at the AppSec Village.
18770	26810	And I want to give you a slight word of warning. These are the least DEF CON-y slides you're going
26810	34070	to see because there were some speaker issues and I'm stepping in at the last minute. So you don't
34070	39210	have the crazy anime. You don't have some other stuff that I would have put in if there was time.
39210	46310	But I want to talk, I want to share with you some thoughts on threat modeling in the age of AI.
47290	56610	And I want to make the slides advance. And they are not advancing. Hey, Araz?
59430	64370	The keyboard seems to be entirely locked out. Oh, there we go.
64670	71950	What button am I hitting to make that happen? There we go. All right. We've got something
71950	77190	that works. I'm not going to bother to introduce myself. I think many of you might know I do a lot
77190	88530	work on threat modeling. Okay. Sorry. Thank you. You'll have to yell at me because I forget to
88530	95250	speak when I forget to speak into the mic. Anyway, when we used to think about the age of AI, we used
95250	101790	to think about, you know, Terminator. And if you're old like me, you might think about HAL 9000.
102990	110330	And this was going to be the age of AI. But instead, instead, it's things like this.
111310	118870	It's way less threatening looking, way less cinematic. But what I want to share with you,
118870	123230	I want to start with just a really quick overview of threat modeling, give you an introduction
123230	127450	in case you have not threat modeled or not succeeded at threat modeling.
127450	132650	Going to talk about how we apply those techniques to artificial intelligence systems,
132650	139590	really to LLMs. And then I'm going to flip over. I'm going to talk about how we use LLMs to secure
139590	144610	systems. I'm going to go a little faster because there was an awesome talk here at like 1230,
144610	149870	which went way more into depth on that question than I was planning to. If there's time, we're
149870	155850	going to talk about residual and uncontrollable dangers. And then I'm going to try to leave time
155850	163450	for questions. So quick little overview. Actually, before I get into an overview of threat modeling,
163450	170950	how many of you here have threat modeled a system in real system? Many, many. Cool,
170950	177830	but not all, not all in that. No criticism, but that bums me out a little bit. So I would love
177830	183490	for you to do a little bit of threat modeling. What is it? It is using models to help us
183490	191990	think about security. It's abstracting away some details so we can see the forest rather than the
191990	198990	trees or the twigs. And I think of threat modeling, the reason I spend my time and energy on threat
198990	205770	modeling is because I think threat modeling is the measure twice cut once of cybersecurity.
205870	213330	And if you do any sort of physical maker activity, you do things building with wood or building with
213330	219050	concrete, you measure twice before you do something so you don't make a mistake and
219050	227950	waste material. The material that we waste in our software projects is human time and energy when we
227950	236390	build the wrong thing. And then we either need to rewrite it, we either need to rewrite it because
236390	243230	we didn't build the right thing, or we get into these crazy arguments with people who are really
243230	251270	focused on we need to ship this on Friday and we're saying no. And if we threat model, we can
251270	257230	anticipate these problems, we can find these problems when there's time to do something about
257230	262570	them. And that's why I think it's so important to learn these techniques and to apply these techniques
262570	270310	across all of the systems we work on, including AI. And this applies to the things we produce,
270310	280650	it applies to the things we deploy. And so how do we do this? We do this by asking four
280650	286490	very simple questions. What are we working on? What can go wrong? What are we going to do about it?
286490	293070	Did we do a good job? There are lots of specific techniques, things like data flow diagrams help us
293070	300890	answer what are we working on. Tools like Stride and Kill Chains help us answer what can go wrong
300890	308590	in structured ways that we can teach the folks around us, that we can do in a way where we don't
308590	315610	have this problem of ask two AppSec experts, get three different answers. It really annoys the
315610	321190	folks around us to experience that. If you have not seen it, I want to recommend you go to the
321190	328550	Threat Modeling Manifesto website. 15 or so of us built out this manifesto talking about the
328550	335070	techniques, talking about how to threat model effectively. And one of the things I've learned
335070	341410	in the last year is that we underemphasize boundaries. And so I just want to mention
341410	347150	the importance of using threat modeling to identify where the boundaries are that we're
347150	353590	going to defend. I want to emphasize the value of using threat modeling to say where can we make
353590	361290	more boundaries? Where can we add defenses that allow our systems to operate more securely?
361930	366910	And this where are the boundaries is something that I've been hearing from more and more people
366910	371910	that they're not doing quite as well as they could be. And so I wanted to share that little
371910	379470	detail with you. So let's move to how do we threat model AI? And I'm going to talk
380130	386050	I'm going to talk about two of these four scenarios. I think there are four scenarios
386050	393130	we can think about. And this little model really helps me understand because these AI
393130	398870	conversations go off in all sorts of directions. People have so many things that they're thinking
398870	407230	about when we say AI or LM's. So the first scenario, AI for offense, right? Help have the AI
407230	412730	write me a phishing campaign. Have the AI write me malware. This is cool. Not going to talk about
412730	421070	it. AI for defense. This includes things like spam filters. Defender copilot. Not going to talk
421070	428590	about it. I'm going to talk about AI for business. When we deploy an LLM, how do we threat model that
428590	435770	LLM so that we can deploy it in a safer pattern? And I'm going to talk about AI for software
435770	445130	development. That will be my second focus. So what are we working on with AI? And
448310	456070	when I think about this, CISA has actually released some great threat model diagrams.
456070	460730	I'm going to show these to you. By the way, the slides are available. I apologize for the ugly
460730	467430	URL at the very bottom there. But the slides will be available so you can get to these.
468570	473110	And so I'm going to show you three models from CISA. I'm going to show you some examples of how
473110	480130	we might build models and how they might help inform what we do. And then I'll talk about how
480130	489270	to ask what can go wrong with each of them. So CISA has this model for building a large
489270	497410	language model and validating it. They've got a model for deployment and they have one for the
497410	505990	operational environment. And each of these three scenarios opens us up to different threats.
505990	514710	The what can go wrong is different. And you can borrow CISA's work as you're getting started.
514710	521270	You can say which of these three most resembles what we're doing. And then you modify their
521270	532270	diagram to more accurately portray what you are doing. So when we get to adding an LM to our
532270	540290	business, we get random messages in Hebrew and we can send a quick reply. That doesn't usually
540290	544730	happen to me, but I'm borrowing Araz's laptop. Thank you for the loan here.
546650	551670	So when we're... I'll pay him back in a little bit.
554290	560890	All right. Well, whatever. So when we add an LLM to our business, you know, maybe we've got a skilled
560890	568470	admin and they're doing things with the product. And then we can put an LLM in there. We can help
568470	574490	the enthusiastic newbie use our product. And we can just put an LLM there and then it sends
574490	581690	commands straight to the product. Does anyone here think that's a good idea? You're hired.
581970	590970	Somewhere else. So we can draw these really simple models, right? We can say, hey, the LLM
590970	597570	should send a command suggestion and then the command suggestion should go back to the newbie
597950	603570	so that the newbie can say, maybe that's not the right thing, or maybe the LLM is going to
603570	612410	summarize. And so we can find different deployment scenarios. And there is no engineering which is
612410	620130	as cheap as sketching random stuff in PowerPoint. Everything else that you're going to do is way
620130	629170	more expensive and slower. But using these, again, really dumb, I shouldn't say dumb,
629170	636610	using these really simple diagrams really helps us develop more secure products.
637030	641570	Well, that was weird feedback. All right. The other thing I want to talk about when we think
641570	649590	about what are we working on with LLMs is the importance of training data. Is your training
649590	656450	data preselected and curated? Is it coming to you live from the internet? If it's coming to you
656450	663330	live from the internet, do you remember Tay, the Microsoft chat bot on Twitter that turned into a
663330	672650	Nazi inside of 24 hours? And by the way, this was old Twitter. Now who knows how little time it
672650	684430	would take. Knowing what your training data is, where it's coming from, is crucial. And I can't ‑‑
684430	689730	I literally cannot tell you how many conversations I've been in where the folks with the training
689730	697090	data literally didn't know where it came from. Yeah, we spidered the internet. Okay. Let's talk
697090	705730	about that because it leads to answers to what can go wrong. And so the different answers, very
705730	711830	different threats. And so that's what are we working on. Ways to answer what are we working
711830	719510	on when we're working with LLMs. And there are lots of ways to discover what can go wrong with
719510	727070	LLMs. And I'm going to walk you through a set of them. Before I do, I want to mention that LLMs
727090	736890	are just software. The systems that we deploy around the LLM to enable the LLM, stride threats
736890	743930	still apply, kill chain threats still apply. Those fundamental building blocks are still really
743930	752530	useful as we're threat modeling a system with an LLM at its heart or around the edge. And so I'm
752530	763750	going to walk through a set of these catalogs and talk about each one. Yeah. Do that. So the
763750	772170	OWASP's top ten for LLM applications. This looks really nice. There's a lot of hard work that
772170	784270	went into this model. And I'm going to say, I do not love this model. I really ‑‑ I'm
784270	790470	somewhat frustrated by it. Because I think a whole bunch of it has nothing to do with LLMs.
790470	798710	So, for example, insecure output handling. This is a problem with any system that you build.
798710	808510	Why do we need a slot in an LLM top ten? Model denial of service. Denial of service is a threat,
808510	814830	it's part of stride. We should be finding it anyway. We don't need a slot for that.
814830	821430	Supply chain vulns, same thing. Sensitive information disclosure and model theft.
821430	829770	In my mind, one of those is a subset of the other. Again, why do we need to use these slots
830390	838230	for those things? And I believe there are actively better things we can use those slots for. For
838230	846130	example, hallucination, inexplicability, bias. And then we can just wrap all of those others
846130	855190	into insecure design and deployment. And so we could get better, I believe, than the LLM top
855190	865810	ten from OWASP. Then there's Microsoft's list. And Microsoft has published a lot of ‑‑ a lot,
866330	875410	a lot, a lot on LLMs and security. And as some of you may know, I worked there for a long time.
875410	885090	I'm proud of a lot of the work that came out of the teams I was part of. And I wish that Microsoft
885670	893030	was doing a better job of explaining why their thinking evolved from one of these to the next.
893090	899490	I wish they were doing a better job of marking old ones as deprecated. I wish they were doing
899650	910570	a better job of making these things practical and applicable in engineering work. And so while
910570	916870	I believe that they release a great deal of very, very useful content, I wanted to mention this
916870	925130	because you might expect that same quality in their LLM security work. And I look forward to
925130	931850	it getting there. The next one I want to talk about is the Berryville Institute of Machine
931850	939590	Learning. Some of you may be familiar with Gary McGraw who was at Cigital, wrote, I don't know,
939590	944850	seven books on application security. And these days he's leading a think tank, the Berryville
944850	954310	Institute. And they have an opinionated set of experts who have produced three really solid
954310	963950	sets of analyses. One is a taxonomy of AI threats. One is an architectural risk analysis of a
963950	969770	generic machine learning system. And by the way, Gary incorrectly calls threat models
969770	976710	architectural risk analysis because he spent his time as a consultant. And Gary knows that I tease
976710	982730	him. We've had a lot of arguments over this. And maybe in the next five to ten years he'll get it
982730	990810	right. The most recent one they've released is an architectural risk analysis for LLMs. It's
990810	997130	really good. It's thoughtful. It's in depth where it needs to be in depth. It's short where it can
997130	1007630	be short. And I love it. And in the last month or so, there's a fellow who's adapted Elevation of
1007630	1014710	Privilege, the card deck, to machine learning. And so he's released Elevation of Machine Learning.
1014710	1023990	And I love it because it makes for a fun way, an enjoyable way to engage with the content of the
1023990	1034450	Berryville analysis, which is in some white papers that can feel a little dense. And so I encourage
1034450	1042890	you to both read those white papers and to download Elevation of MLSEC because it's a pretty
1042890	1057310	cool tool. All right. How am I doing on time? I'm doing okay. Oh, I am not doing as okay on time as
1057310	1063590	I thought. Cool. No, we're good. We are totally good. So I said I might go a little bit fast on
1063590	1070650	this section because there was a great talk earlier today on using LLMs to help us develop
1070650	1085470	software. So how many of you used LLMs to develop software, like actual production stuff? Why so few?
1086090	1093570	No, I'm serious. Having an LLM develop software with you is really awesome.
1095850	1101890	It's an accelerator in a lot of situations. This conference, this deck was for another thing.
1101890	1107890	Ignore those words. So the first thing I want to say about this, it's deeply scary, right? The LLM
1107890	1115450	takes our data. It takes our intellectual property. It takes our trade secrets. And I think the trade
1115450	1123210	secrets are the nastiest of this. Because once you don't actually pay close attention to
1123210	1127610	protecting trade secrets, you can lose those secrets. You don't lose copyright, you don't lose
1127610	1136790	trademark, but you can lose trade secrets. And so I think that's very scary. And so that's the
1136790	1145170	output side, right? We're sending data to the LLM. The input side, what comes back to us is also
1145170	1155010	really scary. We get insecure, vulnerable code out of these things. We get uncopyrightable code
1155010	1162230	as a product of the AI or worse, we get someone else's copyrightable code integrated into our code
1162230	1172350	and that's awful. I'm going to skip over that. So let me talk about using LLMs to help threat
1172350	1180250	modeling. How many of you have provided a user story in Epic or something else to an LLM and
1180250	1186310	said write me a threat model? Has anyone done this experiment? A few of you? Okay. I'm going to
1186310	1191070	talk about what happens. I've been spending a lot of time on these experiments because I think it's
1191070	1200670	fascinating. I think it's important to understand. And so there's some obvious limits. I'll talk
1200670	1206610	about those. But there's also some really exciting opportunities that make this attractive,
1206610	1212470	that make it worth trying. And those are speed, right? I get a threat model in a minute instead
1212470	1220450	of an hour. There's scale. I can go to 25,000 developers and say pump this into an LLM and ask
1220450	1230550	it for help. I don't have to train those developers. I can get some degree of consistency and maybe
1230670	1240070	maybe if we ask the LLMs the right questions, we can get better answers than asking all of
1240070	1247490	our developers. That would be really cool if we can make it work. There are some really obvious
1247490	1258010	limits. The LLM can hallucinate. We can habituate to it, right? So if the LLM is right 75, 80, 90%
1258010	1264830	of the time, people will stop paying attention to what it's doing. They'll be like, yeah, that
1264830	1272470	seems reasonable. That seems reasonable. Oops. And this is a well‑known human bias. It's hard
1272470	1285510	to remain vigilant when the thing normally works. And so if you just send your code to an LLM,
1285510	1291710	and I did this. I was writing some code for that other event and I moved it to a new directory
1291710	1299070	and it broke. And it broke because there was a JWT and a cache file that I didn't know existed
1299070	1305290	because I didn't understand the code that I was using. And so I'm like, okay, now I know that
1305290	1311930	this thing exists. Let's see if I can ask the LLM leading questions and have it tell me that there's
1312110	1319090	a security dependency on a local file where I might want to, I don't know, set permissions or
1319090	1327190	pay attention to who's accessing it. I could not get any LLM to tell me about this file. It was
1327190	1334110	really frustrating. I asked it the most leading questions I could. Like, where does the JWT token
1334110	1345510	get stored? I don't know. And so these raw LLMs for threat modeling are way less effective than I
1345510	1352450	would like. And you can get smarter with prompting. You can get smarter with here's what the output
1352450	1360810	looks like, use this methodology. The retrieval augmented generation, chaining, helps a little
1360810	1368490	bit, but it starts to require engineering, not just using a raw model. There's a really important
1368490	1375850	thing here, which is that we write tests for the LLMs to determine whether or not they're actually
1375850	1383490	giving us good answers. If we don't know what good looks like, we can't easily compare between
1383490	1392770	Claude, chat GPT, Gemini, quick hint, don't try and get Gemini to threat model for you. Everything
1392770	1398990	you do will trigger its safety functions and it will say, like, I can't give you hacking advice.
1403320	1412520	So LLMs are currently best at tasks which are smaller than threat modeling. So when you say,
1412520	1418400	what are we working on, you can ask an LLM to give you an architectural design for the thing
1418400	1426440	you want to build. You can ask it to summarize what code is doing, discover what existing code
1426440	1433200	does, this is super useful, and it relates to the question of what are we working on.
1433200	1439580	You can ask it to make simplified system models and sometimes it does a pretty good job at that.
1440220	1447040	You can ask what can go wrong. Maybe you can ask what can go wrong with every story. And you can
1447040	1453080	ask what should we do. And it turns out that if you ask LLMs really specific questions about how
1453080	1459840	to fix phones, they are not bad. If you ask them very general questions about what to do, they're
1459840	1467780	God awful. You might also get them to write some mitigation code or mitigation test code for you.
1470300	1476620	So I'm going to jump over some of this to leave time for questions.
1477600	1484580	Let's see. But I do just want to mention one thing. So a lot of talk about the AI apocalypse,
1484580	1490060	which I don't put a lot of faith in, I don't believe. But there are real problems in the
1490060	1496560	real world today with AI that are very important for us to be thinking about, especially for folks
1496560	1505520	who come here to DEF CON. It's impossible to get a job today without your resume going through
1505520	1513160	AI. People who are traveling internationally get impacted by this. People have been arrested here
1513160	1519380	in the United States because some stupid computer program thinks their face matches another face.
1521000	1527660	There are pornographic deep fakes. There's the people who label these things. There's lots and
1527660	1533980	lots of real problems. I could do a whole talk on this with time. Last thing I want to point out is
1533980	1541260	that many of the security problems we have with LLMs are because of code data mingling by design
1541260	1548780	in the LLM. We have no idea how to fix these things. It's going to make safe deployment of
1548780	1556760	AI very challenging. So to summarize, talked a little bit about what threat modeling is,
1556760	1562980	why we do it. Talked about how the four question framework applies well to machine learning
1562980	1571840	systems and LLMs. I think ML will help us with software security and all of this makes for a
1571840	1576940	fascinating time to be in the field. So with that, I just want to say thank you for listening. I
1576940	1580100	apologize that I keep dropping the mic too far from my seat.
