Microsoft AI Agent Framework Hit by PyPI Supply Chain Poisoning: 55 Minutes Online, Three Cloud Credential Leaks Confirmed

A malicious version of Microsoft's agent-framework Python package was published to PyPI on November 17, 2026, remaining available for about 55 minutes and

At 20:35 UTC on November 17, 2026, malicious version 1.26.1 of Microsoft's AI agent framework Python package agent-framework appeared on PyPI. Thirty-three minutes later, 1.26.2 went live, expanding the scope of the attack. By 21:30, both versions had been removed, leaving an attack window of about 55 minutes. This is the first documented supply-chain attack on the official package of a mainstream AI agent framework. The package has about 190,000 monthly downloads, and according to Wiz Research, the incident has resulted in three confirmed credential leak cases.

How the Attack Hijacked Every Python Startup

To understand the destructive impact of this attack, one must first understand the entry point it chose. The attacker did not replace the package's core functionality code; instead, they planted an additional .pth file in the malicious versions—named agent_framework_meta.pth in version 1.26.1 and af_runtime_diag.pth in version 1.26.2. .pth files reside in Python's site-packages directory, and the Python interpreter automatically scans and executes .pth files in that directory every time it starts, without any code explicitly importing the relevant package. This means that even if a developer never writes import agent_framework in their code, as long as a compromised version is installed in the environment, the credential stealer will run silently every time a Python process starts—including when pip itself runs.

The malicious code was carefully disguised. The stealer module was named _telemetry.py and identified externally as "af-runtime-diagnostics," fully mimicking legitimate runtime diagnostic reporting. According to OX Security's analysis, the stolen data was sent to an attacker-controlled webhook address as zlib-compressed, base64-encoded JSON. The malicious versions also retained the complete legitimate framework code, so the application's business logic was unaffected and could run normally. With no business-level anomaly signals, this type of attack is almost invisible in routine security operations.

According to CSO Online, the stealer's scope was extremely broad: all environment variable values containing strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, and OPENAI; Azure CLI configurations, Git and Docker credentials, npm and pip configurations, HuggingFace tokens, Azure DevOps build agent credentials, and application .env files. The stealer also actively extracted secrets from as many as 300 running processes and sent token requests to the Azure managed identity service, attempting to obtain access to 12 Azure services including Resource Manager, Key Vault, and AI Foundry. Version 1.26.2 added the ability to steal GitHub Actions OIDC tokens on top of this.

Internal Publishing Infrastructure Compromised

The attacker did not obtain publishing privileges through a conventional account password leak. According to Wiz Research, the attacker stole the client certificate and private key for Microsoft's ESRP (Engineering System Release Pipeline), an internal Microsoft service specifically used to sign and publish Python packages. The attacker's first publishing attempt was launched from an AWS IP address and was blocked by ESRP's IP filtering rules; a second attempt from Microsoft's own IP range then successfully bypassed this defense and completed the upload of the malicious package.

The toolset used by the attacker identified itself as Cairn, an open-source AI penetration testing framework. The webhook logs exposed by the tool contain a CAIRN_ESRP_PROBE2 probe request, which recorded the attacker's operational process. Before officially publishing the malicious package, the attacker had tested and run the stealer on their own machine; this run unexpectedly captured the attacker's own AI coding agent configuration, which showed use of an open-source Pi harness based on the GLM series model (pi_glm53), routed through a local proxy. This detail allowed Wiz Research to observe part of the attacker's operational traces.

SafeDep researchers also found a maintainer account named vibiret on PyPI. The account was created on the day of the attack and had publishing privileges for agent-framework and five other related projects, but according to SecurityWeek, its direct connection to this malicious upload has not yet been confirmed. Microsoft has also not publicly explained exactly how the credentials were obtained.

AI Agent Frameworks Become Higher-Value Attack Targets

Judging from the target selection, agent-framework was not a random target. The typical use case for AI agent frameworks is automated systems with large numbers of API keys and cloud access permissions—AI agents need to call multiple external services such as OpenAI, Azure, and HuggingFace, and these credentials are stored centrally in the same environment. According to Endor Labs' analysis, the core target of this attack was precisely automated build systems: "Developer laptops were in scope, but the payload was designed for CI runners and Azure workloads."

In modern software engineering practice, CI/CD pipelines usually hold the highest-privilege cloud credentials and can access production databases, deployment keys, and AI services. Once a Python process in a pipeline environment is compromised, the tokens obtained can be used to move laterally across the entire cloud estate within a short time. This makes AI agent frameworks more valuable attack targets than packages relied on by traditional web applications.

The symbolic significance of this attack exceeds the three leak cases themselves. agent-framework is a package officially released and maintained by Microsoft and uses Microsoft's internal signing service—exactly the source developers typically regard as "trustworthy." When the official publishing channel itself is compromised, a fundamental crack appears in the trust chain at the package manager level. A long-standing default assumption in the developer community—that packages from major vendors' official accounts are safer than third-party packages—is being directly challenged by this incident.

Historical Precedent: Microsoft's Second Package Poisoning in the Same Year

Microsoft had already experienced a similar incident earlier in 2026. According to Wiz Research, the PyPI token for another Microsoft Python package, durabletask, had previously been stolen, also leading to a supply chain intrusion, but the two incidents have not yet been linked to the same attacker. The fact that two incidents occurred in the same year shows that this is not an occasional stroke of bad luck, but rather systematic exploration of attacks against Microsoft's publishing infrastructure.

From a broader perspective, the use of Python startup hooks (.pth files) as an attack payload injection mechanism was not invented by the agent-framework incident. According to Endor Labs' analysis, last month's poisoning of LiteLLM 1.107.0 used exactly the same technical path—also a Python startup hook, also credential theft. The rising frequency of this mechanism in supply chain attacks means it is evolving from an "advanced technique" into a replicable attack template.

However, most previous PyPI supply chain attacks targeted third-party-maintained, lesser-known packages, or were carried out through typosquatting. Compromising internal publishing infrastructure (rather than directly stealing an individual PyPI account) to poison a core framework package with an average of 190,000 monthly downloads represents a clear upgrade in the sophistication of supply chain attacks.

Operational Priorities for Enterprises and Developers

For affected enterprises, several security organizations including OX Security and Endor Labs have given consistent remediation recommendations:

  • Check all development environments, CI/CD pipelines, and container images to confirm whether versions 1.26.1 or 1.26.2 are installed
  • Treat all CI jobs that ran with a Python environment between 20:35 and 21:30 UTC on November 17, 2026 as potentially compromised, and immediately rotate Azure-, GitHub-, and OpenAI-related tokens
  • Check cloud resource access logs for anomalies, especially records of Azure managed identity token usage
  • After confirming safety, rebuild affected environments with version 1.26.0

Beyond emergency response, this incident provides a concrete case for advancing dependency management standards. Pinning dependencies to verified hashes (pip install --require-hashes), or performing secondary verification of upstream packages through a private mirror repository, can block the automatic installation path as soon as a malicious version is published. Previously, many teams regarded version range constraints as a sufficiently safe measure; this incident provides the most direct counterexample.