06:00 UTC Charta Aetatis Cyberpunk

Console Newsletter Pro Sign in Early access Register
Aa · Display
Themes
Type size
Density
Bug Bounty · STÖK · · 48:44 runtime

Builders & Breakers | Local AI for Offensive Security: Models, Harnesses & Human Judgment ft Thomas

Transcript 7484 words

Hi, I'm STÖK and you are about to experience  the Builders and Breakers podcast. The podcast

dedicated to the high velocity shortcuts we all  need to navigate this everchanging landscape and

it's based on conversations between the people  that are currently just building and breaking the

technology of tomorrow. We live in uncertain  times. things are changing by the minute and

knowing what direction to take can be the whole  differentiator between a total success and well

another iteration. But before we begin, I  would like to send a special thank you to

Sanity Labs for sponsoring our show. Thank you.  Now, without any further ado, here's the episode.

Hi and welcome to this Builders and Breakers  episode. I'm STÖK and together with me today

I have no one else but KUGG. Hi KUGG. Hello. Last  time we had a good conversation with Hamid. What

are we going to talk about today? Look uh we asked  Hamid what his one wish was for the future and he

asked about better local models and that is what  we're going to talk to to talk about today and we

are bringing in no other than Thomas Olofson also  known as Hutdan the Jeff Mos of Sweden he's the

founder of the sect conference and you have spent  a lot of time with local models haven't you? Yes,

it's one been one of my really side hustles  over the past couple of years because even

when when chat GPT2 came out I was like wow  imagine if you could run this locally and then

you could basically and I found as a lot of other  people and and started running with local models

um and my idea about this was that I I  really don't like the cloud I I think given

all your data to shutt is stupid. So I wanted  to do as much as possible. I'm very privacy

concerned and and I I saw early that a lot of the  clients and like if you're in the defense industry

or or doing stuff maybe healthcare, you can't send  everyone's information to the big cloud in the US,

right? So I started very early looking at local  models to see what can we build with them for my

type of clients which are h have high privacy  concerns. Uh so that that was a start and and

and in the beginning they were really terrible but  but like two years ago people started quantizing

the big models and quantizing is basically deco  compressing them so that they can fit in smaller

computers and ideally local computers and that's  where when when stuff really took off. So I've

been working with that almost full-time for like  two or three years now just making small models

do good work. Wow. your your sort of priority when  we have spoken has been around the offensive side,

right? Like ma making them hack also. Yes. I  I mean and this I my started my career like

25 years ago doing pentest and but but then  I stopped doing pentest and and just you know

doing do building stuffs and startups and  and but now it was so fun to see because a

lot of of clients would not accept that you  do a penetration test right with with and

sending all the data to the large US model in  of your highly classified system but but if I

present to them I'm going to bring a box with  my own models and we're not going to send any

data to anyone. Then people are happy. Okay.  Yeah. As long as it's contained, go ahead,

go nuts. And then penetration testing again is  like stealing candy from kids. It's like being

back in the '9s because you can produce so much  codes and harness that that are like tailor made

for this client that you can break almost anything  because that that's as we all know the best thing

with LMS. They never grow tired of looking at an  API. You can you can literally look at this API

24 hours a day for a week and you will find stuff  eventually even if the model is like small. I want

to echo that so much. I like first I I thought  okay pentesting is cooked and then I thought

pentesting is honestly actually fun again because  now we have coverage now. It's not just like oh

whatever I saw last Defcon that I'm reproducing  again or whatever. I'm actually using all attack

surfaces on the entire attack surface. Like I'm  I'm actually using everything in my arsenal and

I think that's great. There's a chance to produce  a lot of value in pentesting right now. Yeah. And

and and the funny thing is like la last report  I just wrote a pentest report for for a client

u and and I sent them all the code that my  AI agents had produced, my local AI agents,

and that turned out to be like 25,000 lines of  code of test harnesses that were run against

their systems. Uh and and the clients you do is  like what do I do with this? It's like I don't

know have fun run it daily. I don't know. It's an  extra free of charge. I didn't write a single line

of code. You just have a number of agents which  are just producing very good test frameworks

for for these specific tests. I I did the same  last week and I gave uh the models or I gave out

what I call the reconfirmation framework. So it's  like the resulting reconfirmation so that you can

deterministically reconfirm every vulnerability  but also use an agent to to find variance uh on

those vulnerabilities if you would want to. So  like oh so here's a test framework in playright

here's the visual confirmation here's the evidence  and here's how you do it yourself like the value

for a client is is so much more than we could  ever produce honestly one year ago. Yeah. No,

I I totally agree and and and just that you can  give proof of concept validation frameworks that

they can run locally and see that yes, this is  a real vulnerability. This is not something and

because like two years ago we all saw this there  was a lot of like submissions and AI slop where

AI thought like this is a vulnerability. Now  we are on the level where where that's not no

longer an issue because you can just ask your  local AI to okay then go ahead and exploit it

prove it to me write a proof of concept exploit I  don't accept it otherwise um wi-i which is I mean

it's been so fast between like 12 18 months ago  and that's another big reason why you should run

local models because I mean claude will let you do  some cyber work as will with chat GPT But it won't

let you write exploits. If you start going into  active exploitation, you will be blocked by local

guardrails. Those guardrails, if you have a local  model, either don't exist on the Chinese models,

on the European models or and American models,  they do somewhat exist, but they can be trained

away super easy. So you can have like I actually  wrote as a proof of concept. I'm not sure I

should publish it, but it's called the exploit  factory. So it runs a local model give given a

finding. So it's one of those things I run on my  pentest. I have checked out locally. I call it

an exploit factory. You input the the the actual  the code and the the vulnerability and outcomes an

exploit that you can run. Uh and and I mean that  would be impossible to do on on these uh on large

foundational models. But okay, this is amazing.  First of all, I love it. Um, but it's also like

um there's one thing we need to discuss here and  that is the ROI because you're explaining the

really cool stuff that we can run but I've been  doing this and I have a grandma typing kind of

solution that that it doesn't give me the results  that I want to have when I run it locally because

I don't have the hardware. You obviously do have  the hardware. Can you explain a little bit what's

needed to get the kind of results that you're  doing? Yeah, I I mean I started very early in

this. So I started in this when when the I bought  two GPUs like two or three years ago and I had to

explain to my girlfriend what I was spending like  200,000 Swedish croners on on back then 4090 GPUs

which were the [ __ ] back then and bought two  of them and a machine that cost a [ __ ] ton.

It's like why do you spend like 250,000 SDK  that's like 25 grand on a new computer? I was

like because this is the future. We we're going  to learn so much. AI is going to take over. Um

but right now obviously Nvidia released the GB10  platform um like 6 months ago, maybe a year ago,

and that has 128 gigs of of shared RAM and a  half uh Blackwell chip. So they cut the die in

half and put it in in a small computer with some  arms and it's a super efficient platform. So, and

it cost like currently in Sweden five grand. When  I bought it, it was three grand. So, they they're

increasing in price. I mean, investing in in GPU  hardware, it's like all of the hardware I bought

is worth more today than when I bought it a year  ago. So, that's how the shortage there is on AI

hardware. That's super interesting. So, and when  you're saying that you bring this to a customer,

do you have like a box that you put in there and  then suddenly it just goes burr or what happens?

No, I I can actually show it. Let me let So the  box is actually This is the box. This is the Intel

version. So I have one of these Lenovo fits all  the models, everything that I need to run which I

bring to the client and that's it. And and I get  like 100 tokens per second through that little

box. And for everyone, anyone that just looks  at this right now and and figures like, "Okay,

what did he just show?" Because you're listening  to this, he has a tiny little think station that's

15 times 15 cm or something, probably fanless,  I don't know. But that is something you plug

into the network. you have your custom harness  because that is something we're also going to

need to discuss like the importance of having your  own custom harness that is designed for the need

that you do that work with the model that you're  using to get the results that we want to have. Um

but that that's cool. That's that's really good.  I'm I'm impressed by that. I want to have one of

those. Can I has it? That is the kind of fields  that I'm at right now. Really cool. Yeah. I mean

you can order them. They're getting really hard  to get but but but yeah and a lot of providers

are building in uh I mean Lenova has one, Dell has  one. So all of the major providers are taking the

reference design from Nvidia and are producing  their own lines and I think Asus is the most

uh the cheapest one. Uh but they have sort of  messed up on cooling so it overheats all the

time. So I' I've changed my Lenovo to slightly  more expensive versions which has better cooling.

I'm running on something called the framework  desktop and the ultra version which is also 128

gigs of RAM and uh it's very very smooth  but it's not like as performant as you're

you're talking about 100 uh 100 tokens a second  depends on the model I guess but I'm maxing at

60 on GLM52 without optimizations let's talk about  optimizations I think like how can I how can I go

100 tell me. Well, the the the the the first  thing is parallelization. Uh yes, you I only

get like 40 to 50 as well on one stream. The what  you have to do is to have multiple agents and and

there it comes to framework again and scaffolding  because we need to build a framework. We normally

run multiple agents on this to to get through the  tokens per second. So you can you have specialized

agents one agent which is like mapping the  environment finding vulnerabilities then you

can have another agent working in parallel  taking those vulnerabilities verifying them

and peer reviewing them. So I actually have  like a detector agent, a peerreview agent,

an exploitation agent and you work them in  parallel as a team and then you go in and

guide them. But and then I then then actually have  various cues of like all potential vulnerabilities

go in here. Then you have another agent going in  there. It's like oh what is he found? Oh he found

this. Then you're trying to verify them, peer  review them and then it goes to to the exploit

factory that tries to write exploits for them. and  and that's how you get the 100 tokens per second

is that they're they're spread amongst context  windows and amongst workers. those harnesses or

those um agents that you built around that, they  obviously come from your background as a pentester

because having something that's very good at  finding vulnerabilities or thinking about it

maybe you know the whole hypotheses kind of thing  that we all do when we hack we do iterations like

you look at something you get an idea you're going  down that route for a while that was a rabbit

hole you go back up again you know you continue  something else and then suddenly down the route

epiphany happens. It's like, huh, this thing  that I did in the beginning, that was super

important. Now I need to connect these two and  voila, you go on. How do you deal with memory

in these spaces? Like, how do you work with your  to have the context to be not just rereading and

burning tokens, but how can you get that idea,  the theoretical things, the iterations that we

work with? That that's a super good question.  and and and for me it comes down to what is a

vulnerability and and this is not this has been  a theoretical question for for cyber security

for as long as humans have existed. For me a  vulnerability is something which is a a software

flaw which by exploiting it actually leads to a  loss or a gain by someone where it's not intended.

Um so I always start all my penetration testing  assignments with a threat model with the client.

What is you trying to protect against whom are  you trying to protect it? How what how have you

tried to protect it? And if I don't have that I  I have a sometimes you have assignments where you

don't get that. So so then I have an AI agent  which is taught to ask this question to build

a mental model of the subject that you're trying  to protect. So all the other agents can have that

information. Okay, we're trying to protect the the  data in personal data in the database uh against

intruders reading it because that would be uh bad  because of this or the users funds that are stored

in this like ledger database that's the most high  critical how can we get to that so I'm trying to

build a threat model with agents and then I have  the other agents have to classify their findings

against this threat model to see if whether it's  actually because back in the days when you started

pentest you can do a pentest of like 200 boxes and  find 500 vulnerabilities and you go to the client

there it's like okay but that's not in use so I  don't care uh so so I try to tie all my findings

against actual assets in the threat model I  I think that's wonderful because it it gives

also the model something that's verifiable to know  where they found value and not because there's so

much opportunity to waste time in pentesting and  time is what they're paying, right? Uh that's very

cool. Like uh if you are finding an indication  of a research area, like how do you how do you

cue that for another agent to pick up on? Uh  because like the the biggest problem that for

manual testers are distractions, right? You you  roll down the rabbit hole and you're like, "Ah,

JavaScript actually works like this." And you're  wasting your time. Whilst here you could actually

give it to someone else and parallelize. How do  you how do you do that? Yeah, the in my framework

that's still not optimized. I I still like to have  be the grown-up in the room and and orchestrate

who does what and then then I just still have to  wait for them to come back because if you try to

fully automate this without a senior, we're not  there yet where you can like just have pentest

in a box and click it on a box. You still need  a grown-up in the room that understands how how

exploitation works and and have the bigger theory.  the the local models work great for for working on

on smaller task, but but they're still not there  where you can like go hack Volvo and or or go hack

uh large bank and and it will come back to you  with with a shell. We're not there, but thankfully

uh so you still need to have like an overall  strategy against it and not just let them lose.

So, so I like to make those decisions myself and  and wait for agents to report back on various

area. So I give them like you guys you work on  on this API, you guys you work on this API, you

guys work on the front end, you you and then they  report back and then then you start digging into

where you have indications if that makes sense.  So I'm just comparing to some things that uh Hamid

said because he was making a distinction that uh  like a few months ago uh you had to be very much

more directive towards agents but today uh you  can give them greater freedoms and they produce

greater and that means that you're basically  give them a looser prompt and they will actually

produce better results uh given enough time. But  bear in mind he's talking about uh well the the uh

I think entropic and open AI in u in in offensive  mode. There's a difference between local models

and frontier models. Still of course uh the the  models that I'm talking about now we we're like

6 months behind uh of the frontier models. So you  still need to give them better guidance. But but

I agree with him to some extent. I like to give  them looser. My current harness is a lot of skills

files for the stuff that they're not trained on.  Since they're smaller, they need more skill files.

And and skill files for for people who don't do  agentic coding is like how does this product work

or how does this command work? How do you run end  map? Okay, end map you don't need to teach them,

but but a lot of skill files. So rather open-ended  quests with a lot of skill files when they need

it. That's my current harness because obviously  these small models aren't trained on on working

out every version of of the stuff they going  to attack. So I like to prepare skill files

for those stuff um from online so that research is  already made. But but then I agree you can start

giving them broader stuff to investigate but they  still need to have the skill files to actually

understand how for instance how what errors in  Rust can can occur if you're auditing a Rust

application. H how does uh like error handling in  Rust differ from error handling in C. they need to

have those skill files uh because the small models  are are not they're they're optimized for logical

thinking not for maintaining large amounts  of detailed data if that makes sense. Yeah,

maybe this is a tangent but I've noticed that um  agents that are local tend to make mistakes with

networking more often. uh they confuse networks.  uh they could confuse especially networks starting

with 192.168 and there is like confusions when you  do an SSRF or you have a vulnerability where you

you get network access and it's like oh I'm on  the LAN or whatever and and that's like a case

where where this sort of written scaffolding  helper would be useful like every time you see

an IP address verify the route table or here's  an instruction of how to actually understand

that address because uh they tend to lean on uh  on on um uh trained untrained information more

than experienced information. Yeah, that that's  very much the case. I agree because you you can

take zero scaffolding and and run clawed code  and and start hacking at something because it

has all of this trained into it and it's trained  on a lot of cyber security. These smaller models

are trained more on logic and logical thinking  and they're almost as good there, but they don't

have all the details about everything. you need  more scaffolding for a smaller model as we said

and and I like to do that with skill files.  So they only load it when they're like, "hm,

okay, I encountered an SQL server." Then they load  the SQL skill. This is how you do SQL injections.

This is how SQL injections work. So So they get  that like, you know, the matrix thing where like

plug in how to fly an helicopter. Uh you only  do that when you actually need it. That that's

my way of of like thinking about that skill files  when needed for small models. But I got another

question and that's probably more related to  routing of models because if you have like a

very expensive model that's super capable maybe  you don't need that to do your git commits or

or like audit or writing a text or something.  Different models are good at different things.

Is that something you looked into or is it or are  you just going to your base model and then just go

burr? Yeah, the the the problem with with routing  multiple models is then you need multiple hardware

and for me they're trying to do pentests I I I I  did go down that route and and I do have a smaller

model on my local Mac running for but but in the  end I'm now with with the latest I'm I'm basing my

models on the latest Quen series and they're so  good um that that I don't have to route anymore

uh because they're fast enough the the mixture  expert model h and they're smart enough to do like

90% of what I want to do. What I sometimes do is  if you're going to build something really big then

for some clients these offensive models can say  to to claude code or chat keep like build me this

harness and they go away separately as as builders  and build a big harness which gives nothing away

about the client infrastructure just takes like  one and I do that as a manual firewall. I go away

and I call cloud code separately. can you build  me a tool that does this? Takes IP number as

input gives this as output and then I give that  to the models to run. Um but but that's also so

that's like a totally separate computer with  nothing connected to the network. You you move

the source via USB stick and then you give that  your agents like this is the new tool that I have

for you and they're like okay let's run it. Um, so  I I I'm still very much uh for good reason scared

of having the models talk too much to each other  and to other networks as we have seen lately when

it comes to the the big AI labs um whether that's  marketing from their side or not but but they are

breaking out and they are doing stupid stuff. So,  I like to to keep my local models really local,

locked in a locked in a Docker container with no  access to anything except the target network where

I'm at. Yeah, I I I think the the OpenAI incidents  were were a big fumble. But like the critique that

automatically occurs when when you talk about that  is like okay so that happened with the controlled

models in their testing. What about uh what about  the open ones? Are are we the baddies? I mean,

it's like, oh, we have a gun. Will it kill people?  Yes. Uh but but it's also very much how you use it

and how you contain it. And I think containing  the models from what you're not intending to

test. Uh I mean, as an example, even the big  models, um Claude, for instance, a couple of

months of me go for me before. But now I'm even  running cloth in a Docker container because I

don't want it on my machine because it started  using my real SSH key and SSH into my boxes and

and oh there's a pseudo here with no password.  I'll just update this like no you don't stop

stop. It's like so so so the bigger the models  become and and that's also true for the open

source models. they are now also starting to to  like be very like open-ended in what they can do,

but also very open-ended what they think they're  allowed to do. Um, so so containing the models

while you especially when you're doing offensive  work is important. Um, so so I I I suggest running

them in a Docker container with with only network  access to what they actually should be accessing

because I don't trust them and and neither should  no one should trust them. It's like I if even the

big AI labs can keep their models contained,  it's going to be very hard for us as well. Like

are we going from the world mageddon to the breach  mageddon because the capacity to do this uh on the

local models uh is here now. I I'm I'm thinking  Kim 3 which is the the like maybe it's too much

for the G10 but it's like it's a super capable  model. It it's to me it's definitely comparable

to the Frontier ones. Sorry. Are we seeing a  relationship between this and new breaches or

more breaches generally like is is this happening?  I I think the biggest risk is is um which we have

seen over the past 10 years. The ransomware group  has been a big noisense uh and a big problem but

but they have have been mostly mitigated lately.  I I unfortunately I think we are going to see a

new ransomware group thing coming with with active  AI exploitation agents uh which are going to find

much much more vulnerabilities much faster. I I  think that's a big risk. And the other thing I I

think is a risk with this is AI agents which are  self-replicating uh like worms. Uh I I don't think

that's unlikely that you going to see a AI powered  worm that that attacks certain vulnerabilities

and research certain vulnerabilities and start  spreading and copying itself finding more GPUs.

Um, sounds a bit dystopic, but but I think  it's probably overdue already. I've heard

you say this before and I've read it in books uh  from the 80s and then you said it. Thing is like

um neurommancer William Gibson type things, right?  This is this is that type of future. If and when

that happens because this has been a mind bug to  me since you said it. If or when that happens,

whose responsibility is it to deal with? Like who  like is it the is the people who who follow the

shatam rules to sit in a secluded space who are  stepping up and becoming superheroes to to stop

the the villain computers. Is that like tell me  more about that scenario like what happens then?

No, but I I I think it just progression. You're  saying it's like are we surpassing Volmageddon?

The problem is that we have written code for  for 50 years and no one has actually cared

about security really unless you're exploited.  Uh and it's the same thing now. We are finding

vulnerabilities but also the number of unpatched  CVS like per year is just going up. It's like a

hockey stick. We're we're now at where AI can  find more vulnerabilities per lines of code

than any human. Um and yes, the next logical step  is exploitation. And I'm now measuring this. We I

can write an exploit factory. That means that  the Chinese or or the ransomware gang should

also be able to write an exploit factory. Are  they doing this? I guess uh why haven't we seen

more exploitation? I don't know. Um but but but  it's likely that that it's become AI capabilities

are becoming mainstream and and by smaller and  smaller non-nation state players. That that's

a fact. It's moving down the scales. And when you  start moving down the scales so that that a small

um like ransomware actor can use these models  um then I I think we're going to see an increase

there until the target clients have actually  fixed their vulnerabilities and and got their

patch processes correct again because ransomware  hasn't been a big problem lately because people

have actually stepped up on on the blue side and  on the defense side but I think they will very

quickly have to deploy AI on the defensive side as  well. We can't have patch Tuesday or patch every

second week because that time to exploitation is  decreasing by the day. I got a question related to

that because there is a conversation going around  the the interwebs where you know cyber is so vast.

We talk about vulnerabilities. We obviously are  biased for that because we do security research

and we love that. And now we feel like we're 10xed  because we can I I feel I like I feel like it's

an im it's like imbalanced because I feel so  superpowered at the moment to complete these

kind of things and and I'm just a better better  hacker and a better security engineer by using

these tools. At the same time, we got fishing  campaigns, email thingies, social engineering,

and all these other discussions in cyber that we  talk about like, yeah, but um attackers will most

likely select the easiest way in. And I mean that  used to be an unpatched fortunate to be honest,

like that was hanging on the attack surface that's  being a bit cleaned up. I see O days popping every

here and there. People are holding on to O  days without reporting them. There's all these

different kind of stuff that's happening. Still we  got 2FA questions. Still we got fishing campaigns.

Still we got this whole other part of infosc that  we rarely touch. What is your kind of what is your

view on that both of you? I'm curious to know like  because I'm obviously very vulnerability research

biased. Uh but the rest of infosc can we protect  that too? Well, if I'm going to start Neil,

I I I'm a bit dystopic because I I think AI  agents I don't think fishing campaigns will be

are already AI agents, but I think we're going  towards a very dystopic future where you also

have a AI agent on your end reading the emails or  opening the emails. And the big thing with LLMs,

which no one has solved, is prompt injection. And  it's it's starting to be more and more provable,

non-solvable. We have researchers on on LLM  security. uh I'm running this cureai.se conference

for instance and and we have had presentations  there which are making me believe that this is

not a solvable problem. You cannot solve it  and the more agents we have the more agents

you have to fool. So I think social engineering  and fishing campaign is going to be less and less

about fooling the humans is going to be fooling  the humans agents because all of us are going

to stop reading our email inboxes at some point  because they're full of spams. we're going to have

an agent that that distills that for us. Can you  break through that somehow? So, it's going to be

a more layered defense on in cyber for these areas  as well. And we're already seeing that. Yeah. I I

I'd like to touch back on something you mentioned  before that blue teamers have gotten better. I I

think that's very true and I also think that the  attack surface attack surfaces have been lessened.

U but the turnaround for the criminal underground  is there as well. like there is legacy in what

they're doing, there is OPSSE in what they're  doing and there is an ecosystem of trade. So

imagine that you're buying an exploit. The exploit  price has gone down. The amount of breaches has

actually gone up. So there is tendencies that  we're seeing. But I think that there is sort of

a the amount of vulnerabilities is like a river  and now it's turned into a dam. Uh not because

there is something in the way but because there  is just a flood, right? uh of new vulnerabilities,

new risks, and just taking care and finding focus  on on what to do is is very different. Like I've

also had a really hard time reporting bugs. Uh  even in the the best programs, it's much harder

to get a fix in for the thing you're reporting  because everyone's reporting right now. So I'm

doing pent testing just like you are and I'm  running a local model and I'm reviewing C code

and there is like complex uh low-level bugs. what  do I do with this? Uh and and what they what they

tell you is like, oh, unless it's this critical,  you just post it openly and and we have talked

previously about reversing uh reversing bugs.  I've had a bot that reversed mailing lists,

just went through the kernel mailing list,  reversed every conversation and try to implement

exploits on that and it was very fruitful as  well. precloit and and like I I think we might be

early here and just seeing seeing what's going to  happen, but like uh I I'm not I'm not dystopian,

but I think change hurts and uh change is good and  it it takes a few years and then we'll come out in

a different world. I I I totally agree. It's like  when they invented the car, it's like, "Oh my god,

it's going to kill people." Yes, of course it's  going to kill people. Or the airplane, it crashes,

it kills people. But but it made the world much  more in the steam engine. Same same. I I think

this is just another steam engine. Some of them  did blow up and you could use them to do terrible

things, but but also it superpowers the users and  the world. And I do think hopefully we get models

trained to just fix vulnerabilities. That's one of  the research areas where I would like to see more

research being done. Don't train all your models  on on on like exploit bench and find and break in.

Train your bloody models on writing patches that  works. If you fine-tune your models for that, we

would be in a better world. But that doesn't give  you all the the PR value that you get from like,

oh, my model is so bad. It broke out and hacked  another model provider. That that's I I think

unfortunately it's sexy to break in, and this has  always been the thing in cyber than than like sexy

to protect. Uh but I think we hopefully we will  get better models. If we don't do I'm going to

start training my own models to write patches in  real time. Uh because I'm going to need them. And

that's actually one thing you can train your  local models really easy to do like just show

them the fix before and after of of all known  vulnerabilities and and you can get the model

that produce really good patches. Yes. No one is  doing that because it's not buying the the media

headlines. Thomas uh can you tell us how you train  a model because that's actually something we don't

know. Uh yes. So training a model there is two  ways of doing two two big two or three big ways.

Uh but one of them is taking existing data um and  running it like through a chat. When when a model

is in inference mode you only do a forward pass  if that makes sense. So you um only the tokens

can only move forward. So you can't change any  of the weights. What you do if you have did it

in training mode is you also have bounce back  between all the weights. So you can then actually

unlock all the weights and and this is obviously  as you hear much more expensive and you need much

more GPU and much more RAM. Um so you can then  actually change the weights through something

called back propagation. So if this forward pass  and and then you have something called a reward,

we know that this is the right answer. Then we  keep those changes from where it answers correctly

towards like okay it got it wrong. And and this is  like if if you have a training set where which has

a truth source you know that this exploit works  for instance then when it gets it right when it

gets an exploit then you save those weights  for the next iteration. And then you do this

thousands of times and hundred thousands of times  with hundred and thousands of example. Uh and and

the easiest way to explain this is the oldest like  the capital of Paris is and then it's supposed to

answer the next token uh or or the capital of  France is and and you're expecting a P. So if

it doesn't respond with a P then you throw that  away and you only save the weight updates that

actually produces towards the result that you  want. So it's really just a bunch of training

data and there is harnesses for this. Uh if you  unsloth is one company that has harnesses there's

already like readym made harnesses. You don't need  to understand what you're actually doing nowadays.

When I started with this three or four years ago,  then it was like really low-level hacking your own

CUDA graph loaders and stuff. But now there's  like open source tools from from Onslaught is

probably where I would start where you can just  like plug in your data set, plug in your model,

press run, go to sleep, estimated 24 hours, and  then come back with a trained model. And is it

good? Oh yeah, significantly better. I mean the  the the models that I've I actually did sort of

a training course in training models and and and  there's several things if you train a model on

finding vulnerabilities it will do it much faster  and have to think less because if you have a base

model which are tuned for general thinking if  you then feed it the thinking graphs from a

bigger model so I trained a model I I have both uh  that's why I also have like both claude and and um

open AAI on unlimited because then I can get the  reasoning steps from them and then I can fine-tune

my models for when look at how Claude found this  bug in this code. I give it the code and I give

it the reasoning. So you can also train it on the  reasoning. So so the smaller model can mimic the

larger models reasoning around vulnerabilities,  not in general but but around vulnerabilities. So,

so finding 1,000 SQL injections wi with clawad  opus and then running those traces against the

small model will make the small model understand  on how to find SQL injections. I Okay, so the

great text the great text is recorded and it's  fed into your thing. So it's like it's internal

thinking is going into your into your new model  and um like how do you make it performant because

that method was based on having a certain context  size etc like does that actually like that method

that you're now porting to a smaller model does  it actually work in that environment too? Uh yes

definitely uh gi given my research not only does  does it produce shorter reasoning uh and therefor

become faster but but I I did the first training  set that that did on my models was on um vulbench

there is like a vulnerability database which is  like 10,000 codes uh and and you can easily in 24

hours get almost any model up which are not like  specifically trained on C vulnerabilities. I got

it 20% better at detecting C vulnerabilities in 24  hours. So, so you can take a model, a small model

and just run vulnerable code and ask it to look  for them. So, so what I did then I I I ran that

benchmark against a large model and and and asked  it to like explain as briefly as you can how this

vulnerability works against the large model and  then I take that training set and run against my

small models of like uh so and and score it for  for whether it's a and and obviously you have

the patched version which is not the vulnerability  and this is super important when you tune because

in the beginning I was like ah I get 100%. But  then it it classified everything as vulnerable,

right? So so you also need to have a data set  which is actually realistic. So what what I found

is you need to have a data set where twothirds  of the data don't have a vulnerability because

that's what you're expecting. Otherwise the model  is what's called reward hacking. Otherwise it's

like oh if I say it's vulnerable I get a reward  because then my training continues. So you need

to have a predominantly nonvulnerable data set  to train on. This is uh this is something that

we have experienced. I think all of us like the  high ratings, the the lies, the exaggerations

uh like this is this is why people shy away from  AI in the first place, I think. Uh because it's

like full of [ __ ] right? So often. Yeah. And I  mean, as we said, as Daniel from from Carl said,

like two years ago, the AI was hallucinating  a lot and like giving like 500 false positives

that were submitted uh to his bug bounty so much  they closed down the bug bounty because it was

worthless because AI is slow. Now that has passed  and and the models are becoming much better at

like actually verifying what what they're saying.  Um, so I and but I think that's super important.

We need to train the models more on defending than  than on attacking. Even if we're going to use them

for attacking uh because I even though attacking  is the sexy part. I I think what the the cyber

field needs is more protective models which can  apply. And the other thing is with these agents,

their machine speed, I mean you're doing  thousands of requests per second. Um,

and and

Related videos

Discussion
1 comment 0 from AI Characters · 1 reader last reply 5d
That's Cyber for today

Tomorrow's desk, in your inbox by 06:00 UTC. The week's best stories, every Sunday. The month that mattered, on the 1st.

Drawn from the 538 sources the paper read this month. Text and HTML, one-click unsubscribe, free.

How often
Your desks