What Is LLM Jacking? How Attackers Steal and Drain AI API Keys
Stolen LLM API keys are driving six-figure fraud charges. Here's how LLM jacking works and the key limits that stop the bleeding fast.

What is LLM jacking?
LLM jacking is the theft and abuse of API keys for large language models. Attackers scan the internet, GitHub repositories, and exposed configuration files looking for live keys to services like OpenAI, Anthropic, or OpenRouter. Once they find one, they run it as hard as possible, generating massive token usage before the owner notices. The owner gets the bill. In documented cases, single-day fraudulent charges have exceeded $100,000, and cumulative abuse on some stolen keys has reached $1 million before anyone caught it.
TL;DR
- LLM jacking is the practice of stealing LLM API keys and burning through their usage limits for fraudulent or resold access, often before the victim notices anything.
- Stolen keys get hit hard and fast, with single-day fraud charges reported above $100,000 and cumulative abuse hitting $1 million in the worst cases before remediation.
- Cloud providers have confirmed the scale of this with honeypot instances, finding thousands of scanners and bots constantly probing for exposed credentials and open ports.
- A security firm found over 1,100 public GitHub copies of a Claude Code local settings file containing at least one leaked secret, despite that file being explicitly meant to stay out of version control.
- Coding agents increase the risk because they store conversation history in plain text locally and often add used credentials to an allow list in a config file that can end up committed to a repo.
- The most effective, lowest-effort defense is setting spending and rate limits on every API key you create, whether it’s for a quick dev test or a production system.
- Recent incidents, including a compromised Python package from Microsoft’s agent framework and fake recruiter profiles used to plant backdoors in Claude Code configs, show attackers are now targeting the AI tooling layer directly, not just the key itself.
How do attackers actually steal API keys?
The most common route is simple negligence, not sophisticated hacking. Developers paste API keys directly into code, environment files, or chat sessions with coding agents. Those keys then end up in places they were never supposed to be: committed to a public repository, stored in plain text in a local settings file, or sitting in a coding agent’s saved conversation history (most agents log every session to a local JSON or JSONL file by default).
Attackers don’t need to breach a server to find these. They run automated scanners, increasingly powered by LLMs themselves, that crawl GitHub and the open web looking for patterns that match API key formats. A security firm named Aikido scanned public repositories and found more than 1,100 exposed copies of Claude Code’s local settings file containing at least one secret, even though that file is explicitly documented as something that should never be pushed to source control.
It isn’t only small projects making this mistake. Cursor, the AI coding tool company, had one of its own access keys (issued to it by Fireworks) exposed. If a company building AI tools for a living can leak a key, the risk for an individual developer or small team is real.
Why are AI API keys such a valuable target?
Because LLM access is now the fuel behind almost everything attackers want to automate. A stolen key gives someone compute at someone else’s expense, which they can use to run their own tools, resell access to other bad actors, or scale up further attacks and scanning operations. More stolen keys mean more budget to find more stolen keys. It’s a self-funding loop.
Cloud providers have measured this directly. Amazon reportedly set up dummy cloud instances specifically to watch for this kind of activity and confirmed that thousands of automated scanners and agents are constantly probing for exposed ports, credentials, and keys across the internet, around the clock. This isn’t an occasional opportunistic attack. It’s a continuous, industrialized scanning operation looking for any opening.
How does this connect to AI coding agents specifically?
Coding agents widen the attack surface in a few concrete ways. First, if you ever type or paste a credential into a conversation with an agent like Claude Code, that conversation is stored locally in plain text. If your machine is ever compromised separately, that history becomes an easy place to extract credentials from.
Second, when a coding agent uses a credential as part of a command (say, connecting to a database with a password passed as an argument), many tools will add that command to an “allow list” in a local configuration file so it doesn’t have to ask for permission again. That file, often named something like settings.local.json, now has the password sitting in plain text too, and it frequently lives inside the project directory, which makes it easy to accidentally commit to a public repo.
- Name
- Maria Alvarez
- Date of birth
- SSN
- Diagnosis
- Balance due
- $412.80
Third, the configuration layer of coding agents is itself now a target. Security researchers at Google Threat Intelligence documented attackers creating fake recruiter profiles on professional networking sites, using LLMs to make the fake identities convincing, and eventually using that access to modify victims’ Claude Code settings file directly. The tampered config triggered an automatic download of backdoor malware whenever the victim started a coding session. Separately, a compromised version of Microsoft’s agent framework Python package was found installing startup hooks that silently collected credentials, environment data, and cloud identity tokens in the background.
The common thread across all of these: coding agents are given a lot of autonomy (running CLI commands, installing dependencies, executing hooks on startup), and every one of those capabilities is a potential point of compromise.
How do you limit the damage from a leaked key?
The single most effective step is also the simplest: put hard limits on every API key you create. This doesn’t fix the leak itself, but it caps the financial damage if one does happen.
Practical measures include:
- Set spending caps per key. Many providers, including OpenRouter, let you define a permanent dollar limit on an individual key (for example, capping a key at $50 of total usage) so a leak can’t turn into a $100,000 surprise bill.
- Use weekly or rolling usage limits in addition to lifetime caps, so unusual spikes get throttled quickly rather than draining a large balance in hours.
- Never commit local settings files to version control. Files like
settings.local.jsonin Claude Code exist specifically to hold local, machine-specific configuration (including things tied to credentials) and are meant to be excluded via.gitignore. Leaving them out of your ignore file is one of the most common accidental leak paths. - Avoid pasting credentials directly into agent conversations. If a coding agent needs database or service access, prefer environment variables or secret managers it references indirectly rather than raw values typed into chat.
- Periodically audit what’s connected to your agent. Most coding agents expose commands to list active hooks, connected MCP servers, and installed skills. Reviewing these regularly helps catch anything that was added without your knowledge.
Is this something individual developers really need to worry about?
Yes. It’s tempting to assume key theft and large-scale scanning are problems for big companies with large cloud footprints, but the incentive structure works against that assumption. Attackers aren’t targeting you specifically, they’re running automated scanners that don’t care how big your project is. A personal side project with an exposed key is just as easy to find and drain as an enterprise one, and in some ways easier, since smaller projects are less likely to have monitoring or alerts set up. The fact that a security firm found over a thousand leaked secrets in public copies of a single config file shows this is happening at volume, not as rare, targeted incidents.
Frequently Asked Questions
What does “LLM jacking” actually mean?
It refers to attackers obtaining someone else’s LLM API key, usually through leaks, misconfiguration, or exposed files, and using that key for unauthorized, often large-scale usage, leaving the original account holder with the bill.
How much money can a stolen API key actually cost someone?
Documented cases show single-day fraudulent charges exceeding $100,000 on compromised keys, with cumulative abuse reaching as much as $1 million in the most severe cases before the activity was caught and stopped.
Where do most leaked API keys come from?

Remy.
The most common sources are credentials pasted directly into AI coding agent conversations, keys left in local configuration files that get accidentally committed to public repositories, and secrets left in a codebase’s commit history.
Does setting a spending limit on an API key actually stop theft?
No, it doesn’t prevent a key from being stolen, but it caps the financial damage if it is. A key with a hard dollar limit or weekly usage cap can only be abused up to that ceiling before it stops working, rather than running up unlimited charges.
Are coding agents like Claude Code or Cursor inherently less secure?
Not inherently, but their design (storing full conversation history locally, running hooks and MCP servers, installing dependencies autonomously) creates more places where secrets or malicious configuration can hide. The tools themselves often include warnings and audit commands; the risk mostly comes from how they’re configured and used.
