Skip to main content

Microsoft agent-framework PyPI Compromise: Versions 1.26.1 and 1.26.2 Stole Credentials

On 17 November 2026, two malicious versions of Microsoft's agent-framework Python package, 1.26.1 and 1.26.2, were live on PyPI from 20:35 UTC to about 21:30 UTC. Wiz says a .pth startup hook stole environment secrets, Azure, GitHub, Hugging Face and package registry tokens. PyPI has quarantined both. Pin 1.26.0 and rotate every secret on any machine that installed them.

On this page

What happened to agent-framework on 17 November

agent-framework is Microsoft's Python package for building AI agents, and Wiz puts its usage at about 41,000 downloads a week. The last legitimate release, 1.26.0, went up on 12 November 2026. Five days later, at 20:35 UTC on 17 November, a version 1.26.1 appeared on PyPI, followed about 33 minutes later by 1.26.2. By about 21:30 UTC both were gone, and the PyPI project page now lists each as "Release quarantined on Nov 17, 2026".

Wiz researchers Rami McCarthy, Scott Piper and Benjamin Read published the analysis the same day. The root cause is not confirmed. There is no matching tag or release in Microsoft's GitHub repository, the main branch does not contain the malicious code, and 1.26.1 shipped as a wheel only, which led Wiz to suggest it was built outside the normal release process and uploaded straight to PyPI. Microsoft had not published a statement at the time of writing.

Why simply installing it was enough

The payload did not wait for anyone to import the library. Version 1.26.1 dropped a file called agent_framework_meta.pth into site-packages, and 1.26.2 used af_runtime_diag.pth. Python reads .pth files every time the interpreter starts, and any line in them that begins with "import" is executed. In practice, every Python process launched in that environment ran the stealer, including test runners and unrelated scripts. Wiz notes the code disguised itself as runtime telemetry and forked into the background so it would not slow anything visibly.

What the stealer collected

The target list reads like an inventory of an AI developer's machine. Wiz says the code gathered environment variables whose names contain words such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI and HF_, plus secret-looking values from other processes on the host. It also read credential files: Azure CLI sessions, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face tokens, Azure DevOps agent credentials, and .env files under common app folders.

On cloud machines it went further. It requested Azure managed-identity tokens for services including Key Vault, Storage, Graph and Azure AI, and in Azure DevOps pipelines it asked for an OIDC token. The second version added GitHub Actions OIDC tokens for workflows with id-token write permission. Everything was compressed into one HTTPS POST to a webhook.site address. Wiz says the attacker used a free-tier endpoint and that at most 50 requests were captured, but each could hold working cloud and registry credentials.

A pattern in AI developer tooling

This is the second Microsoft Python package compromised this year. In May, malicious durabletask releases 1.4.1 to 1.4.3 were pushed with a stolen PyPI token to steal AWS, Azure and GCP credentials. Wiz says it has not linked the two incidents. Agent frameworks are an attractive target because the machines that run them tend to hold model provider keys, cloud identities and CI secrets in the same place.

What to check and rotate now

Search lockfiles, CI logs, virtual environments and container images for agent-framework 1.26.1 or 1.26.2, and pin 1.26.0. Look in site-packages for the two .pth files named above. Check proxy or DNS logs for requests to webhook.site from build hosts. If you find the bad versions, assume every secret on that host or runner is exposed: rotate cloud credentials, Azure DevOps tokens, npm, PyPI, Docker and Hugging Face tokens, git credentials and model API keys. Wiz adds that stolen managed-identity and OIDC tokens can stay valid for up to 24 hours, so audit sign-in logs from 17 November onward.

For anyone running agents locally, the broader lesson is to pin exact versions, review new releases before upgrading, and keep long-lived keys out of the environments where third-party packages run.

CuriousLM runs supported AI models locally on your device. Try CuriousLM.