LLMjacking: Stolen AI API Keys and a Surprise Bill

A cost alert lands on a Sunday morning, and your first thought is "that's Finance's problem." It isn't. In AI security, a bill is often the only alert you get. Here's how to read it.

LLMjacking is when attackers use stolen API keys to run expensive AI models on someone else's account. The victim pays, and the attackers often resell the access. Treat an AI cost spike as a security alert: split the spend by key, judge each key's behavior, and revoke the one that doesn't fit. Then find out how it leaked.

The alert (Entry)

From the Cyber Blues AI-era Entry track. A budget alert at 06:10 Sunday: $1,940 in 9 hours on an internal project that normally spends $22 a day, still climbing at about $215 an hour.

All of it is on one key, owned by an internal tool retired 3 weeks ago. Its key was never revoked.

What the tool used to doWhat the key is doing now
SourceCompany network37 IPs in 4 countries, proxy and hosting ranges
ModelThe small, cheap oneThe most expensive tier
ClientIts own named clientA generic HTTP library
ContentDocument summariesLong chat and role-play, some flagged by the provider's filter

And 5 days ago, the tool's code repository was made public. Its history includes a .env config file.

Your call: a 60-second check

  1. Is this a billing problem or a security problem?
  2. What's the most likely way the key leaked?
  3. If you revoke this one key, are you done?

The triage

  1. It's a stolen credential. Someone outside holds a working key and is using it right now. Escalate to cloud security and revoke it per your playbook. Prohibited content puts the whole cloud account at risk of suspension, not just the budget.
  2. Most likely the public repo. The timing fits.
  3. No. A .env file rarely holds just one secret. Everything in it should be treated as exposed.

The Mid version: a true story that covers a false one

At Mid level, the weekend AI bill is $41,500 against a normal $600. The research team says, truthfully, "That was our load test, sorry." Split by key:

KeySpendPattern
research-loadtest~$1,500Company IPs, Saturday business hours, benchmarking
svc-legacy-reporting~$40,000Around the clock, ~50 foreign hosting IPs, expensive chat calls, service shut down 2 months ago

The research team's statement is true for their key and their $1,500. It says nothing about the other $40,000. Revoke the legacy key, leave the research key running, and ask which actual spending caps exist, since a budget alert only notifies.

Weak answer vs. strong answer

The answer that loses the interviewThe answer that gets the callback
"The research team confirmed the load test. Spike explained, I'd send the bill to Finance.""Their load test explains $1,500 on their key. The other $40,000 is on a retired service's key, from foreign hosting IPs, around the clock. I'd revoke that key now, keep the research key running, and find out how the old key survived decommissioning."

Mentor note

When one alert contains both a real explanation and an abuse, split it before you believe either. And when a service is retired, ask what happened to its keys.

What would a hiring manager ask?

  • "Why is a cost spike a security alert?"
  • "How do you tell legitimate AI usage from abuse?"
  • "The team said 'that was us.' Why isn't that the end of it?"
  • "Why revoke one key and not all of them?"
  • "What's the root cause, and who should fix it?"

Related reading

More AI-era incidents: shadow AI data leaks and prompt injection. How Cyber Blues approaches agent incidents: investigating an AI agent security incident.

Today's rep

Cyber Blues trains AI-era cases like this next to classic SOC work. Take your first rep free in the Entry courses.

Start the free Entry courses →

FAQ

What is LLMjacking?

The unauthorized use of stolen cloud or AI API credentials to run large language models at the account owner's expense.

How do AI API keys get stolen?

Most often from code repositories, config files, logs or old services whose keys were never revoked.

How do you prevent LLMjacking?

Revoke keys when services are retired, keep secrets out of code, set real per-key quotas or rate limits, and alert on unusual models, sources or usage times.