What Happened and When
In November, Amazon's threat intelligence team uncovered evidence of a coordinated campaign in which attackers deployed AI agents to systematically scan for internet-exposed instances of popular open-source AI applications. The agents targeted LiteLLM, Dify, One API and similar frameworks that serve as bridges between applications and large language model providers. The campaign was discovered through decoy servers that Amazon set up to capture malicious traffic and reverse-engineer attacker methodology. Records from these honeypots showed a pattern of automated reconnaissance followed by credential extraction.
How the Attack Cycle Worked
The attackers had set up a self-reinforcing loop. They obtained initial API keys through scanning or previous compromises, then used those keys to provision AI models that powered their scanning agents. These agents systematically searched for internet-exposed instances of vulnerable frameworks, identified weak or missing authentication, and extracted additional API keys from configuration files and environment variables. The stolen credentials were then used to query more models and expand the campaign further. This chain meant that each successful key theft directly enabled the next wave of attacks without requiring additional attacker resources.
Why These Applications Were Targeted
LiteLLM, Dify and One API are proxy or routing layers that abstract API calls to multiple AI providers, allowing developers to manage model access through a single interface. They typically store API keys for OpenAI, Anthropic, Google and other providers in configuration files or environment variables on the host server. When these applications are deployed on internet-facing servers without proper access controls or firewall rules, the APIs become targets for automated scanning. Developers often expose these frameworks during development or testing and forget to restrict access before moving to production. The payoff for attackers is high: a single compromised instance can yield keys worth hundreds or thousands of dollars in API quota.
The Reality of Exposure and Detection
According to open-source security monitoring practices, internet-exposed AI application frameworks remain common across development and staging environments. The Tor Project and security research on onion services shows that attackers regularly scan for known application signatures and default ports to identify targets. Amazon's incident report demonstrates that automated scanning specifically for LiteLLM and Dify instances has already moved from targeted reconnaissance to large-scale campaign activity. What makes this threat especially persistent is that many developers rely on security through obscurity, assuming their staging servers or internal tools won't be found. In reality, search engines, port scanners and AI-driven enumeration tools systematically map the public internet for these services every hour.
Practical Exposure Indicators and Verification
You can assess whether an AI application instance is vulnerable by checking for a few signs:
- Does the application respond to unauthenticated requests on common ports like 8000, 8080, or 4000.
- Can you access the application's logs, configuration endpoints or debug panels without providing credentials.
- Are API keys visible in error messages, debug output or publicly accessible configuration files.
- Does the instance allow direct file reads or environment variable enumeration through API calls.
If you run LiteLLM, Dify or similar frameworks, verify your setup by attempting to access the application from outside your network as if you were an attacker. Use tools like curl or a simple HTTP client to test whether sensitive endpoints return data without authentication. If they do, immediately restrict network access and rotate compromised keys.
What This Means for Ordinary Users and Developers
If you use OpenAI, Anthropic, Cohere or similar providers through a proxy like LiteLLM or Dify, you should assume that any API key exposed in this campaign is compromised. Check your billing and API usage logs for unusual activity. Consider that attackers may have used your quota to fund their own model queries and scanning operations. Contact your AI provider's support team to audit which keys have been active and when, and request a detailed usage report for dates when you did not generate queries.
For organizations that deploy these frameworks internally, the lesson is immediate: never expose an AI application proxy to the internet without at least basic authentication, IP whitelisting, and rate limiting. Use network segmentation to ensure only your applications can reach the proxy server. Rotate API keys on a regular schedule, not just when a breach occurs. Monitor access logs for repeated failed authentication attempts or unusual query patterns that suggest automated scanning.
Lessons and Forward Steps
The AI agent campaign discovered by Amazon reveals a shift in attacker methodology: instead of manually probing each server, they are now using the same AI models they are trying to steal from to automate the search itself. This makes detection and response faster for defenders who understand the pattern but dangerous for those who assume their staging environments are private. The best defense is to treat every internet-facing service, no matter how "internal," as if it could be scanned by an adversary in minutes.
If you maintain any AI application or proxy in a production or accessible environment, audit your access controls today. Check firewall rules, authentication requirements, and API key storage practices. Rotate any API keys that have been in use for more than three months or that exist in configuration files rather than secure vaults. Document which keys are used by which services so that if a breach occurs, you can quickly identify which portions of your AI infrastructure are compromised. These steps transform a potential financial and operational catastrophe into a manageable incident response.
Source: The Hacker News
