The Best Defense Against This Wave of AI Attacks: Hack Yourself First (Try This Now) — Transcript
Full transcript
- 0:00AI is making it easier than ever for
- 0:01attackers to go after everything. It's
- 0:04just nuts how many attacks and
- 0:05vulnerabilities we've been hearing about
- 0:07recently. Now, it's not necessarily the
- 0:09case that AI is enabling and driving all
- 0:11of these attacks, but it definitely
- 0:13plays a big part. There are a lot of
- 0:15anecdotes that I've heard about recently
- 0:16that just show how bad this can be. For
- 0:18example, the FBI recently warned of a
- 0:20hacking agent they found that allows
- 0:22attackers to go from choosing a target
- 0:24to full privileged access of the machine
- 0:26in less than 3 hours. And a researcher
- 0:29recently used a coding agent to find a
- 0:31critical vulnerability in the Java
- 0:33programming language in about an hour.
- 0:35These are just a couple of examples that
- 0:37we've seen recently that show how fast
- 0:39we can move with AI to do some pretty
- 0:41bad things. And so a lot of these
- 0:43anecdotes are coming from actual attacks
- 0:45and then also ethical hacking groups,
- 0:48security teams, and researchers that are
- 0:50just proving how bad this can really be.
- 0:52All this to say, security should be top
- 0:54of mind for you, no matter what you're
- 0:55building, how you're using AI coding
- 0:57assistance, it doesn't matter. We even
- 0:59have that scary example from a couple of
- 1:00months ago where there was a
- 1:01vulnerability found in PHP that's
- 1:03actually been around for years because
- 1:05AI just allows us to go so wide and so
- 1:08deep now. There's this new level of
- 1:10threats in the world because of how fast
- 1:12we can go with AI. So that's why on my
- 1:14channel right now I want to focus more
- 1:16on security for you. And already in the
- 1:18last video I covered how attackers can
- 1:19go after your coding agents and defenses
- 1:22for that. Now I want to get into the
- 1:23actual applications we build, how we can
- 1:26defend against attacks there. Now
- 1:28obviously security for our applications
- 1:30is a massive topic. There's so many
- 1:32different things I could get into with
- 1:33how we design our architecture, how we
- 1:35audit our applications, security around
- 1:37deployments. But what I want to focus on
- 1:39for this video is a single universal
- 1:41idea that will help you identify and fix
- 1:44vulnerabilities in your app, no matter
- 1:45what you're building. The idea here is
- 1:47simple. If attackers use AI to move
- 1:49quickly, we also need to use AI to move
- 1:51fast on the defense front. And the idea
- 1:53here is to hack your own application
- 1:55first. Seriously, I know it sounds
- 1:57silly, but if we can go through the
- 1:59process attackers would go through on
- 2:01our application, but we do it first,
- 2:03then we can identify and patch any sorts
- 2:06of security issues or vulnerabilities
- 2:08before our app goes to production. Now I
- 2:10know that might sound a bit idealistic.
- 2:11Of course, there should be other
- 2:13security measures that you have in
- 2:14place, but this is the main idea that I
- 2:16want to cover right now. And so we have
- 2:18to start by understanding how do
- 2:19attackers usually look for
- 2:20vulnerabilities in an application. That
- 2:22way we can mimic that when we hack our
- 2:24own app. So we'll cover what that looks
- 2:25like and then I'll show you a skill from
- 2:27Cloudflare that lets our coding agent
- 2:29walk us through this process on any app.
- 2:31All right, so let's start with how
- 2:32attackers usually work. Generally, they
- 2:34start with a single hunter agent that's
- 2:36going to look super deep through an
- 2:37application and the source code if
- 2:39available to try to find anything that
- 2:41even closely resembles what could be an
- 2:43exploit and it's going to pull that out
- 2:45even if it's not confident because we
- 2:46want a very wide breadth of looking
- 2:49through any potential vulnerabilities.
- 2:51And then for each one of those potential
- 2:52vulnerabilities found, the attacker runs
- 2:55a separate agent that's basically going
- 2:57to play devil's advocate and try to
- 2:58prove that this exploit isn't actually
- 3:01an exploit. And so if it can't prove
- 3:03that it's not a problem, then it's going
- 3:05to pull it out and that's going to be
- 3:06something we're going to try to execute
- 3:08on. And so there's a lot of junk that we
- 3:10find with the hunter agent that's going
- 3:11to be disproven, but we want that wide
- 3:13breadth first because any kinds of
- 3:15exploits in the real world are generally
- 3:17going to be pretty subtle things. Now
- 3:19remember that researcher I mentioned
- 3:21earlier, the one that found the critical
- 3:22vulnerability in Java? This is exactly
- 3:25the process that he went through and
- 3:26documented. And his hunter agent, it
- 3:28found a ton of junk. The vast majority
- 3:31of what it found was just disqualified
- 3:33by that second agent that disproved it.
- 3:36But there was that one golden nugget
- 3:38that it confirmed and then he proved the
- 3:40real execution and all that happened in
- 3:42about an hour. And I go through this
- 3:44full workflow because this is exactly
- 3:46what we should be doing when we try to
- 3:47hack our own application. So we use our
- 3:49coding agent as that hunter agent
- 3:52initially. With a very wide breadth, we
- 3:53try to find any exploits. And then
- 3:55through separate agent sessions, sub
- 3:57agents, background agents, whatever,
- 3:59we're going to have a separate agent per
- 4:00exploit basically trying to disprove
- 4:02that it's even a thing. And then for
- 4:04anything we can't fully disprove, then
- 4:05we try to execute on it to prove this is
- 4:08really a vulnerability that we need to
- 4:09then patch. And of course, this full
- 4:11process is what's wrapped up in the
- 4:13Cloudflare skill that I'll show you in a
- 4:14little bit. Cool. So the last thing I
- 4:16want to cover here before I get into the
- 4:17skill itself is the questions we need
- 4:20the hunter agent to ask itself as it's
- 4:22looking for vulnerabilities. There's
- 4:23five core questions, and these are what
- 4:25attackers are asking all the time as
- 4:27well. Now, this list isn't exhaustive,
- 4:29but it's very comprehensive. So question
- 4:31number one, can someone get in who
- 4:33shouldn't? Logging in or logging out.
- 4:35Question number two, can one user see
- 4:37another user's stuff in any way?
- 4:39Question number three, are any passwords
- 4:41or API keys exposed in the app, the
- 4:43source code, the database, anything?
- 4:45Then question number four, can a
- 4:47stranger trick the AI in your app? So a
- 4:50message or a GitHub issue, whatever it
- 4:51might be as input that could be a prompt
- 4:53injection attack. And then finally,
- 4:55question number five, can someone run up
- 4:57your bill or crash your application?
- 4:59These are the five things the hunter
- 5:00needs to look for. We don't have to have
- 5:02the answers ourselves. This is just the
- 5:04frame of what it's looking for when it
- 5:06is finding exploits. The sponsor of
- 5:08today's video is Mac Pa and their new AI
- 5:10assistant for your Mac NA. Between
- 5:13videos, I have dozens of things on my
- 5:15desktop. Raw takes, thumbnails, script
- 5:17drafts, installers. My desktop always
- 5:19becomes a mess and usually I clean it up
- 5:21by hand. Now you might not be recording
- 5:23videos like me, but you probably have a
- 5:25bunch of stuff also making your desktop
- 5:27a mess. So now I double tap option right
- 5:29on the desktop and ask NA to organize
- 5:31everything. It shows me the plan first.
- 5:34Installers and duplicate takes go to the
- 5:35trash, papers go into a research folder,
- 5:38and my scripts, thumbnails, and footage
- 5:40go into a video project folder in my
- 5:41second brain's knowledge base. I really
- 5:44like that it shows me the plan before it
- 5:46touches a single file. I tell it to run,
- 5:48it asks for permissions for commands, I
- 5:50click allow, and in this example after
- 5:52it goes through everything, I'm down to
- 5:53nine loose files. I then start prepping
- 5:56my next video. I use NA wand on a
- 5:58section of Anthropic's article on
- 6:00building effective agents. I ask for a
- 6:02brief saved in that video project
- 6:04folder. It asks before writing the file,
- 6:06I approve it, and then it builds the
- 6:08brief on top of the outline that I
- 6:09already had in there. Any is right there
- 6:11on my Mac, so nothing gets copied from
- 6:13one app to another. It takes me just a
- 6:15minute to organize everything for my
- 6:17last video and then do the initial prep
- 6:18for my next one. I go from a messy
- 6:21desktop to a brief that I can work with.
- 6:23That is skipped to done. And any is free
- 6:26to try with a link that'll have in the
- 6:27description. All right, so now that you
- 6:29know the questions to ask and the full
- 6:31workflow for hacking your own app, let's
- 6:33get into the security audit skill that
- 6:35helps you do it all. So it's important
- 6:37that you understand what goes into this
- 6:38skill, but we're definitely going to
- 6:39just leverage something that's already
- 6:41out there. Like I said earlier, if
- 6:43attackers move fast with AI, we better
- 6:45defend fast with AI as well. And so if
- 6:47you wanted to create your own entire
- 6:49harness for hacking your own app, you
- 6:50can definitely feel free to do so. But
- 6:52if we want to move quickly, we might as
- 6:54well use something that is proven
- 6:55already out there for us. This is the
- 6:57skill that is open source by Cloudflare.
- 6:59It already has almost 80,000 stars on
- 7:01GitHub, and it goes through the exact
- 7:03process that I've covered with you here.
- 7:05And Cloudflare even released an entire
- 7:07blog post going through all their
- 7:08strategies, which of course are built
- 7:10into their skill, and just their general
- 7:12ideas around how they find, prove, and
- 7:14patch vulnerabilities. So I'll link to
- 7:16this in the description. It is a very
- 7:17good read. And a lot of what we see here
- 7:19should look familiar based on what we
- 7:21already talked about. For example, their
- 7:23validator, which is the second agent, it
- 7:25cannot log findings of its own. Its sole
- 7:27job is to aggressively disprove the
- 7:30hunter's theory. If a hunter is allowed
- 7:31to create its own homework, it'll
- 7:33confidently validate everything its
- 7:35outputs, right? That's the core of the
- 7:36skill, that's the core of what we've
- 7:37been talking about here. So jumping over
- 7:39to the terminal now, it is incredibly
- 7:40easy to install this skill in any
- 7:42repository where you want to perform
- 7:44this audit. And we'll talk about later
- 7:46how often you want to perform this audit
- 7:47as well. So it is just a simple NPX
- 7:50install of a skill, just like any other
- 7:52skills you'd bring into your coding
- 7:53agent like Cloud Code. And this exact
- 7:55command is in the README for the skill,
- 7:56which I will also link to in the
- 7:58description. So you install this, and
- 8:00then all you have to do to use it is
- 8:01just tell your coding agent you want to
- 8:03run a full security audit, and then
- 8:04it'll know, okay, I should use the
- 8:06security audit skill from Cloudflare.
- 8:08And this, by the way, is a real audit
- 8:10that I ran on my Archon codebase, which
- 8:12is my biggest open source project. So
- 8:14here, I told it explicitly to use the
- 8:16security audit skill. You usually don't
- 8:18have to be explicit and it'll know the
- 8:20right skill to load, no matter the
- 8:21coding agent, but I just wanted to be
- 8:23explicit here. And then I told it where
- 8:24I wanted to output the report. And then
- 8:26I also said there's no sandbox on this
- 8:28machine, so I don't want it to actually
- 8:29run the exploits and try to prove them
- 8:31fully. If you have a sandbox available,
- 8:34the skill can leverage that to fully
- 8:36prove the exploits. So I'm going to skip
- 8:38that here, maybe just do it in a
- 8:39separate session. You can handle this
- 8:40how you want, but right here in this
- 8:42session, I'm simply interested in having
- 8:44the hunter run and then have the
- 8:46validator run after to try to disreprove
- 8:48things. And then I'll get that final
- 8:49list at the end of the stuff that wasn't
- 8:51disproven. Now, doing a full audit of a
- 8:53larger codebase is obviously going to be
- 8:55a very large task. And so my terminal
- 8:57looks like a mess here with all of the
- 9:00files it's writing out to and the
- 9:01different sub agents that it's starting
- 9:03for all the hunters. And so this is
- 9:05probably what it's going to look like
- 9:06for your codebase as well, as long as
- 9:08it's a decent size, but that just means
- 9:09it's being very comprehensive. And so
- 9:12the first thing that it does is it spins
- 9:13up a couple of recon sub agents. This is
- 9:16just gathering context of the codebase
- 9:18so it knows how many hunters it needs
- 9:20and how to prompt them specifically.
- 9:21We're going to do a lot in parallel in
- 9:23order to scale our auditing here. It
- 9:25would be way too much or it take way too
- 9:27long to run one hunter at a time. So it
- 9:29starts by running 12. And then down
- 9:31here, after these ones finish, it
- 9:33actually decides to invoke even more. So
- 9:35there's 18 hunters that we run in total.
- 9:37Now, for the sake of simplicity, you can
- 9:39think of it as just a single hunter
- 9:40that's running. We're really just
- 9:41distributing things for the sake of
- 9:43speed. And so it's going to find a lot
- 9:45of different potential exploits.
- 9:46Remember, we're going to be throwing out
- 9:47most of these things here. But for every
- 9:49exploit, we're going to kick off a
- 9:51verifier because it's one verifier per
- 9:54exploit that needs to be disproven. So
- 9:55each one of these is going to play
- 9:56devil's advocate. And I'll scroll down
- 9:58here because there's so many logs. At
- 10:00the end, it's going to have a report for
- 10:02which of the things were truly
- 10:03validated. Now, remember, it's not fully
- 10:05proven. We're not running the code yet,
- 10:07but we're finishing the devil's advocate
- 10:09and then we're going to a final answer
- 10:11for, you know, what was not able to be
- 10:13disproven just looking at the code. So
- 10:15only one issue could be confirmed and it
- 10:17is low severity. So I didn't find a lot,
- 10:20but that's good because obviously I've
- 10:22ran this kind of thing on Archon a lot
- 10:23before. It would be a problem if my
- 10:25massive open source project has a lot of
- 10:27real vulnerabilities, but it's good also
- 10:29for this example that did find one thing
- 10:31even if it is low severity. So at this
- 10:33point I have one potential vulnerability
- 10:35that passed scrutiny, but it's not fully
- 10:37proven yet. And so at this point you can
- 10:39prove it however you want. So we prove
- 10:41it, we fix it. That is how we finish the
- 10:42cycle of hacking our own application.
- 10:45And so if you have a sandbox like I
- 10:46mentioned earlier, the skill can hook
- 10:48you directly into that to test things
- 10:50autonomously. But if you want it to be a
- 10:52bit simpler or you just want more
- 10:53control like I typically do, then you
- 10:55can do it in a separate session. So
- 10:57right here our security audit confirmed
- 10:59one bug in the auth service. And so this
- 11:00is the report. So this session can read
- 11:03up on it cuz otherwise it doesn't have
- 11:04context. And then before we fix anything
- 11:06I want to prove it. So it's simply just
- 11:07adding a test that logs in with the
- 11:09dummy username and password, saves the
- 11:11session cookie, logs out, and then sends
- 11:13the saved cookie to get slash verify.
- 11:16And so just a few simple steps here to
- 11:18verify that this bug is truly a problem.
- 11:21Now I also want to move quickly here
- 11:22because exactly how you prove and fix
- 11:24these vulnerabilities that are surfaced
- 11:25really depends on the vulnerabilities
- 11:27that are there in the first place. So
- 11:29you might do unit tests or integration
- 11:31tests. Maybe you'll have the agent go
- 11:33through the application actually as a
- 11:34user would in real time. It's really up
- 11:36to you. The point is in this example it
- 11:38did prove that this was a real
- 11:40vulnerability with the tests that it
- 11:41created and then it also fixed it in the
- 11:43same session. So I can end with a pull
- 11:45request. This is what really ends the
- 11:47cycle here. I hacked my own app. I found
- 11:49vulnerabilities. I wasn't able to
- 11:51disprove them and so then I actually
- 11:53took the time to prove it for real and
- 11:54then make the fix. So that is the skill
- 11:56in a nutshell. Now the last thing that
- 11:58I'd be remiss not to cover is just some
- 12:00rules around hacking yourself
- 12:01effectively starting with how often
- 12:03should you do this in the first place.
- 12:05Now it really is up to you how often you
- 12:07hack yourself. You can do it every pull
- 12:09request, maybe on a schedule like once a
- 12:11week or you can do it before each large
- 12:13release of your application. You can
- 12:15also do it when there are external
- 12:16dependencies that change, like maybe
- 12:18security patch to the infrastructure
- 12:20where you host your application. Google
- 12:22actually found that attackers will
- 12:24sometimes turn security patches into
- 12:26attacks. So that's yet another thing to
- 12:28be aware of. My main recommendation just
- 12:30to keep it simple is to run this hacking
- 12:32yourself process before every release of
- 12:34your application. You go through cycles,
- 12:36right? You do a lot of dev testing,
- 12:37working in feature branches, and then
- 12:39before you make that big push to main
- 12:40and production, you run this process.
- 12:43And that keeps it simple because then
- 12:44anything that you find and patch just
- 12:47goes as another addition into the
- 12:48release that you 're making. Lastly, I
- 12:50feel a responsibility to say please only
- 12:52use this on your own applications.
- 12:54Technically, you could go and use this
- 12:56out in the wild. We're thinking like
- 12:58attackers. I know it's a pretty
- 12:59straightforward workflow overall, but
- 13:01it's possible. But we have to think like
- 13:03attackers because they're using AI to
- 13:05move fast. We need to go through this
- 13:06process before they do. And so with
- 13:08that, please go and try the skill right
- 13:10now on a codebase or maybe even
- 13:12multiple. You probably have a lot of
- 13:13things that you're working on, and this
- 13:14needs to be a part of your process, at
- 13:16least something like this, or you're
- 13:18leaving yourself open for attacks. And
- 13:20again, I will link to the skill in the
- 13:22description. So I hope that you found
- 13:23that helpful as well as just the
- 13:24high-level ideas here around how we need
- 13:26to think like attackers so we can defend
- 13:28fast with AI. If you found this useful
- 13:30and you're looking forward to more
- 13:31things on agentic engineering and AI
- 13:33security, I would appreciate a like and
- 13:35a subscribe. And with that, I will see
- 13:37you in the next video.
About this transcript
This page contains the full transcript of The Best Defense Against This Wave of AI Attacks: Hack Yourself First (Try This Now) by Cole Medin, generated from the public captions YouTube serves with the video. The transcript has 3,150 words across 439 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.