Microsoft Agent Framework 1.26.1 and 1.26.2 on PyPI stole passwords and cloud keys. Pin 1.26.0 and rotate

9 min read

How to fix the agent-framework compromise: pin agent-framework to 1.26.0, rebuild from a clean image and rotate every key the machine could reach. Two fake Microsoft Agent Framework releases on PyPI, 1.26.1 and 1.26.2, ran a password stealer every time Python started for about 40 minutes on Nov 17. It also asked Azure and GitHub for fresh tokens.

BREAKING: Microsoft Agent Framework 1.26.1 and 1.26.2 on PyPI stole passwords and cloud keys. Pin 1.26.0 and rotate
On this page

If you or one of your build servers installed Microsoft Agent Framework for Python on the afternoon of Tuesday, Nov 17, that update may have copied your passwords, cloud keys and code-hosting logins and sent them to a stranger. Two fake releases of the official agent-framework package, 1.26.1 and 1.26.2, were live on PyPI for about 40 minutes in total, from 3:35 PM to 4:16 PM ET (20:35 to 21:16 UTC). PyPI has quarantined both. The last good release is 1.26.0, from Nov 12. There is no CVE. This is a supply-chain compromise of a package that gets about 190,000 downloads a month, not a bug in Microsoft's code.

The stealer does not wait for your code to use the package. It plants a small startup file that Python reads every time it starts, so any Python command in that environment, including pip itself, runs it again. Our read below is based on PyPI's own release pages, which we checked at 3 AM ET on Nov 18, and the public analyses from Wiz, StepSecurity and Socket listed in the references.

How to fix

Pin the package to the last clean release and rebuild from a clean base:

pip install 'agent-framework==1.26.0'

Run that in a new virtual environment or a fresh container image, not inside the environment that had 1.26.1 or 1.26.2. In requirements files and lockfiles, change the line to agent-framework==1.26.0 and keep hashes on if your tool supports them. Then work through the rest in this order:

  1. Find it without starting Python. On a machine that might be affected, do not run pip show agent-framework or pip uninstall first. Both start Python, and Python runs the hook. Use plain file search instead (see the check below). pip show agent-framework is fine on a machine where that search comes back empty.
  2. Cut it off and rebuild. Take the host, container or CI runner off the network, keep its logs, and replace it from a clean image. The stealer forks into a background process that can outlive the command that started it, so deleting the hook file alone does not stop a copy that is already running.
  3. Rotate from a different, clean machine. Assume every secret the environment could see is gone: environment variables, Azure CLI sign-ins, Azure DevOps tokens and service connections, npm, PyPI, NuGet, Docker and Hugging Face tokens, and saved git credentials.
  4. Review cloud identities, not just secrets. The stealer asked Azure for brand new tokens (more on that below). Check sign-in and activity logs for managed identities and federated credentials that the affected VMs, App Services, AKS nodes or pipelines could use.
  5. Check your outbound logs. Search proxy and DNS logs for webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. Wiz says a 200 response means the data was accepted, and a 410 or 429 means it was turned away.
  6. Clear your caches. PyPI's quarantine does not reach copies already pulled into an internal mirror, a pip cache or a container image built that afternoon. Block 1.26.1 and 1.26.2 in your package proxy and rebuild any image made during the window.

One check you can run now

This looks for the two hook files and the installed-version folders on Linux or macOS. It does not start Python:

find / \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' -o -name 'agent_framework-1.26.[12].dist-info' \) 2>/dev/null

Any hit means a bad version was installed in that environment. agent_framework_meta.pth is the 1.26.1 hook and af_runtime_diag.pth is the 1.26.2 hook. Search for both names: 1.26.2 put the original package file back to its clean state and moved the stealer to a new top-level file, so a check for only the 1.26.1 names will miss it. For CI, search build logs from Nov 17 for agent-framework-1.26.1 or agent-framework-1.26.2, which is how pip prints the version it installed.

What the bad updates took

A .pth file in site-packages is a normal Python feature for setting up paths, and Python runs any import line it finds in one at startup. Both bad wheels used that. The 1.26.1 hook holds one line, import agent_framework_meta, which starts a module called _telemetry.py. 1.26.2 uses af_runtime_diag.pth and af_runtime_diag.py. The names and the user agent strings (af-runtime-diagnostics/1, then runtime-diagnostics/1) were picked to look like SDK telemetry.

According to the Wiz and StepSecurity write-ups, the stealer collects:

  • Environment variables whose names contain words like TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, OPENAI, HF_ or NPM.
  • Secrets from other running programs, by reading the environment of up to 300 processes on Linux. On a CI runner that can include the runner's own tokens.
  • Credential files: Azure CLI files under ~/.azure/, .npmrc, pip.conf, .netrc, .git-credentials, Docker's config.json, Hugging Face tokens, Azure DevOps agent credentials, and .env and JSON files under /app and /workspace.
  • Fresh Azure tokens. In an Azure DevOps pipeline it uses the pipeline's own access token to request a federated token. On Azure compute it asks the managed identity endpoint (the local IMDS address, or IDENTITY_ENDPOINT on App Service and Functions) for tokens to 12 services, including Azure Resource Manager, Microsoft Graph, Key Vault, Storage and Container Registry. It also grabs instance metadata.
  • In 1.26.2 only: GitHub Actions OIDC tokens, in workflows that have id-token: write, plus files in GitHub-hosted runner temp folders.

Everything goes out in one compressed HTTPS POST to that webhook.site address. StepSecurity found no second stage that downloads more code.

Why rotating passwords is not the whole job

Most stealers grab what is already on disk. This one also asked Azure and GitHub to issue new tokens on the spot, so no password you rotate covers those. Wiz says the stolen managed identity and exchanged OIDC tokens stay valid for up to 24 hours. For a machine hit at the end of the window, that runs to about 4:20 PM ET today, Nov 18. A machine that still has the hook asks for new ones every time Python starts, which is why rebuilding comes before rotating. Inside that window, the real question is whether someone used a token to create something that lasts longer: a new app secret, a role assignment, a service principal or a pipeline change. That is what to look for in the Azure activity log.

Two details from the write-ups help you size the damage. Wiz says the attacker's webhook.site address was a free-tier one, which accepts at most 100 requests and expires after 7 days, and that at most 50 requests were captured. That limits how many machines reported in, but each report can hold working cloud and registry keys. StepSecurity's timeline shows 1.26.2 went up 2 minutes after PyPI quarantined 1.26.1, so quarantining the first release did not cut off the attacker's ability to publish. StepSecurity also reports a new maintainer account was added to the PyPI project the same day.

Who is not in scope

  • Anyone whose lockfile or requirements pin agent-framework to 1.26.0 or earlier. 1.26.0 shipped on Nov 12 through the normal release process with both a wheel and a source archive. The bad versions were wheels only.
  • Installs that resolved before 3:35 PM ET or after 4:16 PM ET on Nov 17 from public PyPI. pip install agent-framework resolves to 1.26.0 today. A mirror or cache that grabbed the bad wheel is the exception.
  • Projects that install only the component packages, such as agent-framework-core, without the agent-framework meta-package. PyPI still lists 1.26.0 as the newest agent-framework-core, and StepSecurity found no new uploads after Nov 12 to the other component packages it checked. That check did not cover every package in the family.
  • .NET users of Agent Framework on NuGet. None of the reports involve the .NET packages.

What this is not

This is not a flaw in Agent Framework's code that someone can exploit over the network, and it does not spread on its own like the Mini Shai-Hulud worm did. It is a poisoned release that steals secrets from the machines that installed it. Wiz found no python-1.26.1 tag in the GitHub repository and no malicious code on the main branch, so the source is clean. How the attacker got publishing access is still unconfirmed.

Microsoft's second PyPI hit this year

In May, three malicious versions of durabletask, Microsoft's Python client for its Durable Task workflow framework, were pushed to PyPI to spread the Mini Shai-Hulud worm. Wiz says that package was hit after its PyPI token was stolen and has not linked the two incidents. When we checked at 3 AM ET on Nov 18, github.com/microsoft/agent-framework returned a 404 to logged-out visitors, so the project's issue tracker was not a place to watch for updates. PyPI's quarantine notice and the release history are the reliable status pages for now.

The pattern matches the LiteLLM 1.107.0 compromise in October: an AI developer package with a startup hook that ran before anyone imported it, aimed at the keys an AI stack holds. A week later, the Claude Code 2.1.313 build in Cursor's marketplace came through auto-update instead of a package manager. The same fix applies in all three cases: pin versions, rebuild instead of cleaning in place, and rotate from a clean machine. Agents and pipelines that hold long-lived cloud credentials make every one of these worse, which is the case for least privilege for AI agents.

Where HOL Guard fits, and where it does not

HOL Guard would not have stopped a CI job that installed this from a requirements file. Guard checks what an AI coding agent tries to do on your machine, such as shell commands, package installs, credential file reads and MCP tool calls, and pauses risky ones for your approval. If an agent had run an unpinned pip install agent-framework during the window, Guard would have shown you that install before it ran. Approving it would still have pulled the bad version. Scan your agent setup with HOL Guard (free).

What do people ask about the agent-framework compromise?

Which agent-framework versions are malicious?

Versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI, both published on November 17, 2026. PyPI has quarantined both. The last clean version is 1.26.0.

How do I know if I installed it?

Search for the files agent_framework_meta.pth and af_runtime_diag.pth, or a folder named agent_framework-1.26.1.dist-info or agent_framework-1.26.2.dist-info, with a file search that does not start Python. In CI, search Nov 17 build logs for agent-framework-1.26.1 or agent-framework-1.26.2.

Is uninstalling the package enough?

No. A collector that already started keeps running, and anything it sent is already gone. Rebuild the environment from a clean image, pin 1.26.0, and rotate credentials from a different machine.

Does the stealer run if I never import agent_framework?

Yes. The .pth file runs on every Python start in that environment, including pip, pytest and linters, whether or not your code imports the package.

Is there a CVE for the agent-framework compromise?

Not at the time of writing. It is a malicious release, not a code vulnerability, so it is tracked as a supply-chain incident rather than a CVE.

Was the .NET version of Agent Framework affected?

None of the public reports involve the .NET packages on NuGet. The compromise is limited to the Python meta-package on PyPI.

References

All articles

Keep exploring

The engineering desk continues across the ecosystem: security research on shipping agents safely, and plugins that put the standards to work.