LLM API Key Theft and Abuse in SaaS Integrations
Stolen LLM keys are spending power, and defenses must span the attack chain.

LLM API key theft in SaaS integrations is not just a secret-management problem. It gives attackers spending authority they can sell or use without touching the application again. Closing that exposure calls for defenses along the full attack chain, from leaked credentials and cloud access to theft through the model, access that lasts, and fraudulent use.
Why LLM API keys are not ordinary credentials
Google Threat Intelligence Group and Mandiant reported incidents in 2026 where fraudulent LLM charges were more than $100,000 USD in a single day. Some organizations accumulated seven-figure charges before access was revoked. Unlike cryptojacking, which consumes resources gradually, LLMjacking can produce sharp spikes because frontier model inference is expensive per token.
The credential itself explains much of that risk. A database password or session token usually grants access to something inside an application’s perimeter, while an LLM API key authorizes spending on an external provider’s infrastructure. These keys commonly have broad account or project permissions. They also lack expiry by default. Cloud Security Alliance research shows that credentials leaked years earlier still worked and were still being exploited.
Detection can lag far behind the spending. Fraudulent inference blends into cloud bills with legitimate workloads, leaving consumption invisible until the billing period closes. For a multi-tenant SaaS company proxying AI requests for customers, the exposure is not confined to its bank balance. A compromised key can also threaten customer data confidentiality, making the same secret a financial and data-security liability.
How the underground market turned stolen keys into a scalable business
LLMjacking now has a division of labor between groups that acquire access and operators that turn it into revenue. Exposed credentials can enter that pipeline within hours. Sysdig and Pillar Security Research documented Operation Bizarre Bazaar, spanning December 2025–January 2026, as the first fully attributed LLMjacking campaign with commercial marketplace monetization. Its supply chain combined automated scanning, credential validation, and resale through a dedicated storefront, generating tens of thousands of attack sessions across more than 30 LLM providers in little over a month.
GTIG and Mandiant identified LLM Mixers that “proxy, aggregate, and resell unauthorized LLM access to underground subscribers”. The buyer gets a service that can be used without receiving the stolen key. Operators sell access below legitimate API prices, attracting buyers who may not know or care where it comes from. GTIG observed one actor making more than 500,000 LLM API calls in less than eight hours to power a token routing service.
Validation makes that market efficient and quiet. Attackers send single-token requests, including max_tokens=1, to check that credentials work while staying below volume-anomaly thresholds. By discovery, a victim may face several distinct actors. Microsoft’s investigation of Storm-2139 also described stolen Azure OpenAI Service keys routed through a custom reverse proxy with safety filters bypassed, showing that buyers seek prohibited capabilities as well as cheap access.
The initial access vectors that feed the pipeline
Public repositories provide an automatically refreshed supply of credentials. GTIG and Mandiant observed an actor harvesting exposed corporate LLM API keys from public GitHub repositories at scale. Accidental commits and publicly accessible environment files feed that collection. Revocation does not always follow discovery quickly. In the March 2025 xAI GitHub exposure, an API key remained valid for nearly two months and provided access to at least 60 proprietary LLM models.
GTIG and Mandiant identified IAM credentials, Service Account keys, GitHub Personal Access Tokens, and active session tokens across investigated incidents. UNC6993 used a misconfigured Service Account key to compromise a cloud instance and grant further access to an LLM API. Another actor combined compromised corporate IAM credentials with cloud federation tokens to generate fresh access keys, bypassing MFA requirements. Neither route required stealing an LLM key first.
Phishing can avoid code and configuration altogether. UNC6993 ran a fake application portal that got users to paste raw JSON with an active access token in it. The attacker could use the token without the password or another MFA challenge. In a separate intrusion, an actor combined a stolen Personal Access Token with exploitation of a suspected web application vulnerability in a containerized cloud environment.
Developer tooling creates a further acquisition channel. Malicious JetBrains plugins have stolen AI keys, while browser extensions have captured chatbot conversations. Infostealers can also harvest browser-stored API tokens, and misconfigured cloud storage can expose .env files. These paths cross several trust boundaries. A key can leave through the developer’s workstation, a public archive, or a cloud identity.
What attackers do after they have a foothold: lateral movement and privilege escalation inside cloud environments
GTIG and Mandiant observed multi-region reconnaissance of services and identity policies, repository examination, and access-log review across separate intrusions. Another intrusion involved queries against data-warehouse metadata for database credentials, administrator passwords, and sensitive columns. In containerized environments, attackers cloned repositories to find hardcoded secrets and developer credentials. The first exposed key does not define the compromise’s full scope.
Permissions then determine how far that search can go. Attackers used service accounts that were allowed to create tokens to make temporary credentials for higher-privileged accounts and get to secrets stored in cloud secret managers. Middleware vulnerabilities can widen access too. In LiteLLM, CVE-2026-47101 covered escalation to PROXY_ADMIN through /key/regenerate, while CVE-2026-40217 allowed authenticated users to execute arbitrary host code through bytecode rewriting at /guardrails/test_custom_code.
Server-side request forgery, or SSRF, provides another bridge. CVE-2025-2828 in LangChain’s RequestsToolkit lacked URL restrictions and allowed internal network access. This vulnerability class can let an attacker direct middleware toward cloud metadata endpoints and extract host IAM credentials. A constrained LLM key can become broader cloud access. The service makes the internal request on the attacker’s behalf.
Attackers can then make access independent of the original credential. Observed persistence included unauthorized IAM users and service accounts, administrative policies attached to service roles, and SSH keys inserted into compute instance metadata. One backdoor account posed as an “internal billing optimization utility”. Rotation alone cannot remove those footholds.
How prompt injection and insecure output handling let attackers extract keys through the model itself
Infrastructure is not the only place credentials can escape. An AI integration may put a secret directly into the model’s context, where instructions and data share the same unparameterized input. Prompt injection uses that shared channel to make the model do something outside the task it was given. A public-facing feature can therefore expose a secret without repository or cloud access. The attacker only needs permission to send it messages.
A production customer-support bot illustrates the failure plainly. Its system prompt contained an internal API key, and a prompt-injection attack persuaded it to print the full prompt, including that key. SQL injection defenses use parameterized queries to keep commands apart from content, but natural-language instructions have no equivalent way to keep commands to obey apart from content to process.
When applications insert model output directly into SQL, shell commands, HTML, or URLs without sanitization, attacker-controlled input can reach those downstream systems through the model. The model becomes a confused deputy, using its authority for someone else’s purpose.
What attackers do with keys once they have them: the monetization and abuse spectrum
The simplest outcome is unauthorized inference billed to the victim. Attackers can use it themselves or sell it to paying customers through LLM Mixers, using the enterprise quota as their wholesale stock. The traffic can resemble ordinary model use. Cloud billing dashboards do not distinguish authorized and unauthorized calls to the same endpoint, so a technically valid request can still be fraudulent.
Resale also separates the victim from whoever ultimately uses the service. That buyer may want to do things the provider bans, including using access with safety filters bypassed. The compromised organization remains the key-holder. It bears contractual and potentially legal responsibility for usage, including violations of the provider’s acceptable-use policy.
The more serious escalation is stolen compute used to attack others. CSA’s research describes a June 2026 observation by Sysdig’s Threat Research Team in which an actor connected stolen AI compute directly to an automated offensive pipeline designated VAPT. Its capabilities included service fingerprinting, vulnerability matching, proof-of-concept generation, SQL injection crafting, and privilege escalation. The victim funded the pipeline’s reasoning engine. This was not simply resale or cost-shifting, but stolen access turned into operational attack capability.
Why the standard SaaS secret management posture fails against this threat
Environment variables solve a narrower problem than teams often assume. They can keep a secret out of application source code, but do not protect committed .env files, MCP configuration, inspected container environments, or exposed cloud metadata endpoints. Storage location is not an access boundary. OpenAI’s documentation recommends environment variable storage, but implementing that recommendation does not address these other routes to disclosure.
Default key scope creates a separate mismatch. A key for a customer-facing chatbot may have the same account or project permissions as one used for internal batch processing. The feature boundary does not constrain the credential. Once stolen, that key grants the creator’s access rather than only the authority needed for the original task.
Minimal validation requests can pass below alert thresholds, while a later consumption spike can incur substantial charges before detection. Rotation cuts off one credential while identities planted during lateral movement retain access. Storage, detection, and incident response each need to cover the mechanism they currently miss.
Existing identity and access management frameworks have no native concept of an “agent session” or “agent scope” for autonomous software making calls across providers. Meanwhile, prompt injection comes through an interface that is open to the public by design. A secret manager cannot prevent disclosure once a credential has been placed in model context and the model can be induced to print it. The missing boundary is around what the agent can access and authorize.
What closing the LLM API key exposure actually requires
Issue separate keys per service, workload, or environment, and limit their scope so that chatbot and batch-processing access are not interchangeable. Apply short expiry where providers support it. Treat indefinite keys as liabilities requiring compensating controls, and put LLM credentials on the same rotation and audit cadence as cloud IAM keys.
At the storage layer, scan every commit and pull request for secrets, and scan repository history retroactively. Make sure the scans cover MCP configuration and .env files. Deletion does not erase an exposed credential. Treat external crawls and archived repositories as permanent records, and rotate keys even when their public exposure was brief.
At runtime, monitor inference volume per key. Add detection rules that look for credential-validation sweeps with large numbers of minimal-token requests. After an incident, monitor for new IAM users, service accounts, and SSH keys that could preserve attacker access. For agents, reduce authority and enforce authorization outside the model. A prompt must not decide whether an action is permitted.
Independent testing must cover both the integration and web endpoints. Test prompt injection against the deployed model and its system prompt, including any credentials in context. Use whitebox penetration testing of integration code and cloud configuration to examine SSRF paths in LLM middleware, toolkits, and MCP servers. Include middleware routing and the runtime’s cloud identity in scope. Require working exploits that show what an attack can do, rather than reports that list only possible weaknesses or OWASP categories.
Point-in-time testing also needs a continuous counterpart. Pull-request scanning should check for secrets that have been added, new SSRF sinks in AI middleware configuration, and changes to the scope of agent permissions. The exposure window is measured in hours.
Sources
- The Rise of LLMJacking: How Threat Actors Monetize Compromised Cloud and Model Resources
- LLMjacking Evolved: Stolen AI Compute as Offensive Infrastructure
- LLMjacking 2026: How Attackers Are Costing Enterprises $1M in Cloud AI Charges
- LLMjacking 2026: How Cybercriminals Are Reselling Stolen Cloud AI Access
- LLMjacking Evolves: Stolen AI Compute as Attack Infrastructure


