API Keys: Bearer Credentials for AI Services, and Why Gateways That Store Them Became Targets

An API key is a secret string that lets software call a service on its holder's behalf. A November 2026 Amazon report describes AI agents hunting for such keys in exposed LLM gateways and app builders.

Created 2026-11-16 Last reviewed 2026-11-16

What it is

An API key is a secret string that a program sends along with each request to a service, such as a model provider’s inference endpoint. The service treats the key as proof that the caller is entitled to use the account it belongs to. Google’s documentation describes keys as credentials “sent alongside requests” and as “bearer credentials”, meaning that whoever holds the key can use it. A key is not tied to a person’s login or to a particular machine. A copy in the wrong hands works as well as the original.

That design is simple, which explains its popularity, and it is also the source of its weakness. Google’s guidance warns that keys travel with requests and “might be exposed or logged”. It also warns that public exposure “can lead to unexpected charges on your account or unauthorized access to your data”. For most Google APIs it recommends against using these keys in production, and points instead to IAM policies and short-lived service-account credentials. The Gemini API is the stated exception.

The standard advice from OWASP’s Secrets Management Cheat Sheet and from Google is consistent. Keep keys out of source code and repositories, restrict each key to the narrowest permissions it needs, rotate keys regularly so a stolen one works only briefly, delete unused ones, and monitor usage. OWASP notes that many organisations still hardcode secrets in plaintext in source code. It also notes that when services share one secret, tracing the source of a leak becomes hard. It gives no API-key-specific rotation schedule, only general lifecycle rules.

Why it matters for AI governance and narratives

In AI services, an API key is also a spending instrument. A model provider’s key pays for inference. Amazon’s report says the agents it observed used stolen keys to fund the inference that powered further key hunting. A leaked key can therefore cost the owner money, and it can also supply compute to whoever finds it.

The AI gateway layer concentrates this risk. A gateway such as LiteLLM routes requests to several model providers, and an app builder such as Dify stores provider keys so that the applications built on it can call models. One misconfigured instance can hold keys for many providers. The editorial passage cited here concerns this pattern: tools that hold keys, exposed to the internet with default or absent protections.

For narrative analysis, the episode sits between two framings. One treats AI-enabled attacks as a new category of threat. The other treats them as old failures (default passwords, exposed admin panels) carried out at greater speed. Amazon’s own mitigation advice leans toward the second. It says to fix the basics first, remove default credentials, require authentication on AI interfaces, and treat gateways and inference endpoints like any other production system. Readers should also note the evidentiary limit. The account of what the agents achieved comes largely from the agents’ own records, and Amazon says it cannot verify those outcomes.

Key facts and dates

Amazon Threat Intelligence published its findings on the AWS Security Blog on 13 November 2026. The company’s MadPot decoy sensors, presented as popular LLM inference APIs, received requests from agents between 3 October and 5 November 2026. Those requests included the agents’ own records of their campaigns. Amazon assessed with moderate confidence that the agents ran on ARTEX, an open-source AI penetration-testing tool, and that the operators were separate China-nexus groups, citing language, time-zone settings, targeting and tooling. Amazon notified AWS customers who may have been affected.

The Hacker News, summarising the report on 16 November, lists the targets as LLM gateways (LiteLLM, One API, New API, Veloera, Sub2API) and app builders (Dify, FastGPT, Langflow, RAGFlow, Open WebUI, LobeChat, Ollama). The listed methods include default admin credentials such as LiteLLM’s default master key, unfinished installs, known software flaws, unauthenticated management endpoints, and server-side request forgery to reach cloud metadata. Amazon’s post also describes a separate campaign using deepfakes to defeat identity checks at cryptocurrency exchanges. Amazon’s wording on verification is: it “did not observe that activity as it happened and cannot verify the outcomes the agents reported”.

The sourcing has limits. Some secondary outlets state more strongly that keys were extracted and validated. We could rely only on Amazon’s post and The Hacker News’s summary of it for this explainer, and both are more cautious. Whether any specific provider key was actually stolen is not established in the primary source.

Where to learn more

Sources

Primary source: the organisation whose decoy sensors captured the records, with its own confidence statements and verification caveat.
Reputable security trade press; lists targets and methods, and repeats Amazon's verification caveat.
Official documentation from a major API provider; describes keys as bearer credentials and sets out their risks.
Standards-community guidance on storing, rotating and limiting secrets including API keys.
Referenced in: Editorial No. 444