Microsoft’s Agent Framework Package Was Poisoned on PyPI: Check Which Secrets Your Build Machines Could Reach
Versions 1.26.1 and 1.26.2 of agent-framework on PyPI stole Azure, CI and cloud credentials the moment Python started. Which installs are at risk, why the two versions need different checks, and what to rotate.

In this article
Table of Contents
Table of contents
Two releases of Microsoft’s agent-framework package on PyPI, versions 1.26.1 and 1.26.2, carried code that steals cloud and CI credentials, and were published on Tuesday 17 November without, as far as the researchers can tell, going through Microsoft’s normal release process. Wiz Research, which reported the findings to Microsoft on the 17th, says the malicious versions were off PyPI by about 21:30 UTC, roughly an hour after the first appeared. The last clean release is 1.26.0. If any machine in your estate installed either bad version, the useful question is not whether you removed the package but which secrets that machine could reach while it was installed.
#The window, and who was in it
Wiz’s timeline puts the legitimate 1.26.0 release on Thursday 12 November. The first malicious version, 1.26.1, was published at 20:35 UTC on Tuesday 17 November (UK time is the same as UTC at this time of year). The second, 1.26.2, followed 33 minutes later, a gap The Hacker News and Wiz both report. SecurityWeek says both have since been quarantined on PyPI. The sources disagree on the exact moment of removal: Wiz says both were gone by around 21:30 UTC, while Endor Labs says 1.26.1 was off the index by 21:13 and that it still saw 1.26.2 as the latest version at 21:16.
That disagreement is small, but it sets the size of the exposure. Anything that ran pip install agent-framework without a pin, or that rebuilt a container image or CI job against the unpinned package, in the hour or so after 20:35 UTC on Tuesday is a candidate. The package is downloaded roughly 190,000 times a month according to SecurityWeek and The Hacker News (Wiz says almost 200,000), so the chance that some build somewhere fetched it is not remote. Most installs will have been pinned or cached and are fine; the point is that you have to check rather than assume.
#Why importing the package was not required
The detail that matters for responders is how the code ran. According to Wiz, SafeDep and Endor Labs, the malicious wheels install a .pth file into Python’s site-packages directory. Python processes those files every time an interpreter starts, so the code runs on any Python process in that environment, whether or not anything ever imports agent-framework. SecurityWeek describes it as exploiting a Python startup mechanism to execute automatically.
The two versions differ, and that is a trap for anyone searching only for what they read in the first reports. Per Wiz, 1.26.1 drops agent_framework_meta.pth, which loads a module called agent_framework_meta. Version 1.26.2 restores that module’s __init__.py to the clean 1.26.0 file, so a check on that file would find nothing, and moves the trigger to a top-level af_runtime_diag.pth importing af_runtime_diag. Both are named to look like telemetry. A hunt that looks only for the 1.26.1 file names will miss a 1.26.2 install.
#What it takes
Wiz and SafeDep describe the same broad sweep. The code collects environment variables whose names contain strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, OPENAI, NPM and PIP, and secret-looking values from the environment files of up to 300 other running processes, which on a shared build runner means other jobs’ secrets as well as the one that installed the package. It reads credential files, including Azure CLI profiles, .npmrc, .netrc, .git-credentials, DockerThe KBY LexiconDockerDocker packages an application and its dependencies into a portable, isolated container using OS-level virtualisation, distinct from full virtual machines.
configuration and Hugging Face tokens. On Azure it asks the instance metadata service for managed-identity tokens for a dozen resource types, including Azure Resource Manager, Key Vault, Storage and Azure DevOpsThe KBY LexiconAzure DevOpsAzure DevOps is Microsoft's platform for planning, source control, CI/CD, testing and package management, spanning Boards, Repos, Pipelines, Test Plans and Artifacts.
, and in an Azure DevOps pipeline it requests a federated token. Per Wiz, 1.26.2 widens the net: it adds more variable names and files, and it takes GitHub ActionsThe KBY LexiconGitHub ActionsGitHub Actions is GitHub's native CI/CD and automation platform, running YAML-defined, event-triggered workflows on hosted or self-hosted runners.
OIDC tokens where a workflow has the id-token: write permission.
Wiz says the stolen data was compressed and posted to a public webhook.site address, and that errors were ignored with no retry. In the other direction, Wiz noticed the attacker’s own tooling reporting to the same endpoint, which gave the researchers a partial view. On the free webhook.site tier only 50 requests were retained, and Wiz counted three unique victim submissions among them, the rest being the attacker’s machines and what looked like scanners and sandboxes. We would not read that as the true number of victims: a short-lived free endpoint, by Wiz’s account, kept only a sample.
#How it got onto PyPI is still open
SecurityWeek and The Hacker News both say it is unclear how the attacker obtained publishing access. Wiz offers a theory, stated as such: the attacker appears to have compromised a client certificate and private key for Microsoft’s ESRP release-signing service, with a first publish attempt from AWS address space rejected by ESRP’s IP filtering and a second from Microsoft-owned address space accepted. Wiz does not know how the credential was obtained, and says it found no matching release or code in Microsoft’s main source repository, which points to an upload outside the normal release pipeline. Wiz also says its attacker tooling identified itself as an open-source AI penetration-testing framework called Cairn, and that it has not linked this incident to an earlier compromise of another package.
A second thread is unconfirmed. SafeDep notes that PyPI now lists a second maintainer account, created on the day of the attack, with publish rights to agent-framework and five related projects. The PyPI page shows two maintainers, microsoft and vibiret. SecurityWeek repeats the point and says the account’s involvement in the malicious uploads has not been confirmed. We are not drawing a conclusion from a username. We would simply treat new releases of those six projects with suspicion until Microsoft says the maintainer list has been cleaned.
On Microsoft’s side, SecurityWeek reports a maintainer confirming in a GitHub discussion that the compromised releases were removed and that an investigation is under way. We could not open that discussion ourselves, so that is SecurityWeek’s account, and we found no Microsoft advisory in the pages we could read. SecurityWeek also says the Agent Framework repository was inaccessible at the time of writing, along with some other Microsoft repositories, and that it is unclear whether the incidents are related.
#Our view: the speed of detection is real, and it is not enough
Several security vendors flagged the releases quickly. Endor Labs says it "detected both malicious packages within three minutes of publication", while SafeDep, by its own timings, flagged 1.26.1 about 22 minutes after publication and 1.26.2 about four minutes after upload. That is genuinely fast, and it is why the exposure was about an hour rather than a day.
It still leaves a gap that detection cannot close, because a package manager will happily install a fresh release in the seconds between publication and takedown. We think the part worth taking from this incident is what an unpinned install means for a credential-rich CI runner. A job that can mint Azure tokens and read other jobs’ environments is an unusually valuable place to run pip install against a moving target. Pinning, hash-locking the whole dependency tree and routing installs through an internal proxy that delays brand-new releases are not new advice. This is a clean example of why they matter, and for AI agent tooling in particular, where teams often install the newest version of fast-moving packages straight into environments that hold cloud and model-provider keys.
We would also resist the temptation to blame Python’s .pth mechanism. It is documented behaviour that legitimate packages use. The lesson is narrower: a package that can run code at interpreter start deserves the same scrutiny as one that runs an install script.
#What to do today
- Search lockfiles, requirements files, CI logs, container images and virtual environments for agent-framework 1.26.1 or 1.26.2, and for
agent_framework_meta.pthoraf_runtime_diag.pthin site-packages. The times to look at are from 20:35 UTC on Tuesday 17 November. - Do not use Python in an affected environment as your first diagnostic step. Endor Labs warns that every interpreter start re-runs the code, so isolate the host or runner and inspect it with tools that do not start Python.
- Pin to
agent-framework==1.26.0, which Wiz calls the most recent safe version, and rebuild from a clean image rather than uninstalling in place. Block 1.26.1 and 1.26.2 in any package proxy. - Treat every secret reachable from an affected host or runner as exposed and rotate it: cloud and Azure DevOps credentials, GitHub and package-registry tokens, Hugging Face and model-provider keys, and anything in
.envfiles. Wiz notes that stolen managed-identity and OIDC tokens can stay valid for up to 24 hours, so also review Azure sign-in and activity logs for the identities involved, and GitHub Actions workflows that hadid-token: writewhen 1.26.2 was installed. - Search proxy and DNS logs for connections to the exfiltration address,
webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. Endor Labs advises matching the full path, because the webhook.site domain on its own is used by legitimate tools. - Hash-lock the full dependency tree, not just agent-framework, and hold updates to the five related projects SafeDep names until Microsoft confirms they are clean.
If none of your systems ever installed agent-framework, there is nothing to do. If you installed only 1.26.0 or earlier, the research we have read says you are unaffected.
#What we do not know yet
We do not know how many environments installed either version, because the only direct view of exfiltration is a sample on a free endpoint. We do not know how the attacker got publishing access, whether the second maintainer account had any part, or whether the other Microsoft repositories that SecurityWeek says went offline are connected. We have not seen a Microsoft advisory. We will update this story when Microsoft publishes one, or if researchers establish how the releases were uploaded.
Evidence trail
Sources and verification
Primary documentation and external technical references used in this article.
- 01SecurityWeek: Microsoft Agent Framework releases poisoned with credential stealersecurityweek.com
- 02Wiz Research: malicious version of Microsoft's Agent Framework published to PyPIwiz.io
- 03Endor Labs: agent-framework compromisedendorlabs.com
- 04SafeDep: Microsoft Agent Framework PyPI compromisesafedep.io
- 05The Hacker News: attackers compromise Microsoft's Agent Framework PyPI packagethehackernews.com
- 06PyPI: agent-framework project pagepypi.org
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
Read-only scripts
- Windows devices with no BitLocker recovery key in Entra IDMicrosoft Entra ID, Windows
- Intune devices that haven't synced in N daysMicrosoft Intune
- Mailboxes forwarding to external addressesExchange Online
- BitLocker status of every volume on this PCWindows
Upcoming deadlines
- Intune moves to macOS 15 and laterQ4 2026
- SAP SuccessFactors provisioning: move from basic auth to workload identityNovember 2026
- Intune November release: JIT registration reminder at APNs renewal and automatic JIT for eligible tenantsNovember 2026
Explore KBY
The KBY Brief
A short email about twice a week with new runbooks, configuration traps and fixes from KBY Technologies.
SubscribeMore news
All news
Platforms and devicesPowerShell 7 Will Ship Inside Windows, and Windows PowerShell 5.1 Is Now Deprecated



Was this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Get new fixes by email.
New runbooks, configuration traps and fixes from KBY Technologies, about twice a week.
Comments
Add a thoughtful note on Microsoft’s Agent Framework Package Was Poisoned on PyPI: Check Which Secrets Your Build Machines Could Reach. Comments are checked for spam and held for moderation before appearing.