Two releases of Microsoft’s own AI agent library carried a credential stealer that fired every time Python started. Nobody had to import the package for it to run.
In short: on 17 November 2026, versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI were published with a hidden startup hook that harvested Azure, Azure DevOps and GitHub Actions credentials and posted them to a webhook. Both were pulled within the hour, and 1.26.0 is the last clean version. If either version ever landed in your environment, assume its secrets are gone.
What happened in the Microsoft Agent Framework PyPI attack?
An attacker uploaded two wheel-only releases of agent-framework, a Python package with roughly 190,000 monthly downloads according to Orca Security and SafeDep. The legitimate 1.26.0 had shipped on 12 November with both a wheel and a source archive; the poisoned versions had only wheels.
Neither release changed the framework’s real code or added a dependency. The package kept working, which is exactly why automated update bots happily picked it up. JFrog says Renovate pull requests appeared within six minutes of 1.26.1 landing.
When I checked on 28 November, PyPI listed 1.26.0 as the latest release and the microsoft/agent-framework GitHub repository returned a 404. SecurityWeek reported the repository was already unreachable on 18 November and says it is unclear whether that is linked to the attack.
Timeline
| Time (UTC, 17 Nov 2026) | Event | Source |
|---|---|---|
| 20:26 | Malicious wheel repacked locally | JFrog |
| 20:35 | agent-framework 1.26.1 published | GitHub advisory, Wiz, SafeDep |
| 20:57 | SafeDep flags 1.26.1 as malicious | SafeDep |
| 21:06 | 1.26.1 quarantined | JFrog |
| 21:08 | agent-framework 1.26.2 published | GitHub advisory, Wiz |
| 21:12 | SafeDep flags 1.26.2 | SafeDep |
| 21:16 to 21:30 | Both versions gone from PyPI | JFrog says 21:16, Wiz says by about 21:30 |
GitHub published advisory GHSA-764m-3ppc-5m73 on 18 November. It lists no patched version, because the fix is simply not to use 1.26.1 or 1.26.2.
How did the stealer work?
The trick was a .pth file. Python reads these files from site-packages at startup and executes import lines inside them, so the payload ran on every interpreter launch.
According to the GitHub advisory, Wiz and JFrog, the payload:
- forked into a detached background process and set an
_AF_TELmarker so it ran once - collected environment variables whose names contain strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB and OPENAI, plus secrets from up to 300 other processes via
/proc - read credential files including Azure CLI state,
.npmrc,.netrc,.git-credentials, Docker config, Hugging Face tokens and.envfiles - requested Azure managed-identity tokens for 12 resources and Azure DevOps OIDC tokens
- compressed everything and sent one HTTPS POST to a webhook.site URL
Version 1.26.2 changed tactics. It restored the original __init__.py byte for byte, moved the payload into new files named af_runtime_diag.pth and af_runtime_diag.py, and added GitHub Actions OIDC token theft for workflows with id-token: write. Orca reads the clean __init__.py as an attempt to beat diff-based review.
How did the attacker get publishing access?
This is where sources disagree, and nobody has a confirmed answer.
| Source | Explanation |
|---|---|
| Wiz | Attacker appears to have used a stolen client certificate and key for Microsoft’s ESRP release pipeline; a first attempt from AWS was blocked by IP filtering, a second from Microsoft-owned IP space succeeded |
| SafeDep | A PyPI account called vibiret, created on 17 November, appears as a maintainer with rights to agent-framework and five sibling packages; not confirmed as the uploader |
| JFrog | The wheels were repacked on a local machine, not built by Microsoft’s pipeline |
These may fit together, but no source says so. None of the four pages I read quotes an official Microsoft statement. SecurityWeek reports that a project maintainer confirmed the removal and an investigation on GitHub.
Was AI involved?
Wiz reports that the attacker’s tooling named itself Cairn and staged files under /tmp/cairn_pkg. Cairn is an open-source AI pentest framework that already turned up in a zero-day intrusion we covered in Cairn: the AI agents that found a zero-day on their own. Wiz also saw a configuration for an AI coding-agent harness with a GLM-family model.
That tells you about the tooling, not the operator. No source attributes the attack to a known group.
The catch: it was sloppy, and that helped
The stealer was not well engineered. Wiz found the exfiltration endpoint was a free webhook.site token, which caps at 100 requests. Of the 50 requests Wiz could account for, only 17 came from 3 distinct real victims; the rest were the attacker’s own tests, sandboxes and vendor scans.
JFrog found the Azure DevOps token request was malformed and would fail on real Azure DevOps, and that there was no persistence, worm or second stage. It also found the same webhook leaked the attacker’s own progress reports, which is how Wiz reconstructed much of the story.
Do not read that as “low risk”. Stolen managed-identity tokens can be valid for up to 24 hours, per Wiz, and three real victims is enough for a breach. It is the same pattern as the 1Password breach that started with a stolen GitHub token: one developer credential reaches production.
What should defenders do?
- Search lockfiles, CI logs, virtual environments, container images and package mirrors for
agent-framework1.26.1 or 1.26.2. - Look in
site-packagesforagent_framework_meta.pthoraf_runtime_diag.pthwithout starting Python. JFrog warns that running pip in an infected environment triggers the hook, so neutralise it first. - Rotate every secret reachable from an affected host or runner: Azure service principals, Azure DevOps tokens and service connections, GitHub tokens, npm, PyPI, Hugging Face and registry credentials. JFrog adds that cached Entra ID refresh tokens survive password resets.
- Hunt in proxy and DNS logs for POSTs to webhook.site and the User-Agents
af-runtime-diagnostics/1andruntime-diagnostics/1. Wiz notes HTTP 200 means data was accepted. - Audit Azure managed identity sign-ins, federated credentials and GitHub Actions runs from 17 November onward.
- Pin to 1.26.0 with hash checking and evict cached malicious wheels from internal mirrors using the hashes in the GitHub advisory.
The same habits would have blunted PolinRider’s poisoned GitHub repositories: pin with hashes, delay auto-merging fresh releases, and treat CI runners as production.
The bottom line
The Microsoft Agent Framework PyPI attack lasted under an hour and still reached real victims, because a .pth hook runs before anyone imports anything. The publishing path is still unexplained, so a trusted vendor name was not protection. If 1.26.1 or 1.26.2 ever touched a machine, rotate first and investigate second.
Sources
- GitHub Advisory Database, Malicious code in agent-framework (PyPI), GHSA-764m-3ppc-5m73, 18 November 2026
- Wiz, Microsoft agent-framework compromised: credential stealer targets Azure and CI pipelines, 18 November 2026
- SafeDep, Microsoft agent-framework compromised twice on PyPI, updated 23 November 2026
- JFrog Security Research, Microsoft’s agent-framework hijacked on PyPI via silent .pth startup hook, 18 November 2026
- Orca Security, Microsoft Agent Framework PyPI supply-chain attack, 18 November 2026
- SecurityWeek (Eduard Kovacs), Microsoft Agent Framework releases poisoned with credential stealer, 18 November 2026
- PyPI, agent-framework release history, checked 28 November 2026
This article is written for defenders and authorised security testers. Only test systems you own or have written permission to assess.