The PyPI registry is a trust machine. You push a package, it gets scanned by automated tools, and the community assumes the maintainer has vetted the code. That assumption just cost 2,186 organizations their credentials.
Let me walk through the attack arc. This isn't a theoretical warning. It's a verified exploit with a 40-minute window that extracted 78,330 secrets from SSH keys to LLM API tokens.
Hook: The 40-Minute Window
On a normal Tuesday, the LiteLLM package on PyPI got two version bumps: 1.82.7 and 1.82.8. They stayed live for roughly 40 minutes. In that time, an automated pipeline scraped 78,330 credentials from 2,186 organizations. The payload was a single file: litellm_init.pth.
Python's .pth file mechanism is not a zero-day. It's a feature that allows path configuration at interpreter startup. Attackers have known about it for years. But here, it was weaponized against AI agent infrastructure—specifically, a gateway that manages API keys for multiple LLM providers.
Code does not lie, but liquidity does. And in this case, the liquidity was developer trust flowing into a poisoned package.
Context: The Target Profile
LiteLLM is not a niche tool. It's a widely adopted open-source LLM gateway that enterprises use to route requests to OpenAI, Anthropic, Google, and other model providers. Its core value proposition is centralized key management. That means one compromised package can harvest the entire credential chain: SSH keys for infrastructure access, AWS/GCP/Azure cloud tokens, Kubernetes service account tokens, and LLM API keys.

The attack was not isolated. CloudSEK's report, cited by the FBI warning, connects this to a broader campaign by a group called Team PCP. They previously targeted Trivy, CanisterWorm npm worm, Checkmarx KICS, and Telnyx. This is a systematic mapping of the developer toolchain.
Based on my experience auditing the Parity multisig vulnerability in 2017—where a single unchecked delegatecall could drain $31M—I recognize the pattern: attackers target the most trusted layer in the software supply chain, because that's where the least scrutiny is applied.

Core: The Mechanics of the Exploit
Let me break down the technical execution:
- Payload delivery: The malicious
.pthfile is automatically executed by the Python interpreter at startup. No explicitimportrequired. The attacker understood the Python runtime initialization sequence—a detail many developers overlook.
- Credential harvesting: The payload collected SSH private keys, cloud provider credentials (AWS, GCP, Azure), Kubernetes tokens, and LLM API keys. This is not a random grab bag. It's a systematic collection of every identity needed to operate an AI agent in a cloud-native environment.
- Exfiltration: Data was sent to
models.litellm.cloud—a domain visually similar to the officiallitellm.ai. This bypasses basic network monitoring because the domain looks legitimate.
- Automation: 78,330 secrets in 40 minutes. That's roughly 33 secrets per second. The collection pipeline was fully automated, likely using a script that watched for new PyPI releases and triggered the exfiltration in real-time.
- Version sequencing: The attacker released two consecutive malicious versions (1.82.7, 1.82.8). This suggests either an automated release pipeline or compromised maintainer credentials. The repeated push indicates they wanted to maximize the window before detection.
Trust the math, ignore the memes. The math here is: 40 minutes × 2,186 organizations = an average of 54 organizations per minute affected. That's a velocity that outpaces most enterprise incident response teams.
Contrarian: The Retail vs. Smart Money Mismatch
Most security teams are still scanning for known CVEs and malicious code patterns. They treat PyPI as a trusted upstream. The smart money knows that the real attack surface is the trust relationship itself.
Here's the contrarian angle: The .pth technique is not new, but its application to AI infrastructure changes the damage profile. In traditional supply chain attacks, stealing code or credentials gives you access to the development environment. In this attack, stealing LLM API keys gives you direct access to the model inference pipeline. You can consume tokens, poison outputs, or exfiltrate sensitive data that the model processes.
Retail developers think: "I use open-source packages, but I trust the maintainers." Smart money thinks: "The maintainer's PyPI credentials are a single point of failure. I need to verify every release hash, pin dependencies, and scan for unexpected files."
I survived the Terra/Luna collapse because I reverse-engineered the reserve mechanism before the death spiral. The same principle applies here: don't trust the narrative. Audit the code. The 40-minute window tells me that the attack was optimized for speed, not stealth. That means the attacker assumed detection would happen quickly, but they banked on the downstream impact being irreversible.
Chaos is just data you haven't parsed yet. The data here shows that the attacker was willing to burn a domain and a PyPI account for a 40-minute window. That's a high-value trade-off, which implies the credentials were extremely valuable.
Takeaway: The New Frontier
This event is not a one-off. It's a pattern. The same trust vulnerability exists in npm, RubyGems, Cargo, and every other package registry. The attack vector is the same: exploit the assumption that published packages are safe.
For AI teams specifically: your LLM API keys are now as valuable as cloud credentials. Treat them with the same rigor. Implement key rotation, monitor for anomalous token consumption, and never trust a package without verifying its hash against a known-good source.

Survival is the first profit metric. The organizations that survive this wave will be those that treat their software supply chain as a threat surface, not a trust network.
The moon is a myth; the ledger is the only truth. In this case, the ledger is the PyPI download history, the CI/CD logs, and the exfiltration domain. Verify those, and you'll see the pattern before it hits you.
I'm not predicting more attacks. I'm observing that the infrastructure is set up for them. The question is whether your team will be the one analyzing the next 40-minute window or the one caught in it.