Microsoft's agent-framework package was hijacked on PyPI, and a credential stealer ran on every Python start
Attackers published malicious versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package on PyPI on November 17; they were live for about 41 minutes on a package with about 190,000 monthly downloads, and the last clean version is 1.26.0.
📊 Scorecard: our Bearish call on $MSFT is scored from $498.30, the last close before it ran. Its first result comes after the next close.

The News
Attackers hijacked Microsoft's agent-framework package on PyPI, the main library of reusable code for the Python programming language, on November 17. They published two malicious versions — 1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC. PyPI quarantined 1.26.1 at 21:06 UTC, 31 minutes after upload, and removed 1.26.2 by 21:16 UTC, so the poisoned code was live for about 41 minutes in total. The package gets about 190,000 downloads a month, or about 41,000 a week.
Both malicious versions installed a small startup hook file — agent_framework_meta.pth in 1.26.1 and af_runtime_diag.pth in 1.26.2 — that runs a credential stealer every time the Python interpreter starts, even if the package itself is never used. The stealer harvested environment variables matching sensitive words such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI and HF_, along with Azure managed-identity tokens for 12 resources, Azure DevOps and GitHub Actions sign-in tokens, and credential files including .azure, .npmrc, .git-credentials, Docker config, .env and Hugging Face tokens. It sent the stolen data, compressed and encoded, to a webhook.site address.
How the attackers got in is disputed. Wiz, the security firm that found the compromise, says the attacker's tooling reported its own progress to the same public webhook, and that the attacker appears to have compromised a client certificate and private key for Microsoft's ESRP release pipeline — the system Microsoft uses to publish software. JFrog's analysis, though, says the file headers show the package was repacked on a local machine, not built in Microsoft's pipeline. We are reporting both accounts, not choosing between them. The tooling identifies itself as Cairn, an open-source AI penetration-testing framework. The last clean version is 1.26.0, and anyone who installed 1.26.1 or 1.26.2 must assume their credentials are compromised. Wiz's November 18 update says the webhook captured 50 requests: four from the attacker's own machines, 29 from sandboxes and scanners, and 17 requests representing three unique, successful cases of victim data being exfiltrated. No CVE has been assigned.
The poisoned package did not wait to be used — it ran on every Python start, which is what turns a 41-minute window into a wide-open door.
Why It Matters
This is a supply-chain attack, and that is what makes it scary. Developers do not write every line of code themselves; they download packages like agent-framework from PyPI and trust that the code is what Microsoft published. When attackers slip poisoned code into a trusted package, the victims are not careless users clicking a bad link — they are developers doing exactly what they are supposed to do, updating a library from the official source.
The startup hook is the nasty part. Most malicious code only runs when you use the package it hides in. This one runs every time Python starts, whether or not the package is ever imported — so a developer who installed the update and never touched agent-framework was still exposed. And what it stole is the crown jewels of modern software work: the cloud keys, tokens and passwords that let code talk to Azure, Amazon, GitHub and OpenAI. With those, an attacker can get into far more than one laptop.
The 41-minute window sounds short, and it is — but on a package downloaded about 190,000 times a month, 41 minutes is plenty of time for automated build systems around the world to pull the bad version. The open question is how many did. Wiz's November 18 update put the confirmed victim count at three unique cases of data exfiltration, and the safe move for anyone who installed 1.26.1 or 1.26.2 is to treat every credential on that machine as burned and rotate it.
Analyst's Take
Our call is Bearish. Microsoft's own AI agent toolkit became a delivery vehicle for a credential stealer, and the attack worked precisely because the software supply chain runs on trust. The 41-minute window limits the damage, but the exposure is wide: about 190,000 monthly downloads, a stealer that runs on every Python start, and cloud keys among the haul. For a company selling developers an AI agent framework, having that framework hijacked is a bad look and a real security incident, not a theoretical one.
The dispute over how it happened matters for the fix. If Wiz is right and a release-pipeline certificate was compromised, Microsoft has a pipeline security problem to close. If JFrog is right and the package was repacked locally, the weak point is account or publishing access. Either way, the lesson for every team is the same: pin your dependencies to exact versions, check what you install, and treat a surprise new release of a trusted package with suspicion.
What to watch next is a victim count and Microsoft's own account of the breach — neither has appeared yet. If the number of affected developers turns out to be large, expect a wave of forced credential rotations and a harder look at PyPI publishing security. Reader poll: Did you install agent-framework 1.26.1 or 1.26.2? Vote: Yes, updating now; No, on 1.26.0; Not a user; Checking now.
Are you bullish or bearish on this story?
By The Numbers
FAQ
What is PyPI?
PyPI, the Python Package Index, is the main public library where Python developers download reusable bundles of code called packages instead of writing everything from scratch. Installing a package from PyPI is a routine, trusted step in building software.
What is a credential stealer?
A credential stealer is malicious software that hunts for passwords, keys and sign-in tokens stored on a computer and sends them to the attacker. Credentials are the digital keys that let programs and people into cloud services and code repositories.
What is a .pth startup hook?
A .pth file is a small file Python reads every time it starts up, before running any of your code. Attackers abused this: their .pth file told Python to run the stealer on every start, even if the poisoned package was never used.
What is a CVE?
A CVE, or Common Vulnerabilities and Exposures number, is the standard ID given to a publicly known security flaw so everyone can refer to the same problem. No CVE has been assigned to this hijack yet.
👁
Source: Wiz