Microsoft's agent-framework package on PyPI was hijacked to steal Azure and CI credentials
Versions 1.26.1 and 1.26.2 of Microsoft Agent Framework for Python stole cloud and pipeline secrets on Nov. 17. Pin 1.26.0 and rotate secrets if you installed them.
On November 17, 2026, someone published two booby-trapped versions of agent-framework — the official Python package for Microsoft Agent Framework — to PyPI, the public Python package index. Versions 1.26.1 and 1.26.2 stole cloud and CI/CD credentials from any machine where they were installed, and they were live for under an hour before removal. If any developer laptop, build runner or container picked up either version, pin to 1.26.0, rebuild, and rotate every secret that environment could reach.
What happened, in plain English
Microsoft Agent Framework is a toolkit developers use to build AI agents — programs that use a large language model (LLM) to plan steps and call tools. Python developers install it from PyPI with a single command, and it gets roughly 190,000 downloads a month, according to Aikido and SafeDep.
At 20:35 UTC on November 17, a new version, 1.26.1, appeared on PyPI under Microsoft's project. It looked normal and the framework still worked, but it carried a hidden extra: a small program that searched the machine for passwords, access tokens and cloud keys and quietly sent them to a server controlled by the attacker. When that version was pulled, a second malicious version, 1.26.2, was uploaded 33 minutes later with the same stealer under new file names.
The malicious code never existed in Microsoft's GitHub source repository; researchers say the package files were edited by hand and uploaded directly. A Microsoft maintainer confirmed on GitHub that "the compromised versions for agent-framework: 1.26.1, 1.26.2 have been pulled from the package feed" and that the company is investigating.
Think of it as a trusted delivery company dropping off a sealed box from a familiar brand — except someone swapped the contents at the depot. The label was right; what was inside was not.
The key detail: the stealer did not need the package to actually be used. Simply having it installed meant it ran every time Python started on that machine — including during routine commands like running tests.
Are you affected? What to do now
Who is affected: anyone who installed agent-framework 1.26.1 or 1.26.2 from PyPI between roughly 20:35 and 21:30 UTC on November 17, 2026 (the window differs slightly between researchers' reports). Most at risk are CI/CD pipelines and containers that install with loose version rules (for example agent-framework>=1.26) and happened to build during that window. If you pin exact versions with lockfiles or hashes and did not update on November 17, you are very likely not affected. If you do not use Microsoft Agent Framework for Python at all, there is nothing to do.
How to check:
- Run
pip show agent-frameworkin each relevant virtual environment and container; note the version. - Search lockfiles (
requirements.txt,poetry.lock,uv.lock), CI build logs and container images built since November 17 foragent-framework==1.26.1or1.26.2. - Look in
site-packagesfor files the researchers identified:agent_framework_meta.pth, theagent_framework_meta/folder,af_runtime_diag.pthoraf_runtime_diag.py. A_AF_TEL=1value in Python process environments is another sign. - Check proxy and DNS logs for outbound connections to
webhook.site(all reports name the same endpoint on that free request-capture service; full indicators are in the Wiz, Aikido and Socket write-ups linked below).
If you find either version:
- Remove it and rebuild the environment from scratch with
agent-framework==1.26.0, ideally installed with hash checking (--require-hashes). Uninstalling alone may leave the startup files behind, and it does not undo data already sent. - Treat every secret reachable from that machine or runner as stolen and rotate it: environment-variable secrets,
.envfiles, Azure CLI sessions, Azure DevOps personal access tokens and service connections, service principal credentials, GitHub, npm, PyPI, NuGet, Docker and Hugging Face tokens, and Git credentials. - Review Microsoft Entra ID sign-in and activity logs for managed identities, service principals and federated credentials used by affected virtual machines, App Services, Kubernetes (AKS) nodes and pipelines. Wiz notes stolen Azure tokens may stay valid for up to 24 hours, so rotation alone does not cut off tokens already issued.
- For GitHub Actions jobs that installed 1.26.2 with
id-token: writepermission, treat the OIDC tokens as compromised, review federated credentials that trust those repositories, and rotate the repository and organization secrets exposed to the job.
Microsoft has not published a security advisory or CVE as of this writing, and has not said how the upload happened.
The expert view
Root cause (unconfirmed). Every public analysis points the same way: the malicious wheels were legitimate builds that were unpacked, modified and re-uploaded with valid publishing credentials, outside the normal release pipeline. 1.26.1 shipped as a wheel only, with no source distribution and no matching tag or release in the GitHub repository — a break from Microsoft's usual pattern. The reporter of the GitHub issue, from Upwind Security, calls a compromised upload credential the "likely" cause. Microsoft has not confirmed that. The second upload is the most worrying signal: as SafeDep puts it, whoever controlled the publishing path still had access 33 minutes after the first version was pulled. Wiz mentions that another Microsoft package, durabletask, was compromised earlier in 2026 via a stolen PyPI token, but says the incidents have not been linked.
The mechanism. The payload abused Python's .pth startup files. Python's site module processes these on every interpreter launch, and a line beginning with import is executed. That turns "installed" into "running": pip, pytest or any script in the environment fires the stealer, which detaches into the background and suppresses errors. 1.26.2 also restored the original package initializer byte-for-byte, so a reviewer diffing only the package's main entry file would see nothing wrong. The same startup-hook technique featured in earlier PyPI compromises, including the LiteLLM package incident cited by researchers.
What it went after. This was a cloud-and-CI stealer, not a generic one. Beyond environment variables and common credential files, it read other processes' environments and actively minted fresh tokens: Azure managed-identity tokens for 12 resources (including Key Vault, Storage, Azure AI and Container Registry), Azure DevOps OIDC tokens, and in 1.26.2 GitHub Actions OIDC tokens for Azure federation. That design targets exactly where agent frameworks run — build pipelines and cloud workloads with standing identities — and shows the attacker understood how modern "secretless" federation works.
Why defenses failed. Package-name trust and the "official publisher" signal were intact; the publishing credential was the weak point. Loose version ranges and automatic dependency updates did the rest. Fast community detection limited the damage — SafeDep flagged 1.26.1 within 22 minutes and 1.26.2 within four — but a CI fleet can install a package thousands of times in an hour.
Severity in context. No CVSS score exists, because this is a malicious release, not a code flaw. For any affected environment, impact is effectively full credential compromise. The short window and the free-tier exfiltration endpoint (Wiz says it captured at most 50 requests) suggest the realised impact may be limited, but the number of victims is unknown.
Still unknown: how publishing access was obtained and whether it has been revoked; whether PyPI trusted-publisher settings were involved; how many installs occurred; whether stolen credentials have been used; and whether other Microsoft packages are at risk. No one has attributed the attack to a specific actor.
The wider lesson for AI teams: agent frameworks are now core dependencies that run in privileged pipelines. Pin exact versions with hashes, delay adoption of brand-new releases by a few hours or days, and give build jobs the narrowest cloud identities possible.
Official sources
- microsoft/agent-framework GitHub issue #10411 — report and Microsoft maintainer confirmation (November 17, 2026)
- Wiz: Malicious version of Microsoft's agent-framework published to PyPI
- Aikido: Two malicious agent-framework releases hit PyPI in 33 minutes
- SafeDep: Microsoft agent-framework compromised twice on PyPI
- Socket: agent-framework PyPI package compromised with credential stealer
- Python documentation: the
sitemodule and.pthfiles - Coverage: GBHackers