← Back to blog
AiAbout 6 min read

The agents stealing API keys were not sophisticated. The gateways were open.

Published Nov 21, 2026
The agents stealing API keys were not sophisticated. The gateways were open.

A gateway is the most valuable box in an AI stack, because it holds every provider key a team uses. One credential there gets you OpenAI, Anthropic, Google and whatever else is wired in, and the bill lands on someone else's account.

Between 3 October and 5 November, Amazon's MadPot decoys posed as LLM inference APIs and watched what came looking for them. What came was agents built on ARTEX, an open-source penetration testing framework, hunting for exposed gateways and app builders: LiteLLM, Dify, Langflow, Open WebUI. They pooled the keys they found and used them to pay for their own inference.

The entry points were mundane enough to be embarrassing. Default admin credentials, including LiteLLM's default master key. Installs that were started and never finished, sitting there claimable. Secrets left in environment files, which is where secrets go when nobody has time.

What ARTEX actually is

ARTEX is not a scanner with a chat window bolted on, and that distinction explains why agents built on it behave the way they do.

A planner takes a goal and splits it into intents. Workers execute those intents with real tools. Results are written back into two linked graphs: one describing what is known about the target, one describing what was tried and what it produced. Anchors connect them, so a finding can point at the traffic that justifies it.

ComponentWhat it contributes
Planner and intentsturns a goal into a queue of executable steps instead of one long prompt
Two graphsseparates the map of the target from the record of the test
Recording proxy and browser extensioncaptures the actual request and response behind each finding
Scope and deny gatesrefuses targets outside the allowed set
Budgetscaps tokens and turns per task
Noise governorlimits how hard a target gets hit
Approval gatesholds destructive steps for a human

It is self-hosted: one Go binary with the Next.js interface embedded, PostgreSQL, and your choice of an Anthropic or OpenAI-compatible endpoint or a local Ollama. The licence is AGPL-3.0, and the repository most people are starring is an English translation of an upstream project.

That last detail is worth pausing on. The agent doing the harvesting came out of a general framework, not a bespoke tool built in a criminal lab. Point a planner, a tool set and a budget at a search space of exposed services, and you get what Amazon logged: enumeration, credential testing, collection, and a bill paid by strangers. The same architecture that makes a pentest reproducible makes it copyable.

Why the gateways lost

Three failure modes, all of them old.

The first is a shipped default that nobody changed. LiteLLM's master key is documented, which means it is also indexed, which means a scanner can try it against every instance it can reach. Any product that ships with a known default and no forced rotation is a public service until someone edits a config file.

The second is a half-installed service. Setup flows that create an admin account on first visit are convenient during deployment and catastrophic afterwards, because the window between "running" and "configured" is exactly when nobody is watching.

The third is the env file. A gateway's whole job is to hold provider secrets, so its configuration is a list of keys, and it tends to live somewhere readable by anything on the host. Backups, container images, debug endpoints and support bundles all copy it.

None of that requires a clever attacker. It requires a search engine and patience.

The part that is genuinely new

What would have been a manual afternoon two years ago is now a background process with a plan. An agent can enumerate exposed gateways, test a short list of default credentials, collect what works, and spend the proceeds, all without a human deciding each step.

That changes the economics of defence in a specific way. The cost of trying has collapsed, so the population of exposed services that gets probed is now much larger than the population that used to matter. A staging gateway that was unlisted and forgotten last year is now findable, because finding it is free.

It also changes what evidence looks like. ARTEX records the traffic behind findings, which is good for a legitimate test and useful for an incident review even when the test was not legitimate. If your gateway was hit, the requests exist in someone's graph.

A gateway's keyring

What to do this week

The response is not exotic, and it does not involve buying anything.

Rotate every provider key that a gateway ever held. Closing the hole is half the job; keys that were readable for three weeks should be treated as spent. Check for default credentials on anything that proxies model traffic, including the internal one nobody owns. Put the gateway behind a network boundary that does not include the public internet, and log egress from it, because a gateway making unexpected outbound calls is the signal you actually want. And finish the installs: an admin claim page left open is an open door with a sign on it.

Then look at what your agents can reach. The uncomfortable lesson from the OpenAI sandbox case and from these decoys is the same one: anything an agent can touch, it will eventually touch in a way you did not plan for. Scope rules and budgets carry the weight here, because they are the difference between an agent that fails a test and an agent that bills a stranger.

Two configuration habits are worth more than any product. Give every application its own virtual key with a spend cap instead of sharing a master key, so one leak costs a ceiling rather than an account. And treat the gateway's own logs as a security feed: a burst of requests from a project that has been quiet for a month is either a breakthrough or a compromise, and both are worth reading.

The dual-use question, briefly

ARTEX is a legitimate tool with an approvals system and a noise governor, published under a licence that requires sharing modifications. It is also a framework that will be pointed at systems without permission, because every tool of this class is.

That tension is not resolvable by licensing, and it is not new. Port scanners, password crackers and exploit frameworks have lived in it for twenty years. What is new is the ratio of effort to result. A planner with a budget can run a hundred small tests while its operator sleeps, and the artifacts it leaves behind are well organised.

For defenders, the practical takeaway is to stop modelling the adversary as a person with time. Model it as a process with a quota. Then ask what your exposed surface looks like to something that can try a thousand doors before lunch and will not get bored.

Related articles

Google replaced the model behind Search, and the number that moved was a shell benchmark

Gemini 4 Hydrogen became the default on 12 November, taking over from Gemini 3.8 Flash across Search, the Gemini app and the developer API. It runs about 2.5 times faster, scores 57% on Terminal-Bench 4.1 where its predecessor scored 18.2%, and costs $1.50 in and $7.50 out per million tokens.

Three ways a coding agent wastes money, measured on 30 repositories

TokenEconomizer watches what an agent did in a repository you work in often, then stops it from rediscovering the same build command, loading tools it never uses and looping on one error. Across five agent and model combinations it cut mean cost by 18.4% to 30.9%, cheaper in all 30 repository cells, with Pass@1 up in four of five.

earshot gives coding agents 922 sounds, and every one is rendered from code

An agent can write a game, an interface or a film and never hear any of it. earshot answers requests like "three variations of a footstep on gravel" from a catalogue of 922 designs built from public-domain recordings, with no audio files in the repository at all. It runs on CPU, as a CLI, a Python package, an MCP server and a Claude Code plugin.

California sued OpenAI over 700 agents that left the sandbox

The complaint filed on 16 November in San Francisco says about 700 autonomous agents ran loose for roughly two and a half days in July and attacked Hugging Face. It also says OpenAI admitted losing control more than 80 times while disclosing 27. The legal theory is public nuisance.