A routine dependency install triggered one of the most serious supply chain incidents in the AI ecosystem. A compromised release of LiteLLM, an AI gateway with about 97 million monthly downloads, introduced malicious code that quietly extracted sensitive credentials from developers' systems. The attack needed no explicit action. Simply installing the affected package was enough to begin data exfiltration.
What makes this significant is how it happened and what it exposed. The breach began upstream in the software supply chain and exploited trust in CI/CD pipelines and dependency systems. It did not go after users directly. Even well-secured environments were affected by normal development workflows.
The scale of concern became clear when voices like Andrej Karpathy, former director of Tesla AI and former research scientist at OpenAI, pointed out how dangerous supply chain attacks have become, with Elon Musk reinforcing the need for caution.

source: https://x.com/karpathy/status/2036487306585268612?s=20
This points to a deeper issue in how modern AI infrastructure is built and trusted. In this article, let us examine what happened, how the attack unfolded, and what it means for building safer AI systems going forward.
Incident Overview: Scope, Timeline, and Entry Point
The issue began days before the public release. On March 19, the attacker group TeamPCP changed Git tags in the Trivy GitHub Action to point to a malicious build that carried a credential harvester.
Trivy runs deep within many CI/CD pipelines, including LiteLLM. It became a quiet but effective entry point. On March 23, a similar pattern appeared in Checkmarx KICS and the domain models.litellm.cloud was registered just before the main event.
On March 24 at 10:39 UTC, LiteLLM’s CI/CD pipeline ran the compromised Trivy scanner without version pinning. That gap exposed the PyPI publish token from the GitHub Actions environment. Within hours, two malicious versions were released and stayed available until about 16:00 UTC.
-
Version 1.82.7: Malicious code placed in
proxy_server.py, triggered on import - Version 1.82.8: A .pth file that runs on every Python startup, no import needed
pip install litellm
A simple install like this could pull sensitive data such as SSH keys, cloud credentials, API keys, and more. The data was encrypted and quietly sent out. The breach came to light only after a bug in the attacker’s code caused a system crash, exposing activity that would have stayed hidden through a transitive dependency.
How the Attack Moved Through Trusted Systems
The attack began outside LiteLLM and moved through trusted systems until it reached developers.
- Attackers changed the Trivy GitHub Action and pointed it to a malicious version
- LiteLLM’s CI CD pipeline used it without fixing a specific version
- The scanner pulled the PyPI publishing token from the pipeline
- Attackers used this access to release malicious LiteLLM versions
- Developers installed or updated the package and received the compromised code
Each step depended on trust. The pipeline relied on the scanner, and developers relied on the package source. Nothing seemed unusual at each step.
The attack spread through everyday workflows, including indirect installs through dependencies. Many systems were exposed, and developers remained unaware. This points to a clear issue. Risk extends beyond application code and includes the tools and systems that support it.
Understanding the True Impact of the Breach
The impact of this attack was severe. A simple install gave access to sensitive data across developer systems.
Attackers could access SSH keys, cloud credentials, Kubernetes secrets, API keys, CI CD tokens, and database passwords. Shell history, git credentials, and crypto wallets were also exposed .
This data was then encrypted and sent to an external domain. The process ran quietly in the background and gave no clear signal to the user. If Kubernetes access was present, the attack extended further. It could read cluster secrets and create privileged workloads to maintain access inside the system.
This level of access goes beyond a single application. It opens the door to full control of infrastructure across environments. AI systems increase this risk further. Tools like LiteLLM act as a central layer for multiple provider keys and requests. Once exposed, the impact spreads across connected services.
What This Reveals About Modern AI Systems
This event highlights key patterns in how modern AI systems are built and where risk enters.
- Deep Dependency Chains: Modern AI stacks rely on multiple external packages layered atop one another. Many dependencies are indirect, which makes them harder to track. A single weak link can affect the entire system.
- Trust Across Layers: CI CD pipelines trust external tools. Build systems’ trust dependencies. Developers trust package registries. Each layer depends on the next, creating a chain that attackers can move through step by step.
- Centralized Gateway Design: AI gateways such as LiteLLM collect keys from multiple providers and route all requests through a single layer. This improves convenience but increases risk. Exposure at this layer affects every connected service.
- Limited Visibility: Teams often lack clear insight into what runs inside pipelines or which dependencies are pulled in indirectly. This reduces early detection and slows response.
- Security Scope Gaps: Security efforts often focus on application code. Supporting systems such as pipelines, tools, and dependencies receive less attention, even though they carry equal risk.
The Risk Built into Modern AI Architectures
The earlier points highlight a gap. Deep dependency chains, layered trust across systems, centralized gateways, and limited visibility increase risk across AI infrastructure.
Core functions like API routing and key handling often rely on large dependency chains. As these layers grow, exposure increases. The same structure that supports speed also creates entry points for compromise. Addressing this requires architectural changes, including reducing exposure to dependencies, isolating critical components, and maintaining tighter control over execution environments.
AI gateways sit at a critical layer, handling traffic, managing keys, and connecting providers, which makes their design directly tied to system risk.
Building Low-Exposure AI Infrastructure with Bifrost
For teams evaluating options right now, the focus should be on how a gateway limits the impact of a compromised dependency. This depends on how the system is designed and where control is maintained across it.
Bifrost is an open-source AI gateway that routes and manages requests across 20+ model providers through a single interface. Keys, traffic, and access stay under your control.
Its design takes a different path at the architectural level. The PyPI attack surface is removed entirely. Built in Go, Bifrost runs as a single binary or container, which removes the need for pip installs, avoids a Python runtime inside the gateway, and eliminates dependency chains that can be altered during installation.
Control remains within the user’s environment because Bifrost runs on private networks, where traffic and credentials remain internal. Key management is handled through direct integration with systems such as HashiCorp Vault, AWS Secrets Manager, GCP, and Azure, where secrets stay in managed storage with controlled access and clear audit visibility.
Comparative Overview: LiteLLM vs. Bifrost
The differences become clearer when both approaches are viewed side by side across key areas of risk, control, and deployment.
| Category | LiteLLM | Bifrost |
|---|---|---|
| Language | Python (PyPI) | Go (binary/Docker) |
| Supply chain exposure | High | Eliminated (no pip dependency) |
| Credential storage | Environment/config-based | Vault-integrated |
| Deployment model | Application-level | In-VPC, isolated |
| Audit capability | Limited | Immutable, SIEM-ready |
| Migration effort | — | One-line configuration change |
| Performance | — | ~11 µs overhead at scale |
| Compatibility | Native | Full LiteLLM compatibility |
Closing Thoughts
The LiteLLM incident leaves a lasting takeaway. Systems built on layers of trust, dependencies, and software supply chains carry risk that spreads faster than expected. AI gateways sit at the center of this setup, which makes their design choices critical to overall security.
This is a moment to rethink how these systems are structured. Reducing dependency exposure, separating critical components, and maintaining control within your own environment can limit how far an issue can travel across the supply chain.
Bifrost follows this direction. Its design reduces exposure to dependencies, keeps credentials within managed systems, and runs in controlled environments, which helps limit the spread of similar attacks. To see how this approach can be applied, explore the Bifrost documentation.
If you do not know what each dependency in your AI stack has access to, that is the first thing to fix.




Top comments (0)