Microsoft AI agent package poisoned on PyPI

Microsoft Agent Framework

Attackers published two malicious versions, 1.26.1 and 1.26.2, of agent-framework, the PyPI package for Microsoft’s open-source framework for building AI agents, on November 17. The releases planted a file that runs on every Python start, even if the package is never imported, and stole credential files, environment secrets and freshly issued Azure, Azure DevOps and GitHub Actions tokens, sending them to an attacker-controlled webhook. PyPI quarantined both versions, and Microsoft made some GitHub repositories private while it investigates. On November 25 Microsoft’s Dan Taylor said the repository would stay offline until it is shown to be safe, and the company has given no restore date. How the attacker got publishing access has not been confirmed.

Versions 1.26.1 and 1.26.2 of agent-framework, the meta-package for Microsoft’s open-source framework for building AI agents, went up on PyPI 33 minutes apart on November 17, The Hacker News reported. Security firms including Aikido, Endor Labs, Socket, StepSecurity and Wiz flagged them. Each wheel dropped a .pth file into site-packages, which Python runs at every interpreter start, so the stealer fired even when the package was never imported, including when pip ran.

The malware gathered Azure CLI files, .npmrc, .git-credentials, Docker configs, Hugging Face tokens and .env files, and it requested fresh Azure DevOps OIDC and managed-identity tokens rather than only reading stored ones. Version 1.26.2 also went after GitHub Actions OIDC tokens. Stolen data was compressed, encoded and posted to a webhook.site address.

Microsoft made some repositories private, including microsoft/agent-framework and microsoft/onnxruntime, “while we investigate malicious content,” a spokesperson told The Register on November 18. The Register reported that researchers believed the attacker likely gained access to an administrator account on Microsoft’s GitHub organization. Microsoft hasn’t confirmed how the uploads were made.

In an update dated November 25, Microsoft principal product architect Dan Taylor said the malicious code came through two unauthorized PyPI releases, not through the repository, and that both were removed. He said the other Agent Framework Python packages, the .NET packages and Semantic Kernel weren’t affected, and that the repository would stay offline as “a necessary precaution” until Microsoft can show it is safe to restore, The Register reported on November 30. Taylor apologized for the disruption and said the framework “has not been discontinued.” Microsoft advised anyone who installed either bad version to treat the system as compromised and rotate credentials, and others to pin to version 1.26.0.

Summary of published news reports, linked above. Microsoft Agent Framework has no connection to Loop Data.