Microsoft Agent Framework PyPI versions 1.26.1 and 1.26.2 were compromised on 17 November 2026 and turned into credential stealers, in a supply chain attack that put developers and the cloud accounts they work with at direct risk. The two malicious releases were published only 33 minutes apart, and both have since been quarantined on PyPI, with the safe version 1.26.0 restored as the latest release.
The Microsoft Agent Framework PyPI package at the centre of the incident is agent-framework, the official meta-package for Microsoft Agent Framework, an open source framework for building and orchestrating AI agents in Python. Because it is a trusted Microsoft package, many developers would have installed it without a second thought, and that trust is exactly what made the compromise so dangerous.
Socket researchers found that the malicious versions did not wait for anyone to import the framework. They ran as soon as Python started, using Python startup hooks, so the theft began during installation and during ordinary Python use, including when pip itself ran

What Happened to Microsoft Agent Framework on PyPI
According to reporting by The Hacker News on 18 November 2026, the attackers pushed two tampered versions of agent-framework to PyPI on 17 November. Version 1.26.1 came first, followed by version 1.26.2 about half an hour later. Both versions were later quarantined, which stops new downloads but does not remove copies that people have already installed.
Socket advised teams to check activity between 8:35 p.m. and about 9:20 p.m. UTC on 17 November 2026. Anyone who installed or updated agent-framework in that window should treat the machine as potentially compromised until checks prove otherwise.
How the Microsoft Agent Framework PyPI Attack Worked
The attack relied on .pth files, a little known Python feature that runs code at interpreter startup. Version 1.26.1 added a file called agent_framework_meta.pth, and version 1.26.2 added a file called af_runtime_diag.pth. Each .pth file loaded a small Python module when Python started, even if the project never imported agent-framework at all. That is why simply installing the package was enough to trigger the theft.
Once running, the code searched the machine for credentials in several places. It scanned environment variables for names that looked related to tokens, keys, and secrets. It also looked for common credential files, including Azure CLI files, .npmrc, pip.conf, .netrc, .git-credentials, Docker configuration, and Hugging Face credentials, and it collected .env files and JSON files that could hold secrets. The second version went further and added searches for GitHub Actions OIDC tokens, which automated workflows use to prove their identity to cloud services.
Cloud Tokens Were the Real Target
What makes this incident stand out is that the code did not only read secrets that were already stored on disk. It also asked the platform to issue fresh ones. In Azure DevOps pipelines, it used the SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI values to request a federated token for api://AzureADTokenExchange. On Azure compute, it asked the managed identity endpoint for an access token, using the IDENTITY_ENDPOINT or MSI_ENDPOINT value on App Service and Azure Functions, or the instance metadata service at 169.254.169.254 elsewhere.
Socket warned that this behaviour changes how teams should respond. Rotating stored secrets is not enough on its own, because the stolen material included tokens that were created on demand during the attack. The stolen data was compressed with zlib, encoded in Base64, and sent by HTTPS POST to webhook.site/d381fd80-ec6242ad-8f5c-d1b15103c9bb. Searching proxy and DNS logs for that address is one of the fastest ways to tell whether a machine sent data out.

Who Is Affected and What to Do Now
Anyone who installed the Microsoft Agent Framework PyPI package in versions 1.26.1 or 1.26.2 should act now, even if nothing looks wrong. The code was designed to run quietly, so a clean looking machine is not proof that nothing was taken. Check your install history on laptops and shared build runners.
- Pin agent-framework to version 1.26.0, the last known safe release, and remove the two bad versions from every machine and runner where they appear.
- Isolate any host or runner that installed 1.26.1 or 1.26.2, and rebuild it from a clean image where possible instead of trying to clean it in place.
- Search install, proxy, and DNS logs for the webhook.site address above, and for installs made between 8:35 p.m. and about 9:20 p.m. UTC on 17 November 2026.
- Rotate every credential that could have been on the affected machine, from a clean system, and review Azure identities, sign-in logs, and activity logs for unfamiliar access.
- Audit GitHub Actions workflows that deploy to Azure, and check for new or changed resources, roles, or permissions that no one on the team recognises.
A Pattern, Not a One Off Incident
This is the second time this year that a Microsoft related PyPI package has been compromised in this way, according to The Hacker News. In May 2026, the durabletask package was used to push three malicious versions that distributed the Mini Shai-Hulud worm. The new incident follows the same playbook: take over a trusted package, hide code in the install or startup path, and target the credentials that developers and pipelines rely on.
The pattern is familiar from other recent supply chain attacks, including the Optimizely hack that affected 178 organisations and the GitHub CI secret stealer that exposed thousands of accounts. In each case, compromising one trusted component gave attackers a path into many organisations at once. The Fugaku supercomputer hack showed the same lesson from a different angle.
The immediate danger from the Microsoft Agent Framework PyPI incident is now contained on PyPI, but the cleanup will take longer. Organisations that used agent-framework in the affected window should assume that credentials on those machines were exposed, rotate them, and check their cloud accounts carefully. In supply chain attacks, the download is only the start. What matters next is how quickly teams find the exposure and close it. Sources for this story include The Hacker News, PyPI, and the Microsoft Agent Framework project on GitHub.
What happened in the Microsoft Agent Framework PyPI hack?
Attackers compromised agent-framework versions 1.26.1 and 1.26.2 on PyPI on 17 November 2026. The malicious versions stole credentials and cloud tokens.
Which versions of agent-framework are safe?
Version 1.26.0 is the last known safe release. Versions 1.26.1 and 1.26.2 are malicious and should be removed.
How did the malicious package steal credentials?
It used Python .pth startup files, so its code ran every time Python started, even if the framework was never imported. It then collected environment variables, credential files, and cloud tokens.
What kind of credentials were stolen?
Environment variables, Azure CLI files, .npmrc, .git-credentials, Docker and Hugging Face credentials, .env files, and Azure and GitHub Actions OIDC tokens.
How can I check if I was affected?
Check install logs for 1.26.1 or 1.26.2, and search proxy and DNS logs for the webhook.site address in this article.
What should I do if I installed a bad version?
Isolate and rebuild the affected machine or runner, pin agent-framework to 1.26.0, rotate all exposed credentials from a clean system, and review Azure logs for unfamiliar access.
#MicrosoftAgentFramework #PyPI #SupplyChainAttack #CloudSecurity #CredentialTheft #CyberSecurityNews