Malicious Microsoft Agent Framework releases put developer credentials at risk
Two Python package versions were removed from PyPI after researchers found code that could steal cloud credentials when an affected Python environment starts.
How this story was made
This story was written with AI assistance from github.com’s source documents. Its figures and quotations were checked against their sources, and Digitalage Desk reviewed and approved it before publication. It is published under the name of Peter Michaels, Editor.
Two releases of `agent-framework`, the Python package used for Microsoft Agent Framework, have been identified as malicious, prompting a warning that developers who installed them should treat accessible credentials as exposed. A GitHub security advisory published November 18 identifies versions 1.26.1 and 1.26.2 and says both have been removed from the Python Package Index, or PyPI.
The advisory identifies version 1.26.0 and earlier as unaffected by this malicious code.
The package did not need to be imported
The malicious releases added startup files that could execute code when Python launched in an affected environment. A developer did not have to import the Agent Framework library into an application for the payload to run.
That behavior exploits a documented Python mechanism. The language’s startup documentation explains that executable configuration lines can run during initialization regardless of whether the associated module will be used. Disabling the normal site initialization changes that behavior.
Primary sourcegithub.com: “Malicious code in agent-framework (PyPI)”Removing a release does not clear every copy
In the original report on Microsoft’s project repository, Upwind Security researcher Lidor Machluf warned that the removed versions could remain in package caches, continuous-integration caches and internal mirrors. A Microsoft project member subsequently confirmed that both compromised versions had been pulled and said the company was investigating.
Machluf’s remediation guidance calls for removing the malicious startup hooks before running Python-based package tools, rebuilding affected images and clearing cached copies. He also recommends rotating exposed long-lived secrets and reviewing cloud activity and role assignments where short-lived identity tokens were accessible.
The distinction is consequential: taking a malicious download offline stops one distribution route, while copies already installed or cached can still require cleanup. The advisory’s credential-rotation warning applies to secrets reachable from an affected environment, not just credentials belonging to the Agent Framework package itself.
End of story


