⚠ CRITICAL — Disclosed March 25, 2026

LiteLLM versions 1.82.7 and 1.82.8 on PyPI are confirmed malicious. If you have either version installed, assume full credential compromise. Rotate all secrets immediately and audit all machines that ran Python with these versions installed. The attack vector requires zero interaction — it fires on Python interpreter startup.

This morning, the AI developer community woke up to one of the most significant supply chain attacks in the history of AI infrastructure. LiteLLM — the open-source library that nearly every AI startup, autonomous agent platform, and enterprise AI team uses to route requests to OpenAI, Anthropic, Gemini, and 100+ other models — had been compromised at the package level.

Not just any compromise. A zero-interaction credential stealer that activated the moment Python started, silently vacuumed every secret on the machine, encrypted it with AES-256 and a hardcoded RSA-4096 public key, and exfiltrated it to an attacker-controlled endpoint. No import required. No user action required. Just existing on the machine was enough.

2
Compromised Versions
34K
Bytes — Malicious Payload
100+
AI Providers Routed by LiteLLM
0
User Interaction Required

What LiteLLM Is — And Why This Matters So Much

If you've never heard of LiteLLM, you've almost certainly used something built on top of it. It's the universal gateway layer for AI model access — a Python library that lets you call OpenAI, Anthropic Claude, Google Gemini, Cohere, Mistral, AWS Bedrock, Azure OpenAI, and over 100 other providers through a single unified interface.

It's used by AI agent frameworks, LLM orchestration tools, autonomous coding assistants, enterprise AI platforms, and essentially every startup that doesn't want to write custom integration code for each model provider. According to PyPI statistics, LiteLLM has been downloaded over 80 million times. Its GitHub repository has more than 18,000 stars.

In the autonomous company ecosystem, LiteLLM is infrastructure. It's the plumbing. It sits deep in AI stacks, trusted implicitly, updated frequently. Which made it the perfect target.

"Attack the water supply, not the house. They can change the locks, but everyone still needs to drink."

The Attack: Technically Elegant, Devastatingly Effective

The attack was disclosed today via a detailed GitHub issue by security researcher dot_treo. The mechanism is technically sophisticated and represents a new template for AI supply chain attacks.

The malicious payload was delivered via a .pth file — specifically, litellm_init.pth — bundled inside the official LiteLLM wheel package on PyPI. Python's .pth mechanism is a feature, not a bug: it allows packages to add directories to sys.path at interpreter startup. Attackers abused this by including executable code in the .pth file instead of directory paths.

# This line in litellm_init.pth executed on every Python startup: import os, subprocess, sys; subprocess.Popen([sys.executable, "-c", "import base64; exec(base64.b64decode('...34KB of payload...'))"])

The payload itself was double base64-encoded — a simple but effective obfuscation layer that bypassed most static analysis. Once decoded, it executed a sophisticated multi-stage credential harvester:

🎯 Credentials Targeted — Full Scope
AI / Cloud
  • All environment variables (API keys, tokens)
  • AWS credentials + IMDS tokens
  • GCP application default credentials
  • Azure credential store (~/.azure/)
  • Kubernetes kubeconfig + service account tokens
Identity / Access
  • SSH private keys (all standard locations)
  • Git credentials + .gitconfig
  • NPM tokens (.npmrc)
  • Docker registry credentials
  • Shell history (bash/zsh/psql/redis)
Databases
  • PostgreSQL (.pgpass)
  • MySQL config + history
  • Redis CLI history
  • MongoDB config (.mongorc.js)
Crypto Wallets
  • Bitcoin, Ethereum keystores
  • Solana keypairs
  • Cardano, Monero, Zcash wallets
  • Litecoin, Dogecoin, Dash, Ripple

The collected data was then encrypted and exfiltrated. The use of AES-256 with a hardcoded RSA-4096 public key for key encapsulation is a professional-grade operation — it ensures that even if the encrypted payload is intercepted in transit, it cannot be decrypted without the attacker's private key. This wasn't a script kiddie. This was a sophisticated threat actor who understood operational security.

The Blast Radius: Who Was Hit

Quantifying the damage is difficult, but the attack surface is enormous. LiteLLM is a direct dependency or transitive dependency in virtually every major AI framework in production today:

📊 LiteLLM Dependency Exposure — Key Platforms
Direct integrations (LiteLLM Proxy)Critical
LangChain / LangGraph deploymentsHigh
AutoGen / Semantic Kernel agentsHigh
CrewAI / OpenHands workloadsMedium
Enterprise MLOps pipelinesMedium
CI/CD systems with AI code reviewMedium

Exposure level reflects credential density and privilege on typical affected machines.

The worst-hit machines are likely those running LiteLLM Proxy — the self-hosted gateway that many enterprises deploy as their internal AI model router. These machines typically hold API keys for every model provider the company uses, internal service credentials, and cloud access tokens. A single compromised LiteLLM Proxy server could expose an entire company's AI infrastructure.

Why the AI Supply Chain Is Uniquely Vulnerable

The LiteLLM attack isn't an anomaly. It's a preview. The AI ecosystem has created a perfect environment for supply chain attacks to thrive:

Move-fast culture demands constant updates. AI libraries release new versions multiple times per week. LiteLLM itself has published hundreds of versions in the past year. Developers update frequently to access new model support or bug fixes — often without reading changelogs.
🔑
AI environments are credential-dense by design. Every AI application needs API keys. Autonomous agent systems often hold credentials for dozens of services — payment processors, communication APIs, cloud infrastructure, databases. The ROI on a single successful exfiltration is massive.
🕵️
The ecosystem runs on implicit trust. pip install is a single command that executes arbitrary code with user-level (or root) permissions. In production AI environments, this trust is rarely audited. Most teams have no SBOM, no dependency integrity monitoring, and no runtime anomaly detection.
🤖
Autonomous agents amplify the damage. When an AI agent with compromised credentials takes actions autonomously — spinning up cloud resources, making API calls, deploying code — the attacker's blast radius multiplies exponentially. A compromised human developer is bad. A compromised autonomous agent is catastrophic.
"You can't build autonomous companies on infrastructure you can't verify. The LiteLLM attack proves that 'works correctly' and 'is trustworthy' are not the same thing."

The Autonomous Company Threat Model Is Different

Here's what keeps us awake: traditional supply chain attacks affect human developers who can notice unusual behavior, check their bank account for unauthorized transactions, or get an alert on their phone. Autonomous agents have none of these out-of-band channels.

Consider a fully autonomous company — the model BRNZ is building toward — where AI agents handle sales, marketing, code deployment, customer support, and finance. That stack runs continuously, 24/7, often in containerized cloud environments where the entire credential set lives in environment variables. A single compromised dependency in that stack could:

  • Exfiltrate all customer data stored in the database
  • Extract payment processing credentials
  • Steal the cloud access tokens needed to destroy the entire infrastructure
  • Grab all model provider API keys, running up six-figure bills in hours
  • Compromise the code deployment pipeline to insert persistent backdoors

And it would do all of this silently, without any human in the loop to notice. The autonomous company model dramatically increases both the value of what can be stolen and the difficulty of detecting the theft.

$4.5M
Avg Cost of Supply Chain Breach (2025)
312
Days Avg Time to Detect
91%
AI Apps with Unaudited Deps
0
Major AI Frameworks with SBOM

What You Should Do Right Now

If you're running any Python-based AI workloads, this is your immediate action checklist. No exceptions, no "we'll get to it" — do this today:

Priority Action Timeframe
P0 — Now Check for litellm==1.82.7 or 1.82.8 in all environments Immediate
P0 — Now Rotate ALL credentials on affected machines — every API key, every cloud token Within 1 hour
P0 — Now Revoke and reissue SSH keys from affected machines Within 1 hour
P1 — Today Audit all machines that had Python in PATH while compromised versions were installed Today
P1 — Today Review cloud provider audit logs for unauthorized API calls since first installation Today
P2 — This Week Implement dependency pinning with hash verification across all projects This week
P2 — This Week Generate and maintain SBOMs; monitor for dependency integrity changes This week
P3 — Ongoing Deploy runtime anomaly detection for unexpected network egress from AI workloads Ongoing

The Structural Fix: Security Must Be a First-Class Agent

The LiteLLM attack exposes a fundamental gap in how the AI industry thinks about security. We treat dependency management as a developer concern — a checkbox, a background task, something that happens in the CI pipeline. But in autonomous systems where credentials equal control, dependency security is existential infrastructure.

The solution isn't to run fewer dependencies or update less frequently — both are losing strategies in a fast-moving ecosystem. The solution is to make security a continuous, autonomous, first-class function of your stack:

🛡 Autonomous Security Architecture for AI Stacks
01
Continuous SBOM Generation + Drift Detection
Auto-generate SBOMs on every deploy. Alert immediately when any package hash deviates from the pinned value. Use tools like Syft + Grype or CycloneDX.
02
Egress Anomaly Detection
AI workloads have known-good egress patterns. Any connection to an unrecognized endpoint should trigger an alert. The LiteLLM payload exfiltrated to an external C2 — this is detectable.
03
Least-Privilege Secret Architecture
No AI agent should ever have access to credentials beyond what its current task requires. Dynamic secrets with short TTLs (HashiCorp Vault, AWS Secrets Manager) limit exfiltration value to zero by the time it reaches the attacker.
04
Automated Dependency Vetting Pipeline
Before any new package version enters production, an automated security agent runs static analysis on the wheel contents — checking for .pth files, encoded payloads, and unexpected network calls. Humans review anomalies; machines handle the routine.

This is exactly the architecture KENSAI is designed to operate within — continuous autonomous security scanning, not periodic audits. The difference between catching this attack in staging versus finding it in production forensics is entirely a function of how automated and continuous your security posture is.

The Industry Reckoning

The LiteLLM attack will be studied in security courses for years. Not because it was technically unprecedented — supply chain attacks on PyPI have happened before, and will happen again — but because of what it targeted: the nervous system of the entire AI industry.

LiteLLM isn't a niche library. It's the library that talks to the models that power your AI products. Compromising it is equivalent to compromising the router through which all your AI traffic flows. And the attackers knew exactly what they were doing — the credential targeting is exhaustive, professional, and specifically optimized for high-value AI/cloud environments.

The good news: the attack was discovered and disclosed quickly. The BerriAI team has responded. The compromised versions have been pulled from PyPI. But the window was open, and for anyone who installed either version during that window, the damage is done unless credentials are rotated immediately.

"The question isn't whether your AI stack will be attacked. It's whether your security posture will make you a 10-minute target or a 10-second one."

The Bottom Line

We're building autonomous companies — systems that operate without human oversight, that hold real credentials, that take real actions with real consequences. The LiteLLM attack is a brutal reminder that the security model for these systems cannot be an afterthought.

Every dependency you import is a potential attack vector. Every secret in your environment is a potential exfiltration target. Every autonomous agent that runs with elevated credentials is a potential weapon against your own infrastructure if compromised.

The answer isn't to move slower. The answer is to make security as autonomous as everything else — continuous, agent-driven, and always on. Because in a world of zero-human companies, the only thing standing between your infrastructure and an attacker is the security you've baked into the architecture.

Not a security audit. Not a quarterly penetration test. An autonomous security layer that catches this stuff before it ever reaches production.

1.82.7
1.82.8
Compromised Versions — Do Not Use
1.82.9+
Safe — Upgrade Immediately
Now
Rotate All Credentials