Two poisoned releases of the Microsoft Agent Framework reached PyPI on November 17, carrying a credential stealer that ran every time Python started on an infected machine. The attack lasted less than an hour, yet it showed how quickly a trusted name in the agent ecosystem can turn into a supply-chain hazard.
The Microsoft Agent Framework is Microsoft's open-source toolkit for building software agents, and its package on PyPI sees roughly 190,000 downloads a month, according to SecurityWeek. That popularity is what made the hijack so dangerous: any team that installed an unpinned copy during the short window may have handed over the keys to its build environment.
A short window with a wide blast radius
Version 1.26.1 of the Microsoft Agent Framework appeared on PyPI at 20:35 UTC on November 17, according to a timeline reconstructed by researchers at Wiz, JFrog, OX Security and Elastic Security Labs. Elastic's monitoring flagged the release as malicious six minutes later, at 20:41 UTC. PyPI quarantined the version at around 21:06 UTC, but the attacker simply uploaded again: version 1.26.2 arrived at 21:08 UTC with the same payload under different file names, and both releases were removed within the hour.
The speed of the response still left room for damage. JFrog reported that automated dependency bots such as Renovate were already opening upgrade pull requests in downstream repositories within six minutes of the first poisoned release landing. A single careless merge during that window could have pulled the stealer into a build pipeline.
What made the attack unusual was that victims never had to import the package. The malicious wheels shipped a tiny startup hook file into Python's site-packages folder. Python reads those hook files every time the interpreter launches, and any line starting with import is executed before user code runs. The stealer therefore fired whenever Python started, whether a test suite was running, an editor's language server woke up, or pip itself executed. The poisoned releases also kept the genuine 1.26.0 code pinned underneath, so applications kept working normally and nothing looked broken.
What the stealer went after
Once the Microsoft Agent Framework payload was running, the code made a broad sweep of the host, according to Wiz and Elastic. It collected environment variables whose names contained words such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI. It also read credential files for Azure CLI, Git, Docker, npm and Hugging Face, and pulled secret-looking values from the environments of hundreds of running processes.
The second version went further. Version 1.26.2 added targeting for GitHub Actions OIDC tokens and runner paths, and the stealer tried to mint fresh tokens from Azure DevOps pipeline endpoints and the Azure Instance Metadata Service. Elastic reported that it requested a separate token for each of twelve Azure resources, including Resource Manager, Microsoft Graph, Key Vault, Storage and Azure AI Foundry, while also collecting instance metadata such as the subscription ID and resource group.
That inventory matters because it maps closely onto what a typical agent developer's machine or build host can reach. Agent frameworks tend to run where the credentials live: cloud consoles, CI runners, container registries and model providers. A stealer that harvests that layer does not need to break the framework itself. It only needs the framework's trusted name to get installed.
What Microsoft has said, and what remains unclear
Microsoft posted a security advisory on November 25 explaining that the two releases were uploaded without authorization, and it removed the malicious uploads while temporarily making its repository unavailable during the investigation. The Register reported that a Microsoft spokesperson said some repositories were made private while the company investigates. As of the latest reports, Microsoft has not said publicly how the attacker was able to publish under its name, and researchers who have taken the code apart say the access route is still unconfirmed.
The Microsoft Agent Framework episode lands in a week when agent infrastructure has been under unusual strain. Autonomous agents on the open-source Cairn framework were reported to have found and exploited a zero-day with little human input, and the wider agent ecosystem keeps pushing more capability into shared tooling. Each new layer of shared infrastructure is also a new layer of trust, and the Microsoft Agent Framework incident shows that trust can be borrowed for 41 minutes and still do lasting damage.
What to check now
Anyone who installed the Microsoft Agent Framework around November 17 should treat the window as exposure until proven otherwise. The last clean release is 1.26.0, published on November 12, so pinning to that version is the first step. Elastic's response guidance goes further: treat everything readable on an affected host as compromised, rotate long-lived secrets, review activity for short-lived tokens that cannot be revoked, and search egress logs using the published indicators.
Teams should also audit dependency-bot pull requests opened on November 17 and any container images built during that window, since JFrog's remediation advice specifically flags those as places the poisoned Microsoft Agent Framework package could have spread silently. And for removal, responders should avoid running pip uninstall in an affected environment, because starting the interpreter fires the startup hook one more time. Use tooling that does not execute those hook files.
The lesson for agent builders is blunt: the Microsoft Agent Framework package came from the real publisher, under the real name, with working code inside. The Microsoft Agent Framework incident is a reminder that pinning dependencies, watching what bots auto-merge, and treating build hosts as high-value targets are now basic hygiene for anyone shipping agents. For more on agents operating with minimal human oversight, see how autonomous agents found a zero-day in 11 minutes, and for the platform shifts reshaping agent tooling, see Google Workspace MCP servers going live.
Sources: reporting by KB Technologies, CarbeneAI, Raj Kanjariya, and AI Agent Store's daily brief.
Comments 0
No comments yet. Be the first to share your thoughts!
Leave a comment
Share your thoughts. Your email will not be published.