How to Detect and Stop LLMjacking Attacks Draining Your Cloud AI Budget
LLMjacking is the fastest-growing cloud attack of 2026: attackers steal exposed API keys and resell your LLM capacity to third parties, and some organizations are burning over $100,000 per day in fraudulent AI charges. The fix is not a single setting — it’s a five-layer defense covering key rotation, spend alarms, model access controls, and anomaly detection. Below is the exact playbook to run today, in order of urgency.
Step-by-Step Guide to Stopping LLMjacking
Step 1: Rotate every LLM API key and credential (do this first)
Assume compromise until proven otherwise. Attackers harvest keys from public GitHub repos, leaked .env files, browser extensions, and compromised CI/CD secrets.
- Revoke all keys for OpenAI, Anthropic, Google Vertex AI, AWS Bedrock, and Azure OpenAI.
- Reissue keys scoped to a single application and environment (dev/staging/prod never share a key).
- Store them in a secrets manager (AWS Secrets Manager, GCP Secret Manager, HashiCorp Vault) — never in code or chat.
- Set expiry: 30–90 days for production keys, 24 hours for CI tokens.
- Run
gitleaks detector GitHub secret scanning across all repos to catch lingering leaks.
Step 2: Set hard spend caps and budget alarms
Cloud providers give you the kill switch — most teams just never arm it.
| Provider | Control | Recommended Setting |
|---|---|---|
| AWS Bedrock | AWS Budgets + CloudWatch alarm | Alert at 50% of daily baseline, auto-SNS at 80% |
| OpenAI | Usage limits per project | Hard cap at 2x expected daily spend |
| Anthropic | Workspace spend limits | Per-key monthly ceiling |
| Google Vertex AI | Quotas + budget alerts | Per-project token quota per minute |
| Azure OpenAI | Cost Management budgets | Alert + Logic App auto-disable on breach |
Critical: configure an automated action (Lambda, Cloud Function, or Logic App) that disables the API key or model access when the alarm fires — not just sends an email.
Step 3: Lock down model access with least privilege
LLMjacking works because a stolen key often has access to every model, including expensive frontier models. Restrict it:
- Use IAM policies (AWS) or service accounts (GCP) that allow only the specific model IDs your app calls.
- Deny access to high-cost models (e.g., GPT-4-class, Claude Opus-class) from any key not explicitly whitelisted.
- Enforce per-key rate limits: 60 requests/minute and token-per-minute ceilings matched to real traffic.
- Enable CloudTrail / Cloud Audit Logs for every inference call and ship them to a SIEM.
Step 4: Deploy anomaly detection on token usage
Baseline your normal usage for 7 days, then alert on:
- Token volume spikes above 3x the rolling 24-hour average.
- New IP ranges or geographies calling your API (attackers resell access globally).
- Off-hours bursts — 2 a.m. traffic from a key used only by a US business-hours app.
- Model switching — a key suddenly calling a model it never touched before.
Tools that do this out of the box: AWS GuardDuty (with Bedrock protection), Datadog LLM Observability, and Cloudflare AI Gateway.
Step 5: Add a gateway in front of every LLM call
Route inference through an AI gateway (LiteLLM, Cloudflare AI Gateway, or Kong AI Gateway) to get centralized logging, per-user rate limits, request signing, and instant key revocation. This single hop turns a 2-hour incident response into a 30-second key disable.
Common Issues, Alternatives, and What You Should Know
“We already have budget alerts.” Alerts without automated response are useless at $100K/day — that’s $4,166 per hour. By the time a human reads the email, the damage is done. Automate the kill switch.
Attacker economics: LLMjacking crews resell stolen inference access on underground markets at 20–40% below retail. They prefer keys with no spend limits and broad model access — the exact defaults most teams leave in place.
Shared responsibility gap: Cloud providers bill you for valid-key usage regardless of who made the request. There is no chargeback. Your only defense is prevention and fast detection.
Alternative mitigations if you can’t rotate immediately:
- Put a WAF rule blocking non-allowlisted IPs from hitting your inference endpoints.
- Temporarily downgrade all keys to a cheap model tier to cap blast radius.
- Enable MFA-delete on cloud accounts so attackers can’t cover tracks by deleting logs.
Insurance angle: Some cyber insurance policies now exclude “unauthorized compute usage” — check your policy and document your controls to stay covered.
Frequently Asked Questions (FAQ)
What is LLMjacking in simple terms?
LLMjacking is when attackers steal your cloud AI API keys and use your account to run large language model inference for their own profit, sticking you with the bill. Some victims report losses exceeding $100,000 per day.
How do I know if my cloud AI account is being LLMjacked?
Look for sudden token usage spikes, inference calls from unfamiliar IPs or countries, off-hours traffic, and new model IDs appearing in your logs. Check CloudTrail, Cloud Audit Logs, and provider usage dashboards daily during an active threat period.
Can I get a refund from AWS, Google, or OpenAI for LLMjacking charges?
Generally no — providers bill for valid-key usage. Some have issued goodwill credits on a case-by-case basis, but you should not count on it. Prevention via spend caps and key scoping is the only reliable protection.
How much does LLMjacking cost victims per day?
Reported losses range from a few thousand dollars to over $100,000 per day for organizations with unrestricted frontier-model access. The cost scales with the model tier and rate limits your key allows.
Final Verdict
Treat LLMjacking like ransomware prevention: assume you’re a target and build the controls before the incident. Today’s priority order is rotate keys → set automated spend kill switches → scope model access → deploy usage anomaly alerts. If you only do one thing, wire your budget alarm to an automated key-disable action — that single change converts a six-figure loss into a five-minute blip. Teams running production LLM workloads in 2026 should also budget for an AI gateway; it’s the cheapest insurance you’ll ever buy.