Enjoying this issue?
Get tomorrow's AI & engineering digest in your inbox — hand-picked, summarized, and always spam-free.
TLDR
AI coding agents are being actively targeted by attackers who exploit configuration files, compromised packages, and exposed credentials to inject backdoors and steal API keys. Recent attacks include the compromise of the Microsoft agent framework Python package and attackers modifying Claude Code's settings.json to auto-download malware. The presenter provides an audit skill and recommends setting API key limits and auditing agent configurations to mitigate these risks.
Key points
Attackers modified Claude Code's settings.json to auto-download malware on startup.
The Microsoft agent framework Python package was compromised to steal credentials and tokens.
Credentials stored in plain text in coding agent conversation history and configuration files are a major risk.
LLM jacking involves stealing API keys to scale attacks, with fraudulent charges exceeding $100,000.
The presenter created an audit skill that checks for config hooks, poisoned dependencies, and exposed secrets.
Techniques
- Modifying coding agent configuration files to inject malicious hooks
- Compromising Python packages with startup hooks for credential theft
- Using .env files for credentials and hooks to prevent agent from reading them
- Setting API key usage limits to mitigate LLM jacking
- Auditing agent configuration, dependencies, and secrets
Stop scrolling. Start reading smarter.
Receive the day's most important AI & engineering updates in one concise email. No spam.
Transcript (captions)
Recently, it seems like the world has been falling apart, at least in some ways, with these outages and cyber security attacks. I mean, just look at the last couple of weeks. We started
with the Apple outage and then Cloudflare had some issues and Microsoft had their big outage the very next day and then the airlines go down and then a lot of the major banks have problems and
then in just the last couple of days, the US government confirmed that their crime database was hacked. Now, for a lot of these outages, the parties involved claim they aren't cyber
security attacks. But if you're following all of this, you know that there are too many coincidences here. Now, I'm not trying to say that all these outages are cyber security
attacks. But if you were to claim that most of them are, I probably wouldn't argue with that. There's a good chance. And just in general, it's obvious that malicious attackers throughout the world
are leveraging AI to find exploits faster and to execute them at scale. Now, you might think it's really just up to these larger companies to handle these cyber security threats, and
there's nothing you can do. Hopefully, these companies can use AI to defend faster than the attackers can use AI to attack. But there are a lot of cyber security threats that apply to us
personally and things that we can actually do. And so I want to start making content covering this starting with this video right here. This applies to you if you are an engineer or builder
using coding agents to create anything because there are a lot of attacks that are happening through AI coding assistance right now. And so I want to cover this with you. If you're building
anything, don't skip this. There are things you might even want to change in your setup right now that I'll get into with you. So, what I have for you today is simply two parts. First, I just want
to show you how attackers are able to exploit your AI coding assistant. I'll give you some real examples of some pretty large-scale attacks that have happened recently. And then, of course,
I want to get into solutions with you, at least helping you get started securing your setup and performing an audit. And there's a skill that I created that I'll walk through with you
as well. All right, so let's get into some examples. Starting with a report that Google Threat Intelligence put out just a couple of days ago showing how attackers are using AI for a couple of
different things, including attacking your coding agent directly. So these attackers, they started by creating fraudulent recruiter profiles on professional networking platforms. And
it was confirmed they use LLM to synthesize the deceptive professional identities. Now they started by directing people to fraudulent meeting platforms, so social engineering lures.
But then they switched gears and they started attacking the coding agents directly. What they did is they found a way to change the configuration of organizations coding agents directly
modifying thecloud settings.json file where we have a lot of configuration like hooks for our coding agent and they made it so that when users started up cloud code it would automatically
trigger the download of their backdoor malicious software. I mean that's kind of terrifying. Even the configuration for your coding agent is a target for these attackers. Of course, there are
some solutions that we'll get into for how you can control and monitor what runs with your coding agent. And this is especially something we have to be careful of because of how much autonomy
we give our coding agents. I know I do this myself with the CLI and MCP servers and skills that I give my agent. It's able to do a lot. And so you'll see this as a theme when we go through all these
different vulnerabilities is it's really coming down to the fact that we let our coding agent do a lot. Like another example here and this also happened just last week. The Microsoft agent framework
Python package was compromised. So two versions that were affected and both of them what happened is it installed Python startup hooks that would silently collect credentials, environment data,
cloud identity tokens, all the stuff you never want leaving your machine. And just like the last example, it's something that runs on startup and just happens in the background. You would
never know. And this is dangerous because we let our coding agents handle installing dependencies and upgrading versions. It's one of those things we're really happy to hand over because
otherwise it takes a lot of time for us to be a part of this process manually. The sponsor of today's video is Blacksmith. With coding agents opening up pull requests all day long now, flaky
tests wastes a lot of time. In the last 2 weeks, 35 of my open source project archon's test runs failed. And then I reran them with the exact same commit and they passed. And it really was just
a rerun here, not a fix at all. Blacksmith runs your GitHub actions on their own machines. I installed their GitHub app on a fork of Archon, changed the runs online on our Linux test jobs,
and they just ran about 1.7 times faster in my testing. And Blacksmith indexes the logs from every job it runs, so you can search across all of them at once. The Blacksmith CLI also gives that
search to you and your coding agent directly in your terminal. So, I took all the Archon CLI tests and I ran them 20 times on the same commit and then I gave all that to Claude Code to help me
figure out which tests are flaky using the Blacksmith CLI. It searched the logs across all 20 jobs and found a test that failed in some of them and passed in the rest with nothing changed in between.
Then it pulled the logs from just the failed jobs, found the same error in every one and pointed me to the exact line where the test breaks. So now my coding agent knows exactly which test to
fix. Blacksmith gives every GitHub organization 3,000 free minutes per month, no credit card required. I'll have a link to them in the description. And then speaking of letting our coding
agents do too much, another thing that I see all the time that has led to mass vulnerabilities is giving your credentials directly to coding agents. And this is terrible for two reasons.
The first is that if you actually ever have a credential in the conversation history of a coding agent, that is stored in plain text on your machine. Every coding agent always stores the
conversation history locally, usually in a JSON L file. And that's a big risk because if your machine is ever compromised, it's just more likely they're going to be able to extract
credentials and things when it's just sitting in plain text in a place that's really easy to access. And then the other problem that's probably even more dangerous is your coding agent is
sometimes going to want to use that password in plain text as something like an argument for a command or CLI tool like working with the Postgress database in this example. And the issue here is
when we allow the coding agent to perform that action, it's going to add it to an allow list in your configuration file. Like with cloud code, it's quad settings.local.json.
And so now the password is stored in plain text in yet another place. And usually this is right within your repository. And so if you're not careful, you're also going to commit
this straight to your repository. So now the credential also lives somewhere else on the internet. Now the creator of cloud code, Boris Churnney, he said straight up that your
settings.local.json JSON file should never be pushed to source control. It should be one of those files in your ignore. Hence the name of the extension.local.json.
But even so, people do this all the time. A software security company, Airo, said yesterday 1,122 public copies of that file hold at least one secret through a scan that they did
across thousands of GitHub repositories. And so, yes, you're not supposed to, but that doesn't mean that it doesn't happen accidentally for a lot of people. And you know, if a security company is
scanning thousands of GitHub repositories, attackers are using LLM to do the exact same thing, probably using local and uncensored models to just go all over the internet looking for people
that are making this kind of mistake, just putting their credentials in plain sight. I mean, even Cursor isn't safe. They have one of their access keys that they gave to Fireworks exposed. Even the
largest companies are dealing with these problems. You certainly have to as well, just because of the scale of this problem. It's called LLM jacking. There are millions of agents and scans
happening from attackers all over the world that are looking for exposed keys. And your large language model API keys are really the biggest target. Our LLM tokens really are the hottest commodity
right now. And think about it, if attackers can steal more API keys, that means that they have more funds at their disposal to scale up their scanning and attacks because LLMs really are behind
everything. In some cases, single day fraudulent charges exceeded $100,000. And in the most severe cases, cumulative resource abuse reached $1 million before remediation. And Amazon actually proved
this. They created a bunch of dummy instances in the cloud that were watching for traffic. And they were tracking and seeing that there are thousands of scanners and agents out
there that are constantly pinging everything, trying to find exposed ports and other ways to get in. They are always looking for opportunities to LLM Jack. And once they get an API key, they
will burst you out the wazoo, using that up as much as they possibly can. Okay, so I just dumped a ton of problems on you and it's really good for you to be aware of those things. But let's get
into solutions now. So I have my audit skill that I'll go over at the end of this video, but even just right now, I want to cover the basics. It's really not that complicated to protect
yourselves from these things at a high level. So I will be making more content on security soon, like I said. But here, let's cover the things that are really easy for you to implement right now. So,
first things first, there are some security measures already built into the tools you use, like cloud code. So, if I enter a new cloud code session, it'll warn me if there is a hook that is
configured in mycloud settings.json that is going to run a command without asking. This is that first issue that I mentioned at the very start of the video with having your coding agents run
things on startup using your configuration. And so, if you made this hook or downloaded it and trust it, you're good to continue. But this will help you catch some of those things that
might be injected into your environment without you knowing. And then something you can do yourself even going beyond hooks is once I go into a cloud code session, I can do /h hooks to see all
the hooks that are running and the different events that they're tied to. I can do /mcp to see all the MCP servers that I'm connected to. It's good to do this once in a while because that way
you are surveying your system. you're seeing the things that are actually hooked into your coding agent because if you don't do this kind of audit once in a while, there can be things added into
your configuration that you're never going to know about. So for every single part of your AI layer, like your skills, MCP servers, and hooks, for pretty much every single AI coding assistant,
there's some command to see what is enabled. Like if I do skills, for example, I can do the same thing with all the skills that I have in my environment, which skills themselves are
just instructions, but they also come with scripts. Pretty much anything you can build into an AI coding assistant can have a vulnerability. And then lastly, before I get into the audit
skill, let's talk about LLM jacking. There is a very simple solution to solve this. No matter how careful you are, there's always a risk that you're going to have your API keys for your LLMs
exposed. And the simple solution to mitigate how much damage that does to you is to simply apply limits to every API key that you work with. It doesn't matter if it's just for dev testing or
if it's for a production agent or system. And so, for example, within my open router, I have a bunch of different API keys. And I have weekly limits that are set on all of them. And then for
some of my API keys, I also have permanent limits. Like this key can only ever be used for $50 of tokens. Now, I know a lot of this might seem really simple, like auditing your configuration
and setting limits on your keys. But clearly, people skip out on this all the time, like the studies that we just went over. And so, even if you're familiar with this, at least take it as a call to
action to do an audit right now. it is more important than ever just because of how easy it is for attackers with AI to really scale these exploits and scanning and all the malicious things that they
do. And if you want to go deeper and really do a full audit of your setup and the dependencies for your codebase and things like that, that is why I have the audit config skill. And so I'll link to
this in the description. This is the core resource for this video. If you want to just run this on any repository right now, you can do so in less than 10 minutes. Seriously, it is well worth
your time if right after this video you go and just run this skill quickly on any repository or maybe even multiple. It is going to look through all the things that lead to the problems that I
showed in the case studies earlier like config that runs code at startup poison dependencies secrets that are saved in your local configuration, secrets that are saved in your coding agents
conversation history, fake editor extensions, LLM jacking doors, and then hidden instructions that might be injected in things like your global rules, your claw.md. Now, of course,
there are more vulnerabilities beyond these things, but this is the core list. If you audit this now and you do it once in a while, you are mostly covering your bases using coding agents. These are the
biggest ways that attackers are hijacking thousands of coding agents, maybe even every single day. And so, download the skill.md from the link that I'll have in the description. Bring it
into any codebase and then you can just ask your coding agent to perform an audit or you can do / aagentconfig audit to invoke the skill directly. I've designed it to be fast but also very
comprehensive. Like here for this example, I actually ran it on my Archon codebase. Now, I've run this kind of audit before. I fixed most things and so it flagged a lot of false positives, but
that's good. It shows that it's being very comprehensive, even looking really far in the commit history to see if you have secrets leaked in the git history, for example. But for the most part, this
audit is going to focus on the configuration of your coding agent itself, not necessarily things in the codebase. Like one thing that it'll probably propose if you don't have is a
hook that prevents your coding agent from ever reading yourv file. One of the things we talked about earlier is never giving your credentials directly to a coding agent because that's stored in
local configuration potentially and then definitely your conversation history. And so when we want our coding agent to use a credential, what we should do is we should put it in av file and then
tell the coding agent to leverage the environment variable there without ever actually reading it. And then we use a hook for cloud code, codec, whatever to actually guarantee it can't look in that
file. But yeah, that's just one golden nugget and an example for how this skill can help you fix your coding agent configuration. So please try this skill now. You should be implementing these
things ASAP if you haven't already. And I hope that you found this video useful. I mean, you should implement these things now, of course, but even just knowing the problems that are out there,
the potential vulnerabilities will really help. It's that first step because it kind of gives you that sixth sense of what might go wrong as you're working with your coding agent and
building with it. And of course, like I said, I'm going to have a lot more content on security soon here because it's just more and more important. And so, if you appreciate this video, you're
looking forward to more things on Agentic Engineering and security around our AI tools, I would really appreciate a like and a subscribe. And with that, I will see you in the next video.