Microsoft's Python agent toolkit briefly shipped password-stealing code
Anyone who installed version 1.26.1 or 1.26.2 of Microsoft's Python package for building AI agents should treat their passwords and access keys as exposed. The package was hijacked, and 1.26.2 went up through Microsoft's own publishing account carrying code that steals secrets.
The Register reported that Microsoft's agent-framework package for Python was compromised on PyPI, the main Python package site. Versions 1.26.1 and 1.26.2 are affected. Security firm OX Security says 1.26.1 was later reverted to a safe version, but the attacker uploaded 1.26.2 through Microsoft's official publisher account.
The bad code runs as soon as Python starts, even if you never use the package. It installs the real 1.26.0 so everything still seems to work.
It gathers environment variables and credential files for Azure, Git, Docker, Hugging Face and other services. It also asks for fresh identity tokens from GitHub Actions, Azure DevOps and Azure. It sends the data to a webhook address built into the code.
The code isn't persistent. It runs only while the bad version stays installed. The Register advises that anyone who finds it should assume they have account security work to do.
New to this? The key idea
A package registry such as PyPI is a shared shop where developers download ready-made code with one command. If an attacker gets into a publisher's account, they can swap in a poisoned version that looks official. Installing it is like accepting a parcel from a trusted courier whose uniform was stolen.
Use it at work
Use it for: checking whether you were hit. Developers, platform engineers and security teams who run Python builds should care.
Try it: check your environments and build systems for agent-framework 1.26.1 or 1.26.2. The article gives no commands or official fix steps. The bad code runs as soon as Python starts, even if you never import the package, and it installs the real 1.26.0 so everything still seems to work.
Before you roll it out: treat any secrets on an affected machine or build runner as exposed and rotate them, but the article does not spell that out. It says anyone who finds the package should assume they have account security work to do. The package has nearly 200,000 monthly downloads. A safe release is not named in the article. The code is not persistent and runs only while the bad version stays installed. It collects environment variables and credential files for Azure, Git, Docker and Hugging Face, asks for fresh identity tokens from GitHub Actions, Azure DevOps and Azure, and sends the data to a webhook address built into the code. The root cause appears to be unauthorized access to an administrator account on Microsoft's GitHub organization. The article was published 18 November 2026.
Summaries are written by AI from the linked source. Always check the original.