ServicesBlogPricingContactContact Now
AI2 min read

AI Agents Target LiteLLM, Dify for API Keys

AI Agents Target LiteLLM, Dify for API Keys

Introduction

Amazon's threat intelligence team has disclosed a novel campaign in which autonomous AI agents systematically hunt for misconfigured, internet‑exposed AI platforms such as LiteLLM, Dify, and One API. The agents locate stored provider API keys, exfiltrate them, and then reuse those keys to fuel additional scanning activity. The findings were captured using decoy servers that recorded the agents' own operational logs, providing a rare view into the inner workings of an AI‑driven credential‑theft operation.

Campaign Overview

According to the captured logs, the attackers deployed fleets of language‑model‑driven agents that continuously probe public IP ranges for open management interfaces. When an instance of LiteLLM, Dify, or One API is found with default or weak authentication, the agent extracts the embedded credentials for upstream model providers such as OpenAI, Anthropic, or Cohere. The operation appears to be fully automated, with no human‑in‑the‑loop required after the initial deployment of the agent swarm.

How the AI Agents Operate

  • Automated discovery: The agents use generated search queries and banner‑grabbing techniques to fingerprint target services across cloud providers and on‑premise exposures.
  • Credential harvesting: Once access is gained, the agents read configuration files, environment variables, or container metadata where API keys are stored, often in plaintext.
  • Self‑sustaining loop: Stolen keys are immediately fed back into the agent pool, allowing the campaign to scale without human intervention and to expand its scanning footprint exponentially.

Implications for Organizations

Organizations that expose AI inference gateways to the internet without strict network controls risk becoming unwitting participants in a credential‑theft supply chain. Compromised keys can be used to generate costly model calls, poison training data, or launch downstream attacks against customers and partners. Because the agents reuse the very keys they steal, a single exposed instance can cascade into a large‑scale abuse of multiple provider accounts, amplifying financial and reputational damage.

Practical Mitigation Steps

  • Place all AI gateway services behind a zero‑trust network segment; never expose management ports directly to the public internet.
  • Store provider keys in a secrets manager or vault and inject them at runtime rather than writing them to disk or container images.
  • Enable mutual TLS and strong authentication (e.g., OAuth2, mTLS) for every administrative endpoint, and disable default credentials.
  • Monitor outbound traffic for unusual spikes in API calls to known model providers; correlate with asset inventory and alert on anomalous usage patterns.
  • Regularly rotate API keys and enforce least‑privilege scopes for each service account, revoking any key that shows signs of misuse.
  • Implement runtime attestation for AI workloads to detect unauthorized configuration changes that could expose secret material.

Grivyonx Expert Analysis

The emergence of self‑propagating AI agents marks a shift from opportunistic scanning to autonomous, credential‑driven worm‑like behavior. Defenders must treat API keys as high‑value secrets and apply the same rigor used for cloud IAM credentials. Continuous runtime attestation and automated secret rotation are now baseline requirements for any production AI workload.

Conclusion

As AI‑powered tooling becomes a standard component of modern stacks, the attack surface expands beyond traditional web applications into the configuration layer of model gateways. Proactive network segmentation, secret management, and behavioral monitoring are essential to break the feedback loop that fuels these campaigns. Grivyonx’s AI‑driven DevSecOps platform helps teams automate secret rotation and continuous compliance across cloud‑native AI services.

  • #AI security
  • #API key theft
  • #LiteLLM
  • #Dify
  • #One API
  • #threat intelligence
  • #cloud security
Gourav Rajput

Gourav Rajput

Founder of Grivyonx Technologies