YouTube2Text

The Best Defense Against This Wave of AI Attacks: Hack Yourself First (Try This Now) — Transcript

by Cole Medin · 3,150 words · 439 segments · language en · Watch on YouTube

Full transcript

  1. 0:00AI is making it easier than ever for
  2. 0:01attackers to go after everything. It's
  3. 0:04just nuts how many attacks and
  4. 0:05vulnerabilities we've been hearing about
  5. 0:07recently. Now, it's not necessarily the
  6. 0:09case that AI is enabling and driving all
  7. 0:11of these attacks, but it definitely
  8. 0:13plays a big part. There are a lot of
  9. 0:15anecdotes that I've heard about recently
  10. 0:16that just show how bad this can be. For
  11. 0:18example, the FBI recently warned of a
  12. 0:20hacking agent they found that allows
  13. 0:22attackers to go from choosing a target
  14. 0:24to full privileged access of the machine
  15. 0:26in less than 3 hours. And a researcher
  16. 0:29recently used a coding agent to find a
  17. 0:31critical vulnerability in the Java
  18. 0:33programming language in about an hour.
  19. 0:35These are just a couple of examples that
  20. 0:37we've seen recently that show how fast
  21. 0:39we can move with AI to do some pretty
  22. 0:41bad things. And so a lot of these
  23. 0:43anecdotes are coming from actual attacks
  24. 0:45and then also ethical hacking groups,
  25. 0:48security teams, and researchers that are
  26. 0:50just proving how bad this can really be.
  27. 0:52All this to say, security should be top
  28. 0:54of mind for you, no matter what you're
  29. 0:55building, how you're using AI coding
  30. 0:57assistance, it doesn't matter. We even
  31. 0:59have that scary example from a couple of
  32. 1:00months ago where there was a
  33. 1:01vulnerability found in PHP that's
  34. 1:03actually been around for years because
  35. 1:05AI just allows us to go so wide and so
  36. 1:08deep now. There's this new level of
  37. 1:10threats in the world because of how fast
  38. 1:12we can go with AI. So that's why on my
  39. 1:14channel right now I want to focus more
  40. 1:16on security for you. And already in the
  41. 1:18last video I covered how attackers can
  42. 1:19go after your coding agents and defenses
  43. 1:22for that. Now I want to get into the
  44. 1:23actual applications we build, how we can
  45. 1:26defend against attacks there. Now
  46. 1:28obviously security for our applications
  47. 1:30is a massive topic. There's so many
  48. 1:32different things I could get into with
  49. 1:33how we design our architecture, how we
  50. 1:35audit our applications, security around
  51. 1:37deployments. But what I want to focus on
  52. 1:39for this video is a single universal
  53. 1:41idea that will help you identify and fix
  54. 1:44vulnerabilities in your app, no matter
  55. 1:45what you're building. The idea here is
  56. 1:47simple. If attackers use AI to move
  57. 1:49quickly, we also need to use AI to move
  58. 1:51fast on the defense front. And the idea
  59. 1:53here is to hack your own application
  60. 1:55first. Seriously, I know it sounds
  61. 1:57silly, but if we can go through the
  62. 1:59process attackers would go through on
  63. 2:01our application, but we do it first,
  64. 2:03then we can identify and patch any sorts
  65. 2:06of security issues or vulnerabilities
  66. 2:08before our app goes to production. Now I
  67. 2:10know that might sound a bit idealistic.
  68. 2:11Of course, there should be other
  69. 2:13security measures that you have in
  70. 2:14place, but this is the main idea that I
  71. 2:16want to cover right now. And so we have
  72. 2:18to start by understanding how do
  73. 2:19attackers usually look for
  74. 2:20vulnerabilities in an application. That
  75. 2:22way we can mimic that when we hack our
  76. 2:24own app. So we'll cover what that looks
  77. 2:25like and then I'll show you a skill from
  78. 2:27Cloudflare that lets our coding agent
  79. 2:29walk us through this process on any app.
  80. 2:31All right, so let's start with how
  81. 2:32attackers usually work. Generally, they
  82. 2:34start with a single hunter agent that's
  83. 2:36going to look super deep through an
  84. 2:37application and the source code if
  85. 2:39available to try to find anything that
  86. 2:41even closely resembles what could be an
  87. 2:43exploit and it's going to pull that out
  88. 2:45even if it's not confident because we
  89. 2:46want a very wide breadth of looking
  90. 2:49through any potential vulnerabilities.
  91. 2:51And then for each one of those potential
  92. 2:52vulnerabilities found, the attacker runs
  93. 2:55a separate agent that's basically going
  94. 2:57to play devil's advocate and try to
  95. 2:58prove that this exploit isn't actually
  96. 3:01an exploit. And so if it can't prove
  97. 3:03that it's not a problem, then it's going
  98. 3:05to pull it out and that's going to be
  99. 3:06something we're going to try to execute
  100. 3:08on. And so there's a lot of junk that we
  101. 3:10find with the hunter agent that's going
  102. 3:11to be disproven, but we want that wide
  103. 3:13breadth first because any kinds of
  104. 3:15exploits in the real world are generally
  105. 3:17going to be pretty subtle things. Now
  106. 3:19remember that researcher I mentioned
  107. 3:21earlier, the one that found the critical
  108. 3:22vulnerability in Java? This is exactly
  109. 3:25the process that he went through and
  110. 3:26documented. And his hunter agent, it
  111. 3:28found a ton of junk. The vast majority
  112. 3:31of what it found was just disqualified
  113. 3:33by that second agent that disproved it.
  114. 3:36But there was that one golden nugget
  115. 3:38that it confirmed and then he proved the
  116. 3:40real execution and all that happened in
  117. 3:42about an hour. And I go through this
  118. 3:44full workflow because this is exactly
  119. 3:46what we should be doing when we try to
  120. 3:47hack our own application. So we use our
  121. 3:49coding agent as that hunter agent
  122. 3:52initially. With a very wide breadth, we
  123. 3:53try to find any exploits. And then
  124. 3:55through separate agent sessions, sub
  125. 3:57agents, background agents, whatever,
  126. 3:59we're going to have a separate agent per
  127. 4:00exploit basically trying to disprove
  128. 4:02that it's even a thing. And then for
  129. 4:04anything we can't fully disprove, then
  130. 4:05we try to execute on it to prove this is
  131. 4:08really a vulnerability that we need to
  132. 4:09then patch. And of course, this full
  133. 4:11process is what's wrapped up in the
  134. 4:13Cloudflare skill that I'll show you in a
  135. 4:14little bit. Cool. So the last thing I
  136. 4:16want to cover here before I get into the
  137. 4:17skill itself is the questions we need
  138. 4:20the hunter agent to ask itself as it's
  139. 4:22looking for vulnerabilities. There's
  140. 4:23five core questions, and these are what
  141. 4:25attackers are asking all the time as
  142. 4:27well. Now, this list isn't exhaustive,
  143. 4:29but it's very comprehensive. So question
  144. 4:31number one, can someone get in who
  145. 4:33shouldn't? Logging in or logging out.
  146. 4:35Question number two, can one user see
  147. 4:37another user's stuff in any way?
  148. 4:39Question number three, are any passwords
  149. 4:41or API keys exposed in the app, the
  150. 4:43source code, the database, anything?
  151. 4:45Then question number four, can a
  152. 4:47stranger trick the AI in your app? So a
  153. 4:50message or a GitHub issue, whatever it
  154. 4:51might be as input that could be a prompt
  155. 4:53injection attack. And then finally,
  156. 4:55question number five, can someone run up
  157. 4:57your bill or crash your application?
  158. 4:59These are the five things the hunter
  159. 5:00needs to look for. We don't have to have
  160. 5:02the answers ourselves. This is just the
  161. 5:04frame of what it's looking for when it
  162. 5:06is finding exploits. The sponsor of
  163. 5:08today's video is Mac Pa and their new AI
  164. 5:10assistant for your Mac NA. Between
  165. 5:13videos, I have dozens of things on my
  166. 5:15desktop. Raw takes, thumbnails, script
  167. 5:17drafts, installers. My desktop always
  168. 5:19becomes a mess and usually I clean it up
  169. 5:21by hand. Now you might not be recording
  170. 5:23videos like me, but you probably have a
  171. 5:25bunch of stuff also making your desktop
  172. 5:27a mess. So now I double tap option right
  173. 5:29on the desktop and ask NA to organize
  174. 5:31everything. It shows me the plan first.
  175. 5:34Installers and duplicate takes go to the
  176. 5:35trash, papers go into a research folder,
  177. 5:38and my scripts, thumbnails, and footage
  178. 5:40go into a video project folder in my
  179. 5:41second brain's knowledge base. I really
  180. 5:44like that it shows me the plan before it
  181. 5:46touches a single file. I tell it to run,
  182. 5:48it asks for permissions for commands, I
  183. 5:50click allow, and in this example after
  184. 5:52it goes through everything, I'm down to
  185. 5:53nine loose files. I then start prepping
  186. 5:56my next video. I use NA wand on a
  187. 5:58section of Anthropic's article on
  188. 6:00building effective agents. I ask for a
  189. 6:02brief saved in that video project
  190. 6:04folder. It asks before writing the file,
  191. 6:06I approve it, and then it builds the
  192. 6:08brief on top of the outline that I
  193. 6:09already had in there. Any is right there
  194. 6:11on my Mac, so nothing gets copied from
  195. 6:13one app to another. It takes me just a
  196. 6:15minute to organize everything for my
  197. 6:17last video and then do the initial prep
  198. 6:18for my next one. I go from a messy
  199. 6:21desktop to a brief that I can work with.
  200. 6:23That is skipped to done. And any is free
  201. 6:26to try with a link that'll have in the
  202. 6:27description. All right, so now that you
  203. 6:29know the questions to ask and the full
  204. 6:31workflow for hacking your own app, let's
  205. 6:33get into the security audit skill that
  206. 6:35helps you do it all. So it's important
  207. 6:37that you understand what goes into this
  208. 6:38skill, but we're definitely going to
  209. 6:39just leverage something that's already
  210. 6:41out there. Like I said earlier, if
  211. 6:43attackers move fast with AI, we better
  212. 6:45defend fast with AI as well. And so if
  213. 6:47you wanted to create your own entire
  214. 6:49harness for hacking your own app, you
  215. 6:50can definitely feel free to do so. But
  216. 6:52if we want to move quickly, we might as
  217. 6:54well use something that is proven
  218. 6:55already out there for us. This is the
  219. 6:57skill that is open source by Cloudflare.
  220. 6:59It already has almost 80,000 stars on
  221. 7:01GitHub, and it goes through the exact
  222. 7:03process that I've covered with you here.
  223. 7:05And Cloudflare even released an entire
  224. 7:07blog post going through all their
  225. 7:08strategies, which of course are built
  226. 7:10into their skill, and just their general
  227. 7:12ideas around how they find, prove, and
  228. 7:14patch vulnerabilities. So I'll link to
  229. 7:16this in the description. It is a very
  230. 7:17good read. And a lot of what we see here
  231. 7:19should look familiar based on what we
  232. 7:21already talked about. For example, their
  233. 7:23validator, which is the second agent, it
  234. 7:25cannot log findings of its own. Its sole
  235. 7:27job is to aggressively disprove the
  236. 7:30hunter's theory. If a hunter is allowed
  237. 7:31to create its own homework, it'll
  238. 7:33confidently validate everything its
  239. 7:35outputs, right? That's the core of the
  240. 7:36skill, that's the core of what we've
  241. 7:37been talking about here. So jumping over
  242. 7:39to the terminal now, it is incredibly
  243. 7:40easy to install this skill in any
  244. 7:42repository where you want to perform
  245. 7:44this audit. And we'll talk about later
  246. 7:46how often you want to perform this audit
  247. 7:47as well. So it is just a simple NPX
  248. 7:50install of a skill, just like any other
  249. 7:52skills you'd bring into your coding
  250. 7:53agent like Cloud Code. And this exact
  251. 7:55command is in the README for the skill,
  252. 7:56which I will also link to in the
  253. 7:58description. So you install this, and
  254. 8:00then all you have to do to use it is
  255. 8:01just tell your coding agent you want to
  256. 8:03run a full security audit, and then
  257. 8:04it'll know, okay, I should use the
  258. 8:06security audit skill from Cloudflare.
  259. 8:08And this, by the way, is a real audit
  260. 8:10that I ran on my Archon codebase, which
  261. 8:12is my biggest open source project. So
  262. 8:14here, I told it explicitly to use the
  263. 8:16security audit skill. You usually don't
  264. 8:18have to be explicit and it'll know the
  265. 8:20right skill to load, no matter the
  266. 8:21coding agent, but I just wanted to be
  267. 8:23explicit here. And then I told it where
  268. 8:24I wanted to output the report. And then
  269. 8:26I also said there's no sandbox on this
  270. 8:28machine, so I don't want it to actually
  271. 8:29run the exploits and try to prove them
  272. 8:31fully. If you have a sandbox available,
  273. 8:34the skill can leverage that to fully
  274. 8:36prove the exploits. So I'm going to skip
  275. 8:38that here, maybe just do it in a
  276. 8:39separate session. You can handle this
  277. 8:40how you want, but right here in this
  278. 8:42session, I'm simply interested in having
  279. 8:44the hunter run and then have the
  280. 8:46validator run after to try to disreprove
  281. 8:48things. And then I'll get that final
  282. 8:49list at the end of the stuff that wasn't
  283. 8:51disproven. Now, doing a full audit of a
  284. 8:53larger codebase is obviously going to be
  285. 8:55a very large task. And so my terminal
  286. 8:57looks like a mess here with all of the
  287. 9:00files it's writing out to and the
  288. 9:01different sub agents that it's starting
  289. 9:03for all the hunters. And so this is
  290. 9:05probably what it's going to look like
  291. 9:06for your codebase as well, as long as
  292. 9:08it's a decent size, but that just means
  293. 9:09it's being very comprehensive. And so
  294. 9:12the first thing that it does is it spins
  295. 9:13up a couple of recon sub agents. This is
  296. 9:16just gathering context of the codebase
  297. 9:18so it knows how many hunters it needs
  298. 9:20and how to prompt them specifically.
  299. 9:21We're going to do a lot in parallel in
  300. 9:23order to scale our auditing here. It
  301. 9:25would be way too much or it take way too
  302. 9:27long to run one hunter at a time. So it
  303. 9:29starts by running 12. And then down
  304. 9:31here, after these ones finish, it
  305. 9:33actually decides to invoke even more. So
  306. 9:35there's 18 hunters that we run in total.
  307. 9:37Now, for the sake of simplicity, you can
  308. 9:39think of it as just a single hunter
  309. 9:40that's running. We're really just
  310. 9:41distributing things for the sake of
  311. 9:43speed. And so it's going to find a lot
  312. 9:45of different potential exploits.
  313. 9:46Remember, we're going to be throwing out
  314. 9:47most of these things here. But for every
  315. 9:49exploit, we're going to kick off a
  316. 9:51verifier because it's one verifier per
  317. 9:54exploit that needs to be disproven. So
  318. 9:55each one of these is going to play
  319. 9:56devil's advocate. And I'll scroll down
  320. 9:58here because there's so many logs. At
  321. 10:00the end, it's going to have a report for
  322. 10:02which of the things were truly
  323. 10:03validated. Now, remember, it's not fully
  324. 10:05proven. We're not running the code yet,
  325. 10:07but we're finishing the devil's advocate
  326. 10:09and then we're going to a final answer
  327. 10:11for, you know, what was not able to be
  328. 10:13disproven just looking at the code. So
  329. 10:15only one issue could be confirmed and it
  330. 10:17is low severity. So I didn't find a lot,
  331. 10:20but that's good because obviously I've
  332. 10:22ran this kind of thing on Archon a lot
  333. 10:23before. It would be a problem if my
  334. 10:25massive open source project has a lot of
  335. 10:27real vulnerabilities, but it's good also
  336. 10:29for this example that did find one thing
  337. 10:31even if it is low severity. So at this
  338. 10:33point I have one potential vulnerability
  339. 10:35that passed scrutiny, but it's not fully
  340. 10:37proven yet. And so at this point you can
  341. 10:39prove it however you want. So we prove
  342. 10:41it, we fix it. That is how we finish the
  343. 10:42cycle of hacking our own application.
  344. 10:45And so if you have a sandbox like I
  345. 10:46mentioned earlier, the skill can hook
  346. 10:48you directly into that to test things
  347. 10:50autonomously. But if you want it to be a
  348. 10:52bit simpler or you just want more
  349. 10:53control like I typically do, then you
  350. 10:55can do it in a separate session. So
  351. 10:57right here our security audit confirmed
  352. 10:59one bug in the auth service. And so this
  353. 11:00is the report. So this session can read
  354. 11:03up on it cuz otherwise it doesn't have
  355. 11:04context. And then before we fix anything
  356. 11:06I want to prove it. So it's simply just
  357. 11:07adding a test that logs in with the
  358. 11:09dummy username and password, saves the
  359. 11:11session cookie, logs out, and then sends
  360. 11:13the saved cookie to get slash verify.
  361. 11:16And so just a few simple steps here to
  362. 11:18verify that this bug is truly a problem.
  363. 11:21Now I also want to move quickly here
  364. 11:22because exactly how you prove and fix
  365. 11:24these vulnerabilities that are surfaced
  366. 11:25really depends on the vulnerabilities
  367. 11:27that are there in the first place. So
  368. 11:29you might do unit tests or integration
  369. 11:31tests. Maybe you'll have the agent go
  370. 11:33through the application actually as a
  371. 11:34user would in real time. It's really up
  372. 11:36to you. The point is in this example it
  373. 11:38did prove that this was a real
  374. 11:40vulnerability with the tests that it
  375. 11:41created and then it also fixed it in the
  376. 11:43same session. So I can end with a pull
  377. 11:45request. This is what really ends the
  378. 11:47cycle here. I hacked my own app. I found
  379. 11:49vulnerabilities. I wasn't able to
  380. 11:51disprove them and so then I actually
  381. 11:53took the time to prove it for real and
  382. 11:54then make the fix. So that is the skill
  383. 11:56in a nutshell. Now the last thing that
  384. 11:58I'd be remiss not to cover is just some
  385. 12:00rules around hacking yourself
  386. 12:01effectively starting with how often
  387. 12:03should you do this in the first place.
  388. 12:05Now it really is up to you how often you
  389. 12:07hack yourself. You can do it every pull
  390. 12:09request, maybe on a schedule like once a
  391. 12:11week or you can do it before each large
  392. 12:13release of your application. You can
  393. 12:15also do it when there are external
  394. 12:16dependencies that change, like maybe
  395. 12:18security patch to the infrastructure
  396. 12:20where you host your application. Google
  397. 12:22actually found that attackers will
  398. 12:24sometimes turn security patches into
  399. 12:26attacks. So that's yet another thing to
  400. 12:28be aware of. My main recommendation just
  401. 12:30to keep it simple is to run this hacking
  402. 12:32yourself process before every release of
  403. 12:34your application. You go through cycles,
  404. 12:36right? You do a lot of dev testing,
  405. 12:37working in feature branches, and then
  406. 12:39before you make that big push to main
  407. 12:40and production, you run this process.
  408. 12:43And that keeps it simple because then
  409. 12:44anything that you find and patch just
  410. 12:47goes as another addition into the
  411. 12:48release that you 're making. Lastly, I
  412. 12:50feel a responsibility to say please only
  413. 12:52use this on your own applications.
  414. 12:54Technically, you could go and use this
  415. 12:56out in the wild. We're thinking like
  416. 12:58attackers. I know it's a pretty
  417. 12:59straightforward workflow overall, but
  418. 13:01it's possible. But we have to think like
  419. 13:03attackers because they're using AI to
  420. 13:05move fast. We need to go through this
  421. 13:06process before they do. And so with
  422. 13:08that, please go and try the skill right
  423. 13:10now on a codebase or maybe even
  424. 13:12multiple. You probably have a lot of
  425. 13:13things that you're working on, and this
  426. 13:14needs to be a part of your process, at
  427. 13:16least something like this, or you're
  428. 13:18leaving yourself open for attacks. And
  429. 13:20again, I will link to the skill in the
  430. 13:22description. So I hope that you found
  431. 13:23that helpful as well as just the
  432. 13:24high-level ideas here around how we need
  433. 13:26to think like attackers so we can defend
  434. 13:28fast with AI. If you found this useful
  435. 13:30and you're looking forward to more
  436. 13:31things on agentic engineering and AI
  437. 13:33security, I would appreciate a like and
  438. 13:35a subscribe. And with that, I will see
  439. 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.