Amazon’s threat intelligence team watched AI agents attack its decoy servers for six weeks and then publish their own homework. The agents hunted for internet-exposed AI apps like LiteLLM, One API and Dify, pulled out the AI provider API keys stored inside, checked that the keys worked and pooled them for reuse. The stolen keys were then used to run the very AI models that powered the search for more keys. Amazon published the findings this week. Here is how the campaign works and what teams running self-hosted AI tools should do about it.
What Amazon Found
Amazon’s MadPot network is a set of decoy servers that pose as popular LLM services. From 3 October to late last week, the attacking agents sent MadPot requests that often carried the campaign’s full history, including the operators’ instructions and the agents’ reported findings. That is unusual. It means Amazon got a record of the attack playbook as the attackers wrote it.
The team says it cannot verify what the agents reported doing on systems MadPot does not watch, but the records show what the actors were pursuing. Amazon assessed with moderate confidence that the operators were separate China-linked groups, citing Simplified Chinese prompts and China time zone settings among the evidence. It also assessed, again with moderate confidence, that the agents ran on ARTEX, an open-source AI tool for penetration testing.
How the AI Agent Attacks Work
The attack chain is agent-orchestrated rather than hands-on-keyboard:
- An operator gives ARTEX a target and a goal. The goals in the captured records were things like extracting provider keys from exposed AI apps.
- A planner agent splits the goal into tasks. Worker agents then run security tools against each task.
- The agents consult a large language model between steps. Each next move is decided by sending the work so far to an LLM.
- Found keys are verified and pooled. Working provider keys were added to a shared pool and used to fund further model calls, meaning stolen keys bankroll the next wave of the attack.
The targets are apps that hold keys for many providers at once, because one weak admin page there can expose many accounts at the same time.
What Was in the Playbook
The captured records include a playbook of known entry points for each targeted product. The main entries:
- Default administrator credentials, such as LiteLLM’s default master key
- Unfinished installs that an outsider could take over
- Known flaws in Langflow and RAGFlow
- An authentication bypass through the isCliRequest header in One API family systems
- Server-side request forgery through URL-fetch features to reach cloud metadata services
- Secrets left in client-side JavaScript, source maps, debug routes and environment files
The named product list reads like a who’s who of self-hosted AI tooling. LLM gateways and proxies: One API, New API, Veloera, Sub2API and LiteLLM. AI app builders: Dify, FastGPT, Langflow, RAGFlow, Open WebUI, LobeChat and Ollama. If your team runs any of these on a public IP, this campaign is aimed at you.
Where the Keys Leak From
Beyond live apps, the agents hunted for leaked keys in a long list of places:
- Internet scanning services and certificate transparency logs
- GitHub repositories and event archives
- npm and PyPI packages
- Container image layers
- Notebooks and model-hosting spaces
- Paste sites
When the agents found cloud credentials, they went after managed services that host AI models, secret stores and application identities, prioritising premium AI models over general cloud access. In other words, an OpenAI or Anthropic key was worth more to them than a random compute account.
The Cloudflare Case: A Stolen CI/CD Token
In a separate incident reported the same week, Cloudflare’s incident responders saw ARTEX gain access to a compromised API token that had been used for CI/CD. The token had no IP restrictions and no rate limiting. What followed was roughly 400 database dump requests in one hour. Cloudflare has not said whether those requests returned data.
That case shows the blast radius of one leaked token. It was not a user password or a phishing victim. It was a machine token with no guardrails, and an agent-driven campaign used it at machine speed.

Why Agent-Driven Attacks Change the Math
Older campaigns moved at human speed. An operator scanned, tried one exploit, checked the result and moved on. This one runs on agents that can work through an entire playbook of entry points in a single sitting and never get tired of trying the next default credential. The Cloudflare case puts numbers on it: 400 database dump requests in one hour from a single stolen token. Defences that assume a slow, careful attacker are the wrong shape for this.
There is also a compounding effect. Because stolen keys pay for the AI calls that drive the next round of scanning, every leaked key makes the campaign cheaper to run. A team that leaves one LiteLLM master key on a public IP is not just risking its own accounts. Its key becomes part of the fuel budget for scanning everyone else.
Amazon’s write-up is also a reminder that the attackers’ tools are public. ARTEX is open source, the playbook is a list of documented product weaknesses, and the scanning services the agents used are available to anyone. The only new ingredient here is the automation.
If you suspect a key has already leaked, speed matters more than process. Rotate the key first and audit its usage logs second. Providers like OpenAI and Anthropic show per-key request history, so unusual regions or model calls are visible. Revoke, issue a fresh key with a tight budget cap, then work out what the old key could reach.
How to Defend Your AI Stack
- Change default keys on day one. LiteLLM’s default master key is literally in the attacker playbook. Same for any admin credential that ships with a product.
- Do not expose AI apps to the open internet. Put gateways, Dify, Langflow, Ollama and similar tools behind a VPN or at least IP allowlists and authentication in front of the app.
- Finish your installs. Half-configured deployments with placeholder secrets were an explicit target class.
- Patch Langflow and RAGFlow and audit the One API isCliRequest header behaviour on any fork you run.
- Lock down CI/CD tokens. Add IP restrictions and rate limits. Rotate anything that has ever touched a public repository.
- Scan for leaks continuously. GitHub secret scanning, package audits and checking container image layers for baked-in keys closes the discovery paths the agents used.
- Watch for SSRF patterns in URL-fetch features, especially anything that can reach cloud metadata endpoints.
- Assume agent-speed attackers. Rate limits, anomaly alerts on key usage and short-lived credentials are what slow down a campaign that can fire 400 requests an hour.
Which AI apps were targeted in the Amazon AI agent campaign?
The records name LLM gateways and proxies like One API, New API, Veloera, Sub2API and LiteLLM, plus AI app builders like Dify, FastGPT, Langflow, RAGFlow, Open WebUI, LobeChat and Ollama. The attackers hunted internet-exposed instances for stored AI provider API keys.
What is ARTEX in this attack?
ARTEX is an open-source AI tool for penetration testing. Amazon assessed with moderate confidence that the attacking agents ran on ARTEX, where an operator sets a goal and a planner agent splits it into tasks executed by worker agents guided by a large language model.
How were the stolen API keys used?
Stolen keys were verified, added to a shared pool and used to run the AI models that powered the search for more keys. When cloud credentials were found, the agents targeted managed AI model services and secret stores, prioritising premium AI models.
How do I protect my self-hosted AI tools from this?
Change default admin keys, keep AI apps off the public internet or behind IP allowlists, patch known flaws in Langflow and RAGFlow, audit the One API isCliRequest bypass, restrict and rate-limit CI/CD tokens, and scan GitHub, npm, PyPI and container images for leaked keys.
