Security & privacy

AI agents automate API key theft from exposed LLM gateways

Amazon and Cloudflare report automated campaigns using ARTEX to steal AI provider keys from internet-exposed apps like LiteLLM and Dify.

A robotic hand inspecting a server rack for digital keys.
Illustration generated for this article

Attackers are deploying autonomous AI agents to scan for and exploit vulnerabilities in internet-facing artificial intelligence applications. Amazon’s threat intelligence team recently captured records of these agents targeting platforms such as LiteLLM, One API, and Dify to harvest stored API keys. The activity highlights a shift toward automated, persistent reconnaissance that leverages the very models it seeks to compromise.

What happened

Amazon’s decoy server network, known as MadPot, intercepted requests from AI agents hunting for weak spots in popular AI infrastructure tools. Between October 3 and late last week, these agents sent detailed logs of their operations to the honeypots. The records reveal a systematic campaign where agents identify exposed AI apps, extract provider keys, verify their validity, and add them to a shared pool for further use. Amazon assesses with moderate confidence that these operators are China-linked groups, citing Simplified Chinese prompts and time zone settings in the agent configurations.

In a parallel development, Cloudflare incident responders investigated multiple cases involving similar agentic tools. In one notable instance, an attacker used a compromised CI/CD token with no IP restrictions or rate limiting to access a customer’s environment. The subsequent activity included 400 database dump requests within a single hour. Cloudflare observed new Worker scripts with names matching ARTEX tasks, such as artex-pgrecon and artex-do, indicating automated persistence and validation efforts. The FBI has since issued a FLASH alert confirming that attackers have used these tools against organizations globally since at least August.

How it works

The primary tool identified in these campaigns is ARTEX, an open-source AI penetration testing framework. Although the original GitHub repository was taken offline in October due to abuse, forks and a commercial version called ARTEX PRO remain available. The system operates by splitting a high-level goal, such as "find API keys," into smaller tasks for worker agents. These workers execute security tools and send their findings to a large language model (LLM) to decide the next steps. This loop allows the agents to adapt their tactics based on real-time feedback without constant human intervention.

The agents follow a specific playbook of known entry points for each targeted product. For LiteLLM, they check for default master keys and unfinished installations. For One API family systems, they attempt an authentication bypass using the isCliRequest header. They also exploit server-side request forgery (SSRF) vulnerabilities in features that fetch URLs, allowing them to reach cloud metadata services. Beyond direct exploitation, the agents scan public sources like GitHub repositories, npm packages, container images, and Telegram channels for leaked secrets. Once cloud credentials are found, the agents prioritize accessing managed services that host AI models and secret stores.

Key details

  • Targeted platforms: The campaign focuses on LLM gateways and proxies like LiteLLM, One API, Veloera, and Sub2API, as well as AI app builders such as Dify, FastGPT, Langflow, and RAGFlow.
  • Specific vulnerabilities: The playbook exploits CVE-2025-3248 in Langflow (missing authentication) and CVE-2026-28797 in RAGFlow (server-side template injection), alongside default credentials and SSRF flaws.
  • Operational speed: Cloudflare observed attack rates exceeding 69 requests per minute across compromised accounts, demonstrating the high velocity of agentic automation compared to manual hacking.
  • Detection indicators: Security teams should look for Cloudflare Worker scripts named artex-, artex-pgrecon-, artex-pgw-, or artex-do- in their environments.
  • Network indicators: Cisco Talos has linked more than 2,500 IP addresses to ARTEX activity, and Amazon published 11 specific IPs associated with the decoy findings.
  • Secondary campaign: Records also describe a separate effort where agents attempted to bypass identity checks at cryptocurrency exchanges using deepfake videos, though these attempts were rejected by verification vendors.

Why it matters

For software engineers and security leads, this shift represents a significant escalation in threat velocity. Traditional security measures often rely on the assumption that attackers need time to research, plan, and execute exploits. AI agents remove this delay, enabling continuous, persistent scanning that can exploit minor misconfigurations before defenders even notice them. As Amazon noted, none of the techniques used were new, but the speed and persistence introduced by AI agents change the risk landscape entirely. Basic security hygiene, such as changing default passwords or patching known flaws, is no longer sufficient if not applied immediately upon deployment.

The impact extends beyond immediate data loss. Stolen API keys allow attackers to run expensive AI models on the victim’s dime, leading to unexpected billing spikes. More critically, these keys can provide a foothold into broader cloud environments, as seen in the Cloudflare cases where static CI/CD tokens granted broad access. Organizations must now treat AI app gateways and inference endpoints with the same rigor as production databases, assuming that any exposed secret will be found and exploited rapidly by automated systems.

What you can do

  • Rotate and restrict credentials: Immediately rotate any static CI/CD tokens or API keys that lack expiration dates. Enable IP restrictions and rate limiting for all cloud provider tokens, especially those used in CI/CD pipelines.
  • Patch known vulnerabilities: Update Langflow to version 1.3.0 or later to fix CVE-2025-3248. For RAGFlow, upgrade to version 0.25.0 or later to mitigate CVE-2026-28797, which allows remote code execution via template injection.
  • Harden default configurations: Change default administrator credentials, such as the LiteLLM master key, immediately after installation. Ensure that new installations are not left in an unfinished state that allows outsider takeover.
  • Scan for exposed secrets: Regularly search configuration files, environment variables, and deployment scripts for embedded secrets. Use automated tools to scan repositories and container images for leaked keys before they reach production.
  • Monitor for specific artifacts: Check your logs for the presence of Cloudflare Worker scripts with names starting with artex-. Implement Snort rules 7:76, 7:77, and 7:78 to detect traces of the norma agent harness used by ARTEX.
  • Audit public exposure: Review your internet-facing AI apps for unnecessary exposure. Remove debug routes, source maps, and environment files from public access, and ensure that management endpoints require strong authentication.
  • #ai security
  • #api keys
  • #litellm
  • #artex
  • #cloudflare
  • #threat intelligence

Tools from the Bytechap store

Keep reading

All stories