Microsoft Agent Framework 1.26.1 and 1.26.2 Ran a Credential Stealer

Malicious agent-framework 1.26.1 and 1.26.2 sat on PyPI for about an hour on November 17 and ran a credential stealer at every Python start. Here is how to check your builds and what to rotate.

By Rajesh Beri·November 17, 2026·9 min read
Share:
A rack of CI build servers in a dim server room, one unit's status light glowing red, with a thin network cable running from it out through a gap in the wall.

Illustration generated using AI

If any machine in your estate ran pip install agent-framework between 20:35 and about 21:30 UTC on November 17, 2026, treat every secret that machine could reach as stolen. Two releases of Microsoft's Python package for building agents, versions 1.26.1 and 1.26.2, carried a credential stealer that ran every time Python started on that host, whether or not your code imported the framework. The stealer collected environment secrets, cloud CLI files, Azure managed-identity tokens and Azure DevOps OIDC tokens, and in 1.26.2 GitHub Actions OIDC tokens too, then posted them to an attacker's webhook. The last clean release is 1.26.0.

The window was short and the attacker's collection point was small. Neither fact tells you whether your build was one of the hosts that got through, and a container image built during that hour still carries the payload today.

What Happened to agent-framework on PyPI?

An attacker uploaded two malicious wheels of Microsoft's official agent-framework package to PyPI on November 17, and both were gone within about an hour. Wiz's timeline puts 1.26.1 at 20:35 UTC, 1.26.2 at roughly 21:08 UTC, and both unavailable by about 21:30 UTC. The legitimate 1.26.0 had shipped on November 12. The PyPI project page now shows 1.26.1 and 1.26.2 as quarantined, which under PyPI's quarantine feature means administrators have hidden them from the index so they cannot be installed.

Microsoft Agent Framework is the company's open-source SDK for agents and multi-agent workflows. Microsoft's own documentation calls it "the direct successor" to Semantic Kernel and AutoGen, and its Python quickstart is a bare pip install agent-framework. OX Security, which detected the releases independently, puts the package at 192,534 downloads a month.

Two things are still unknown as of November 18. The first is how the attacker published. Wiz found no matching release tag in the microsoft/agent-framework repository and no malicious code on the main branch, and notes that 1.26.1 was a wheel-only upload that still pinned the genuine agent-framework-core 1.26.0, which suggests a direct upload outside the normal release process. OX offers only that attackers "found a way to hijack the wheel creation flow." The second is Microsoft's account. The repository's security advisories page lists eight advisories, none about this incident, and neither research firm quotes a Microsoft statement. Everything below about the payload comes from those two researchers.

How Did It Run Without Being Imported?

The payload rode in on a .pth file, and Python executes those at interpreter startup. A .pth file is a small text file in site-packages that normally adds directories to Python's import path. Python's site module documentation says lines that start with import "are always run at Python startup ... regardless of whether a particular module is actually going to be used."

So installing the package was enough. Every later python process on that host or in that virtualenv ran the stealer: test runs, linters, an unrelated script. Per Wiz, 1.26.1 dropped agent_framework_meta.pth, which started a detached background process and set _AF_TEL=1 so it fired once per process tree. Version 1.26.2 restored Microsoft's clean __init__.py and moved the hook to a new af_runtime_diag.pth. A scan that only looks for the 1.26.1 filenames will miss the second release.

Python is deprecating this behaviour, slowly. The same documentation says import lines in .pth files are deprecated from Python 3.15 but still executed, and are silently ignored only in 3.18 and 3.19. Every Python version you run in production today executes them.

What Did the Stealer Take?

It took anything that looked like a credential, from three places: environment variables, files on disk and Azure's token endpoints. According to Wiz:

  • Environment variables with names containing strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI and HF_, read from its own process and from up to 300 other processes' /proc/*/environ.
  • Credential files, up to 60 in 1.26.1 and 80 in 1.26.2: Azure CLI state under ~/.azure/, .npmrc, pip.conf, .netrc, .git-credentials, .docker/config.json, Hugging Face tokens, Azure DevOps agent .credentials, and .env and JSON files under /app and /workspace.
  • Azure managed-identity tokens from the instance metadata service or the App Service identity endpoint, for 12 resources including Azure Resource Manager, Microsoft Graph, Key Vault, Storage and Container Registry.
  • Azure DevOps OIDC tokens, requested for api://AzureADTokenExchange when a pipeline exposed SYSTEM_ACCESSTOKEN.
  • GitHub Actions OIDC tokens (1.26.2 only), requested in workflows that grant id-token: write, for Azure token exchange and Azure management.

Everything went out in one compressed HTTPS POST to a hardcoded webhook.site URL, with no retry and no fallback channel. GitHub's OIDC documentation says the cloud access token a workflow gets through OIDC is valid for a single job. A short life still leaves an attacker with Key Vault or ARM access for as long as the token lasts.


How Many Teams Were Actually Hit?

Probably few, and you still have to check, because nobody outside the attacker knows which hosts got through. The steel-man for doing nothing is real. The window was under an hour. Most production builds pin versions. And Wiz confirmed the attacker used a free-tier webhook.site URL, which accepts at most 100 requests and then rejects the rest; Wiz puts the number captured at a maximum of 50.

Three things cut against that comfort.

The ceiling counts requests the webhook logged. You cannot tell from your side whether yours was one of the 50 without looking at your own proxy or DNS logs; Wiz says a 200 response means the data was accepted and a 410 or 429 means it was likely rejected.

Even 50 requests is a lot of access if they came from CI runners, and Wiz does not say where they came from. One Azure DevOps agent can hold a service connection to a production subscription, and one GitHub runner with id-token: write can mint a token that a federated credential trusts. Wiz says stolen Azure tokens may stay valid for up to 24 hours, and the files it read (npm, PyPI, Docker and git credentials) do not expire at all.

The images persist. A container image built during that hour has the .pth hook baked into its site-packages. Every container started from it runs the stealer again, and it will keep trying to post to the webhook long after the PyPI releases disappeared.

Is This Connected to the durabletask Compromise?

Wiz says it has not linked the two, though the pattern is familiar. In May, three versions of Microsoft's durabletask Python SDK, 1.4.1 through 1.4.3, were published to PyPI with credential-stealing code within 35 minutes of each other, per Endor Labs, and later yanked. Wiz attributes that one to a stolen PyPI token.

For a buyer, the attribution question matters less than what the two incidents share. Both were Microsoft-owned Python packages published straight to PyPI outside the project's normal release flow, both went after Azure credentials, and both were caught by third-party scanners within minutes to hours. The same shape hit LiteLLM in October. AI SDKs make attractive targets because the machines that install them usually hold model keys, cloud identities and deploy rights all at once.

What Should You Do About It?

Answer one question first: did any host, runner or image resolve agent-framework to 1.26.1 or 1.26.2? If not, your remaining work is preventive. If yes, run the rotation list below before you do anything else.

Today:

  1. Search for the versions. Grep lockfiles (requirements*.txt, poetry.lock, uv.lock), CI logs from November 17, virtualenvs and container image layers for agent-framework==1.26.1 or 1.26.2. Unpinned pip install agent-framework steps in CI that ran in that window count.
  2. Search for the hooks. Look in every site-packages for agent_framework_meta.pth and af_runtime_diag.pth. Wiz publishes file hashes and both wheel hashes; hand them to your EDR or image scanner.
  3. Check egress. Query proxy and DNS logs for the webhook.site URL in the Wiz indicator list. Block webhook.site from build infrastructure, as OX recommends.
  4. Pin to 1.26.0 and rebuild any image built on November 17.

If you find a hit, this week:

  1. Rotate everything the host could read: environment secrets, Azure CLI sessions, Azure DevOps PATs and service connections, service principal secrets, and npm, PyPI, NuGet, Docker, Hugging Face, OpenAI and git credentials. Our Bedrock key rotation playbook has the order of operations for model-provider keys.
  2. Audit Azure identities. Pull Entra sign-in and activity logs for every managed identity and federated credential reachable from affected VMs, App Services, AKS nodes and pipelines, from 20:35 UTC on November 17 onward. Our service principal audit guide covers what to look for.
  3. Treat GitHub OIDC as exposed for any workflow that installed 1.26.2 with id-token: write, and review the federated credentials on the matching app registrations.

Before your next agent release:

  1. Turn on hash-checked installs. pip's hash-checking mode refuses any package whose sha256 does not match the one you recorded, and it requires every dependency to be pinned with ==. A hash-locked build could not have pulled 1.26.1 by accident. Our piece on MCP dependency drift covers the same discipline for MCP servers.
  2. Add a release cooldown. uv supports dependency cooldowns that ignore packages newer than a set duration, configured with relative values such as "1 week". Both malicious releases were pulled within about an hour, so even a one-day cooldown would have skipped them entirely.
  3. Strip id-token: write from jobs that install dependencies but do not deploy, and split install and deploy into separate jobs so a poisoned package never runs next to a federated identity.

The Bottom Line

Agent frameworks now sit where popular npm packages sat during the worm years: installed by default on the machines that hold the most valuable credentials, and updated often enough that nobody reads the release. Microsoft Agent Framework shipped a new minor version roughly weekly through October and November, per its PyPI history, and that cadence trains teams to take the latest without looking. Any framework you pick, including the ones in our LangGraph vs CrewAI vs AutoGen comparison, carries the same exposure, so the controls belong in your build rather than in the vendor choice: a cooldown, a hash, and a runner with no deploy identity.

Start with the search for af_runtime_diag.pth.

Continue Reading

Share:

Frequently Asked Questions

Which versions of Microsoft agent-framework on PyPI were malicious?

Versions 1.26.1 (published 20:35 UTC on November 17, 2026) and 1.26.2 (about 21:08 UTC) carried a credential stealer, per Wiz. Both were unavailable by about 21:30 UTC and PyPI now lists them as quarantined. The last clean release is 1.26.0, published November 12.

Do I have to import agent-framework for the malware to run?

No. The payload was installed as a .pth file in site-packages, and Python executes import lines in .pth files at every interpreter start. Any Python process in an affected environment ran the stealer, even if it never used the framework.

How do I check whether my systems installed the bad agent-framework versions?

Search lockfiles, CI logs from November 17, virtualenvs and container images for agent-framework 1.26.1 or 1.26.2, look in site-packages for agent_framework_meta.pth and af_runtime_diag.pth, and check proxy and DNS logs for the webhook.site URL Wiz published as an indicator.

What credentials should I rotate after the agent-framework compromise?

Everything the affected host could read: environment secrets, Azure CLI sessions, Azure DevOps PATs and service connections, service principal secrets, and npm, PyPI, NuGet, Docker, Hugging Face, OpenAI and git credentials. Also review Entra sign-ins for managed identities and federated credentials reachable from that host.

How do I stop a malicious PyPI release from reaching my builds?

Use pip's hash-checking mode so only packages matching recorded sha256 hashes install, and add a dependency cooldown such as uv's, which ignores releases newer than a set duration. Both malicious agent-framework releases were pulled within about an hour, so a one-day cooldown would have skipped them.

Newsletter

More on Frameworks, every Sunday

The week's enterprise AI news, Frameworks included, in one Sunday email.

Weekly, free. Unsubscribe any time. Privacy

Latest Articles

View All →