Cybersecurity · November 27, 2026 · ComputerKing Team
Even Microsoft's Official Python Package Was Swapped: agent-framework 1.26.1 and 1.26.2 Hid a Credential Stealer — Check If You Installed Them
On the evening of 17 November 2026, two new versions of Microsoft's official Python package agent-framework — 1.26.1 and 1.26.2 — appeared on PyPI, hiding code that steals cloud and development credentials. Both versions were pulled within about an hour; the safe version is 1.26.0. This guide explains how the supply-chain attack worked, who is most affected, and how to check whether your machine ever installed the tainted versions. Pricing is quoted case by case.
Key Points
On the evening of 17 November 2026, two new versions of Microsoft's official Python package agent-framework appeared on PyPI: 1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC. Neither version was Microsoft's work — both hid a credential stealer that collects cloud and development credentials and sends them, encrypted, to an address the attacker controls. Both versions were gone from PyPI by about 21:30 UTC, and the safe version is 1.26.0. This guide explains how the supply-chain attack worked, who is most affected, and how to check whether your machine ever installed the tainted versions.
1. What Happened: The Official Package, Not a Fake
The most unsettling part of this incident is that the victims did nothing wrong. No suspicious link clicked, no lookalike package downloaded, no single letter mistyped into a fake website — the problem was in the vendor's own official release.
- Not a typosquat: the attacker did not register a similarly named package to trick people. The malicious versions were pushed through a Microsoft-associated publishing account onto the official agent-framework project. Researchers believe the attacker compromised a client certificate and private key for Microsoft's internal release pipeline.
- A very short window: 1.26.1 went up at 20:35 UTC on 17 November, 1.26.2 at 21:08 UTC, and both were gone from PyPI by about 21:30 UTC. The whole incident lasted under an hour — but the package sees roughly 41,000 downloads a week, and any unpinned install or auto-update inside that window could have picked up a malicious version.
- The safe version is 1.26.0: released on 12 November, 1.26.0 is completely unaffected. PyPI Security worked with Microsoft to pull both malicious versions, and the advisories are GHSA-764m-3ppc-5m73 and PYSEC-2026-4388.
- Only the meta-package was touched: the affected package is the agent-framework meta-package. Its 22 sibling packages, including agent-framework-core, still had 12 November as their latest release and were unaffected.
2. How the Credential Stealer Works: It Runs Without Being Imported
The malicious versions did not rewrite agent-framework's own code. Instead, they added a small mechanism to the packaging — one that lets the stealer run while most users notice nothing.
- One .pth file is enough: 1.26.1 added agent_framework_meta.pth, and 1.26.2 added af_runtime_diag.pth. Python executes the import lines in .pth files inside site-packages every time the interpreter starts — so the stealer runs whenever Python starts in that environment, even if nothing ever imports agent-framework.
- What it steals: environment variables that look like credentials, including names containing TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI; credential files covering Azure CLI configuration, npm, pip, netrc, Git, Docker, Hugging Face and Azure DevOps credentials, plus .env files; and freshly minted identity tokens from Azure and GitHub Actions.
- How it sends them out: everything is compressed, encoded, and sent in a single HTTPS request to a webhook.site address controlled by the attacker. The whole process runs in the background, with nothing visible to the user.
- Why the second version is sneakier: 1.26.2 was published after PyPI had quarantined 1.26.1, with the payload moved to a different file so a diff between the two versions does not immediately reveal it. That also proves whoever published 1.26.1 still had publishing access afterwards.
3. Who Is Most Affected
- Teams building AI agents with Microsoft Agent Framework: the package is designed for building AI agents, so its users' environments typically hold cloud logins, CI credentials and AI service keys — exactly what this stealer targets.
- CI servers and automation pipelines: an unpinned pip install resolves to the latest version, so any CI run inside the window could have installed a malicious version.
- Ordinary users are barely affected directly: if your machine never installed Python packages, this incident has little direct impact on you. But that is exactly why many people will overlook the indirect risk in the next section.
4. How to Check Whether You Were Hit
- Check the version: open a terminal and run pip show agent-framework. Version 1.26.0 is safe; 1.26.1 and 1.26.2 are the tainted versions.
- Search your records: look through project lockfiles, install logs and CI run logs for agent-framework 1.26.1 or 1.26.2.
- Check for .pth files: look in Python's site-packages directory for agent_framework_meta.pth or af_runtime_diag.pth. Either one is evidence of infection.
- A clean version now does not prove you are safe: if a machine installed a malicious version and was later upgraded to a safe one, credentials may already have leaked. The next section covers what to do.
5. If You Suspect Infection, Do This First
- Do not start Python again: in an affected environment, every Python start runs the stealer again.
- Remove the malicious files with shell tools: do not use Python itself to remove them — use system shell tools to delete the .pth file and the payload files.
- Isolate the machine: take the affected computer or server off the company network and away from cloud services.
- Rotate every credential it could have reached: Azure logins, GitHub Actions credentials, Azure DevOps credentials, AI service keys, Docker logins — change them all. Do not change just one, because you cannot know which ones leaked.
- Revoke runtime credentials: GitHub Actions and Azure DevOps runtime credentials must be revoked, not merely re-issued as new passwords.
6. You Don't Write Code and It Still Matters: The Risk of Random AI Tools
This incident targeted developers, but the lesson applies to ordinary users too. Many AI desktop tools and automation tools are built from Python packages under the hood; a 'free AI assistant' downloaded at random from the web could easily be the next tainted install.
- Install only from official channels: apps and packages should come only from official websites, official stores, or channels your company IT department has approved.
- Don't install AI tools from unknown sources: free tools with exaggerated claims, available only from a single unknown website, carry the highest risk.
- Let IT manage company machines centrally: package versions should be pinned, not left to auto-fetch the latest release on every machine.
- Don't leave credentials sitting on a machine: cloud logins and API keys should be revoked or rotated regularly, not left in environment variables or config files indefinitely.
Frequently Asked Questions
I don't write code. Does this affect me?
Directly, very little — the tainted package is one developers use. But the indirect risk matters: many AI desktop tools and automation tools are built from Python packages underneath. If you install random 'free AI assistant' tools from unknown websites, this incident is a warning — install only from official channels and don't trade safety for convenience.
How do I know if I installed an affected version?
Open a terminal and run pip show agent-framework: 1.26.0 is safe, while 1.26.1 and 1.26.2 are the tainted versions. Also search project lockfiles and install logs for those two version numbers, and check site-packages for agent_framework_meta.pth or af_runtime_diag.pth.
Why would I be infected without ever importing the package?
Because the malicious versions added a .pth file to site-packages. Python executes the import lines in .pth files every time the interpreter starts, so simply launching Python runs the credential stealer — no code ever needs to import agent-framework.
I suspect infection. What is the first step?
Do not start Python again in the affected environment, because every start runs the stealer again. Then remove the .pth file and payload with system shell tools, isolate the machine, and rotate every credential it could have reached — Azure, GitHub Actions, Azure DevOps and AI service keys — revoking runtime credentials as well.