AI Security
Microsoft Agent Framework PyPI Compromise: What Happened
Codesprint Consulting
By,Codesprint Consulting
  • 23 November 2026

The Microsoft Agent Framework PyPI package was compromised on November 17, when two wheel-only releases, versions 1.26.1 and 1.26.2, appeared under the project's real name carrying a credential stealer that the clean 1.26.0 release does not contain. Both versions were pulled from PyPI within the hour, and the GitHub Advisory Database entry GHSA-764m-3ppc-5m73 now classifies the package as malicious with no patched version: the fix is to stay on or return to 1.26.0. Source: Malicious code in agent-framework (PyPI), GitHub Advisory Database

The package is the Python metapackage for Microsoft's open-source framework for building and orchestrating AI agents on Azure, and it averages roughly 196,000 downloads a month across all versions. Elastic Security Labs, which flagged the first release as malicious six minutes after it published, puts the consequence plainly: if either version touched a build agent or a laptop, assume every secret on that host is gone. Source: We caught the agent-framework PyPI compromise six minutes after it published, Elastic Security Labs

The two poisoned releases

Version 1.26.1 was published at 20:35 UTC on November 17, and 1.26.2 followed at 21:08 UTC with the same stealer renamed. Both were wheel-only releases: no source distribution, no corresponding git tag, and the package's main branch never contained the malicious code, which is a useful tell on its own. The rest of each wheel matched the clean 1.26.0, and the dependency pin was unchanged. Source: We caught the agent-framework PyPI compromise six minutes after it published, Elastic Security Labs

The second release matters for what it added. According to the GitHub advisory, 1.26.2 extended the stealer to GitHub Actions OIDC tokens and the /home/runner paths used by hosted runners, and raised its captured-file limit from 60 to 80. That is an iteration cycle measured in minutes, aimed squarely at CI infrastructure. Source: Malicious code in agent-framework (PyPI), GitHub Advisory Database

How the .pth hook fires

The delivery mechanism is a Python startup hook rather than any code inside the library's API. Each wheel added an executable .pth file to site-packages. Python's site module processes .pth files at every interpreter start, executing any line that begins with import, so the stealer ran as soon as Python launched in that environment, including pip itself. Importing agent_framework was never necessary. Source: Malicious code in agent-framework (PyPI), GitHub Advisory Database

In 1.26.1 the hook lived in agent_framework_meta.pth and a modified __init__.py that imported a _telemetry module and called its _start() function. In 1.26.2 the files were renamed af_runtime_diag.pth and af_runtime_diag.py, the package __init__ was restored to the clean 1.26.0 content, and the module started itself on import, leaving the .pth as the only trigger. The helper detached into a background process using fork and setsid, guarded by an environment marker so it ran once per process tree, and silenced all errors, so the theft added no visible delay. On Windows, where fork is unavailable, it fell back to a background thread. Source: We caught the agent-framework PyPI compromise six minutes after it published, Elastic Security Labs

What the stealer takes

The collection list reads like an inventory of where CI secrets live. The stealer harvested environment variables whose names contain strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, HF_, OPENAI, NPM, PIP, or CI_, then read the environments of up to 300 other running processes through /proc. On disk it went after Azure CLI token caches, pip and npm configuration, .netrc, .git-credentials, Docker's config.json, Hugging Face tokens, Azure DevOps agent .credentials files, and .env files. Source: Malicious code in agent-framework (PyPI), GitHub Advisory Database

It did not stop at stored secrets. The code called Azure's instance metadata service and the IDENTITY_ENDPOINT used by App Service managed identities, exchanged Azure DevOps OIDC tokens using SYSTEM_ACCESSTOKEN, and in 1.26.2 did the same for GitHub Actions OIDC tokens. Those calls mint fresh cloud credentials on the spot, which is why rotating only the files on disk is not enough: Wiz notes that managed-identity and OIDC-exchanged tokens can stay valid for up to 24 hours. Source: Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines, Wiz

Everything collected was zlib-compressed, base64-encoded, and sent in a single HTTP POST to a webhook.site URL, the same endpoint in both releases. There was no second stage, no fallback channel, and no remote-control capability, so removing the .pth file and its module stops the theft, but anything already posted is gone. Source: Microsoft agent-framework PyPI 1.26.1 and 1.26.2 .pth credential stealer, Corgea

The stolen ESRP certificate

The more uncomfortable question is how the attacker published under Microsoft's name at all. In a November 18 update, Wiz reported that the attacker appears to have compromised a client certificate and private key for Microsoft ESRP, the Engineering System Release Pipeline that Microsoft uses to sign and publish the package. ESRP's IP filtering rejected the first publish attempt, which came from AWS; a second attempt from Microsoft-owned IP space succeeded. How the certificate and key were obtained is not yet known. Source: Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines, Wiz

Wiz could reconstruct part of the operation because the attacker's tooling reported its own progress to the same public webhook.site URL used for stolen data. The tooling identifies itself as Cairn, an open-source AI penetration-testing framework, staged the package at /tmp/cairn_pkg, and sent a connectivity probe named CAIRN_ESRP_PROBE2. Of the 50 requests the free-tier webhook retained, Wiz attributes four to the attacker, 29 to sandboxes and scanners, and 17 to only three distinct victims whose data was successfully exfiltrated. Source: Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines, Wiz

A PyPI account named vibiret, created the same day as the attack, is still listed as a maintainer on agent-framework and five sibling projects, though PyPI does not publish who uploaded a given file and nothing has confirmed that account's involvement. Separately, the microsoft/agent-framework GitHub repository has been private since November 17, and the ONNX Runtime repositories also went dark; a Microsoft spokesperson told The Register only that "we have made some repositories private while we investigate malicious content," and neither Microsoft nor researchers have linked the ONNX repositories to the malware. Source: Microsoft's official Python agent framework hijacked to distribute malware, The Register

What to do if you installed 1.26.1 or 1.26.2

The consensus guidance across the advisory and the research write-ups is consistent. First, confirm whether either version was ever installed, remembering that pip itself would have executed the hook during install. Second, rebuild the environment rather than patching it in place; simply downgrading is not enough, because the theft already happened and the .pth file ran at every interpreter start. Source: Microsoft agent-framework PyPI 1.26.1 and 1.26.2 .pth credential stealer, Corgea

Third, rotate everything the host or job could reach: Azure CLI sessions, Azure DevOps PATs and service connection secrets, GitHub Actions credentials, npm, PyPI, NuGet, Docker and Hugging Face tokens, git credentials, OpenAI and Azure OpenAI keys, and anything in .env files. Fourth, review sign-in logs for every managed identity and federated credential the host or pipeline could use, and check egress logs for the webhook.site endpoint: a 200 response means that host's data was accepted. Until Microsoft confirms the publishing path is clean, Corgea recommends pinning agent-framework and its siblings by version and hash with pip install --require-hashes. Source: Microsoft agent-framework PyPI 1.26.1 and 1.26.2 .pth credential stealer, Corgea

Our read: watch the publish event, not just the commit

Our assessment is that the durable lesson is where the attack sat in the pipeline. The malicious code never touched the source repository; a stolen signing-pipeline credential let the attacker skip it entirely, so teams that monitor commits and pull requests saw nothing. Registry publish events are the control point that would have caught this, and Elastic's six-minute detection shows that monitoring them works. This incident also rhymes with the LiteLLM supply chain attack we covered earlier, where a poisoned package release was again the vector, and it reinforces the permission-review cadence in our AI agent security checklist: agents and their build environments now hold exactly the token collections these stealers are built to find.

FAQ

Versions 1.26.1 and 1.26.2, both published on November 17, 2026 and since removed from PyPI. Version 1.26.0 and earlier are not affected, and there is no patched release: the fix is to stay on or return to 1.26.0. Source: Malicious code in agent-framework (PyPI), GitHub Advisory Database

No. Both wheels installed a .pth startup hook that Python executes at every interpreter launch, including pip itself. Installing the package was enough; importing agent_framework was never required. Source: Malicious code in agent-framework (PyPI), GitHub Advisory Database

Environment variables with secret-looking names, credential files for Azure, npm, git, Docker, and Hugging Face, other processes' environments via /proc, and freshly minted tokens from the Azure metadata service, Azure DevOps OIDC, and in 1.26.2 GitHub Actions OIDC. Source: We caught the agent-framework PyPI compromise six minutes after it published, Elastic Security Labs

Wiz reports the attacker appears to have used a stolen client certificate and private key for Microsoft's ESRP signing and publishing service, succeeding on a second attempt from Microsoft-owned IP space after IP filtering rejected the first. How the credentials were obtained is not yet known. Source: Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines, Wiz

No. Downgrading stops future executions of the hook, but the stealer already ran at install and at every interpreter start since. Affected environments should be rebuilt, every reachable credential rotated, and Azure sign-in and egress logs reviewed. Source: Microsoft agent-framework PyPI 1.26.1 and 1.26.2 .pth credential stealer, Corgea

Tag:
  • microsoft agent framework pypi
  • supply chain attack
  • pypi malware
  • credential stealer
  • azure devops

Have a project in mind? Let's talk.

Drop Us a Line

Connect with Codesprint Consulting

Ready to take the first step towards unlocking opportunities, realizing goals, and embracing innovation? We're here and eager to connect.

Your Success Starts Here!