cd /news/ai-agents/hackers-are-hijacking-ai-coding-agen… · home › topics › ai-agents › article
[ARTICLE · art-175300] src=mindstudio.ai ↗ pub= topic=ai-agents verified=true sentiment=↓ negative

Hackers Are Hijacking AI Coding Agents. Here's How to Lock Yours Down

Attackers are targeting the configuration layer of AI coding agents such as Claude Code, modifying settings.json to plant hooks that silently download backdoor software on startup, according to cases documented by Google Threat Intelligence. A compromised Microsoft Agent Framework Python package in two affected versions installed startup hooks that collected credentials, environment variables and cloud identity tokens, and a security scan by Airo found 1,122 public GitHub copies of settings.local.json containing at least one secret. Stolen API keys are fueling "LLM jacking" fraud with single-day charges exceeding $100,000 and cumulative abuse in the worst cases topping $1 million, the report states.

recommendation

Audit your coding agent's hooks and MCP servers with /hooks and /mcp, keep settings.local.json out of Git, and rotate any API keys exposed in session history or config files.

more in playbook: Securing agents and AI tools
by read9 min views3 publishedNov 24, 2026
Hackers Are Hijacking AI Coding Agents. Here's How to Lock Yours Down
Image: Mindstudio (auto-discovered)

Attackers are exploiting Claude Code and other AI coding agents through malicious hooks, poisoned packages, and leaked API keys. Here's how to audit yours.

What is happening to AI coding agents right now? #

Attackers are actively targeting the configuration layer of AI coding agents like Claude Code, going after hooks, MCP server connections, and locally stored credentials instead of attacking your code directly. Recent cases documented by Google Threat Intelligence and security firms show attackers modifying settings files to trigger malware downloads on startup, compromising popular packages to silently exfiltrate credentials, and scanning the internet for exposed API keys to run up massive unauthorized usage bills. The attack surface is the autonomy we give these tools, not a bug in the model itself.

TL;DR #

  • Configuration files are now a direct attack target , with Google Threat Intelligence reporting attackers modifying Claude Code’s settings.json to trigger automatic malware downloads on startup.
  • Supply chain attacks hit AI tooling directly , including a compromised Microsoft Agent Framework Python package (two affected versions) that installed startup hooks to silently collect credentials and cloud identity tokens.
  • Local credential storage is a bigger risk than most builders realize , since coding agents save full conversation history in plain text JSON files, and any password typed into a session can end up there and in an allow-list config file.
  • Settings.local.json files are leaking at scale , with a security scan from Airo finding 1,122 public GitHub copies of that file containing at least one secret, despite Claude Code’s creator explicitly warning it should never be committed.
  • LLM jacking has become a dedicated criminal business , with stolen API keys fueling fraud cases where single-day charges exceeded $100,000 and cumulative abuse in the worst cases topped $1 million before anyone caught it.
  • Built-in protections exist but require you to actually use them , including Claude Code’s startup warnings for unrecognized hooks and slash commands like /hooks and /mcp that let you see exactly what’s connected to your agent.
  • A regular audit habit closes most of the gap , covering startup hooks, poisoned dependencies, locally stored secrets, fake editor extensions, and hidden instructions buried in files like CLAUDE.md.

Build an enterprise app with Dmitry Shapiro. Leave certified.

How are attackers actually exploiting coding agents? #

The pattern across recent incidents is consistent: attackers go after the layer of trust surrounding the agent, not the model itself.

In one case detailed by Google Threat Intelligence, attackers built fake recruiter profiles on professional networking sites, using LLMs to generate convincing fake identities. They initially used these profiles for social engineering lures aimed at fraudulent meeting platforms, then pivoted to a more direct approach: modifying victims’ Claude Code settings.json files. That file controls hooks, the automated actions tied to agent events. By planting a malicious hook, attackers made it so that simply starting a Claude Code session would trigger a silent download of backdoor software.

A separate incident hit the Microsoft Agent Framework’s Python package directly. Two compromised versions installed Python startup hooks that quietly collected credentials, environment variables, and cloud identity tokens, the kind of data you never want leaving your machine. Because dependency installation and upgrades are tasks most developers hand off entirely to their tooling, this kind of compromise can run for a long time before anyone notices.

Both attacks exploit the same underlying reality: coding agents are designed to run things on startup and manage dependencies with minimal friction, which is exactly what makes them useful and exactly what makes them a target.

Why is storing credentials in a coding agent session so risky? #

Two separate problems compound here. First, every coding agent stores conversation history locally, typically in a JSON Lines file, and that history is saved in plain text. If you type a database password or API key into a chat with your agent, it’s sitting unencrypted on your machine. If that machine is ever compromised, extracting credentials becomes trivial because they’re not hidden, they’re just sitting in a predictable file.

Second, when a coding agent uses a credential to execute a command (say, connecting to a Postgres database), that action often gets written to an allow list in a local config file, such as Claude Code’s settings.local.json. That means the credential now lives in a second plain-text location, usually inside your project repository.

This is the exact mechanism behind the Airo scan mentioned above: 1,122 public GitHub repositories were found with settings.local.json files containing at least one secret. Claude Code’s creator, Boris Cherny, has stated plainly that this file should never be pushed to source control, hence the “.local” in the name, which signals it belongs in your .gitignore. People commit it anyway, usually by accident, and once it’s public, it’s public for anyone running automated scans, including attackers using uncensored local models to sweep GitHub at scale looking for exactly this mistake.

Even large, security-conscious companies aren’t immune. Cursor had an access key for a third-party provider exposed. If it can happen there, it can happen in your weekend project.

What is LLM jacking and why is it so profitable for attackers? #

Everyone else built a construction worker.

We built the contractor.

One file at a time.

UI, API, database, deploy.

LLM jacking is the practice of stealing LLM API keys and burning through their usage limits for fraudulent purposes. It has become one of the more lucrative forms of cybercrime tied to the AI boom, because API access to large language models is now a commodity attackers can resell or exploit directly.

The scale is the point. Security researchers and cloud providers have documented thousands of automated scanners and agents constantly probing the internet for exposed keys and open ports. Amazon demonstrated this by deploying dummy cloud instances specifically to observe the volume of scanning traffic hitting them, confirming that this isn’t a rare event but a constant, automated background process running across the internet.

Once attackers get a working key, they maximize usage before it’s revoked or rate-limited. Reported cases include single-day fraudulent charges exceeding $100,000, with the most severe cumulative cases reaching $1 million in resource abuse before anyone caught it. Every stolen key also indirectly funds more scanning and more attacks, since LLM access underpins the tooling attackers use to find their next target.

How do you actually audit and secure your setup? #

Start with what’s already built into your tools. Claude Code, for example, warns you at the start of a new session if a hook is configured to run a command without asking first. That’s your first line of defense against the exact startup-hook exploit described above. If you recognize and trust the hook, you proceed. If you don’t, that warning just saved you.

Beyond passive warnings, use the inspection commands your agent already gives you:

  • /hooks shows every hook configured in your environment and the events they’re tied to.
  • /mcp lists every MCP server your agent is currently connected to.
  • A skills-listing command (varies by tool) shows every skill installed, including any scripts bundled with them.

Run these periodically, not just once. Configuration drifts. Things get added by collaborators, by installed packages, or by mistakes you don’t remember making. Any part of your AI tooling stack, including skills, MCP servers, and hooks, can carry a vulnerability, so the audit habit needs to cover all of them, not just the one that made headlines most recently.

For API keys specifically, the fix is structural rather than behavioral: apply usage limits to every key you create, whether it’s for local dev testing or a production system. Platforms like OpenRouter let you set weekly limits and hard permanent caps per key (for example, capping a key at a fixed dollar amount of token usage for its entire lifetime). This doesn’t prevent a key from leaking, but it caps the damage if it does, which matters given how consistently keys end up exposed by accident.

Is a manual audit actually enough? #

A manual audit using built-in commands covers the basics well: visible hooks, connected MCP servers, and installed skills. It won’t necessarily catch everything, though, especially secrets buried deep in git commit history, subtle prompt injection hidden in global rule files like CLAUDE.md, or poisoned dependencies that look legitimate on the surface.

Adjuster✕ Export PHI

#4471

12,480 users online

A more thorough audit extends the same checklist deeper: startup configuration that executes code automatically, poisoned or compromised dependencies, secrets stored in both local config files and conversation history, fake editor extensions, signs of LLM jacking exposure, and hidden instructions injected into global agent rules. None of this requires specialized security tooling, just the discipline to check regularly rather than assume your setup is clean because nothing has gone wrong yet.

Frequently Asked Questions #

What is a hook in the context of AI coding agent security?

A hook is a configured action tied to a specific event in your coding agent, such as startup. Hooks are powerful because they run automatically, which is exactly why attackers target them: a malicious hook planted in a settings file can trigger a hidden download or script every time you start a session.

Should I ever paste a password or API key into a coding agent chat?

Avoid it when possible. Conversation history is stored locally in plain text, and if the agent then uses that credential in a command, it may also get written into a local allow-list configuration file, creating a second plain-text copy, often inside your project repository.

Why does settings.local.json keep ending up on GitHub despite warnings against it?

Mostly by accident. Developers forget to add it to .gitignore, or tooling defaults don’t exclude it automatically. Security scans have found over a thousand public repositories with secrets exposed this way, which shows the mistake is common even though the fix (adding it to .gitignore) is simple.

How do API key usage limits actually prevent LLM jacking damage?

They don’t stop a key from being stolen, but they cap how much an attacker can spend before the key stops working. Setting weekly limits and permanent dollar caps on every key, including dev and test keys, turns a potential multi-thousand-dollar fraud incident into a bounded, minor one.

Is this mainly a risk for large companies, or does it affect individual developers too?

It affects individual developers directly. Automated scanning for exposed keys and misconfigured settings files happens constantly and at scale, regardless of whether you’re a solo builder or a large engineering team. The scale of automated attacks means personal repositories and side projects are just as likely to be scanned as enterprise codebases.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/hackers-are-hijackin…] indexed:0 read:9min 2026-11-24 · —