Microsoft Agent Framework PyPI Compromise | How a 55-Minute Release Stole Cloud Secrets

Reading Time: 5 min

A malicious Microsoft Agent Framework PyPI release went live on the evening of November 17, 2026. Two poisoned versions of the agent-framework package, 1.26.1 and 1.26.2, sat on the Python Package Index for about 55 minutes. In that window, any developer laptop, CI runner or container that pulled them ran a credential stealer aimed squarely at Azure, GitHub and AI developer secrets.

Wiz researchers caught and analyzed the release. The package sees about 41,000 downloads a week, so even a short window matters. It also follows several PyPI attacks this year that used the same trick: a startup hook that runs before your code does.

What Happened to the Microsoft Agent Framework PyPI Package

Microsoft Agent Framework is the company’s open-source toolkit for building AI agents in Python and .NET. Its PyPI package is a common dependency in agent projects and Azure AI pipelines.

A 55-minute window

Version 1.26.1 appeared at 20:35 UTC. A second malicious build, 1.26.2, followed around 21:08 UTC. PyPI quarantined both by about 21:30 UTC. The last clean release is 1.26.0, published on November 12.

Built outside the normal pipeline

The Microsoft GitHub repository has no tag or release for 1.26.1, and its main branch holds no malicious code. Legitimate releases ship a wheel, a source distribution and a matching agent-framework-core version. The bad release shipped a lone wheel. Everything points to a direct upload with stolen publishing access, although the root cause is not yet confirmed.

A second version that hid better

The attacker did not stop at one build. Version 1.26.2 renamed its files, restored a clean __init__.py and widened its target list. Teams that searched only for the 1.26.1 file names would miss it.

Fifty-five minutes is all a stolen publishing token needs.

How the Stealer Works

The payload is simple, quiet and fast. It aims to grab as many secrets as possible in one shot.

A .pth file runs it on every Python start

Each version drops a .pth file into site-packages. Python executes these files every time the interpreter starts. So the stealer runs even if your code never imports agent-framework. Any Python process in an affected environment triggered it.

It harvests secrets from everywhere

  • Environment variables with names like TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI and HF_
  • Secret values from up to 300 other running processes
  • Up to 80 credential files, including Azure CLI config, .npmrc, .git-credentials, Docker config and Hugging Face tokens
  • Azure managed identity tokens from the instance metadata service
  • Azure DevOps and GitHub Actions OIDC tokens that can be swapped for Azure access

One quiet upload

The stealer packs everything into one compressed JSON blob and sends it in a single HTTPS POST to a webhook.site URL. File and function names mimic SDK telemetry, so a quick glance looks harmless. It does not retry on failure and leaves little noise behind.

A small catch, a big risk

The attacker used a free webhook.site account, which caps captures at 100 requests. Wiz says no more than 50 requests landed. That sounds small, but a single CI runner can hold keys to an entire cloud tenant.

Why AI Developer Tooling Is Now a Prime Target

This attack fits a clear 2026 pattern. Attackers go after the packages that AI developers trust most, because those environments hold the richest secrets.

Microsoft packages have been hit before

In May 2026, attackers used a stolen PyPI token to push three trojanized versions of Microsoft’s durabletask SDK. Wiz has not linked the two incidents. Still, a second Microsoft Python package hit through the same kind of direct upload raises hard questions about publishing controls.

Startup hooks are the new favorite

In June, a wave of poisoned wheels known as Hades spread through 19 PyPI packages using .pth hooks. In October, a compromised LiteLLM release used the same Python startup trick to steal credentials. Defenders often scan imports and entry points. A .pth file slips past that, because it runs before any of your code loads.

Agent builders hold the keys

Teams that build AI agents keep model API keys, cloud identities and deployment tokens close at hand. Their pipelines often have broad Azure rights. That makes them a far better haul than an average web app. Our guide to securing AI bots covers why these secrets need tighter scope.

Provenance checks help, but only if you use them

The bad release broke every pattern of a normal Microsoft build. It had no Git tag, no source distribution and no matching core package. Tools that compare a release against its repository and build history would have flagged it at once. Few teams run those checks before they install.

What to Do Now

If any environment you run installed agent-framework between 20:35 and 21:30 UTC on November 17, treat it as compromised.

  1. Find exposure. Search lockfiles, CI logs, virtual environments and container images for versions 1.26.1 or 1.26.2. Pin to 1.26.0.
  2. Check for the files. Look in site-packages for agent_framework_meta.pth or af_runtime_diag.pth, and for the _AF_TEL=1 variable.
  3. Check egress. Search proxy and DNS logs for webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb.
  4. Rotate everything. Replace environment secrets, Azure CLI sessions, Azure DevOps tokens, git credentials, and npm, PyPI, Docker and Hugging Face tokens on affected hosts.
  5. Audit Azure identities. Review sign-in logs for managed identities and federated credentials. Stolen tokens may stay valid for up to 24 hours.
  6. Harden your pipeline. Pin dependencies with hashes, delay new versions by a few days, and give CI jobs only the cloud rights they need. Our supply chain security guide walks through these controls.
Pin your versions, scope your tokens and assume the next poisoned release is already on its way.

The Microsoft Agent Framework PyPI compromise lasted less than an hour, yet it could reach deep into cloud environments. A trusted vendor name and a familiar package were enough to put a stealer in front of thousands of builds.

The fix is not to stop trusting open source. It is to stop trusting it blindly. Hash pinning, release delays and least-privilege CI tokens turn a 55-minute attack into a non-event.

Want to see how attackers move through partners, packages and SaaS links long before anyone notices?

Read our deep-dive: The New Perimeter is the Supply Chain | Managing Third-Party and SaaS Risk.

Lock down your build pipeline before the next poisoned package lands in it.
SECITHUB FAQ banner for the Microsoft Agent Framework PyPI compromise covering malicious versions, credential theft and remediation
Which Microsoft Agent Framework PyPI versions are malicious?

Versions 1.26.1 and 1.26.2 of the agent-framework package. The last safe version is 1.26.0.

How long were the malicious versions available?

About 55 minutes on November 17, 2026, from 20:35 UTC until PyPI removed them around 21:30 UTC.

Do I need to import the package to be affected?

No. A .pth file runs on every Python start, so any Python process in an affected environment ran the stealer.

What did the malware steal?

Secrets from environment variables, credential files, other processes, Azure managed identities and CI OIDC tokens.

How do I check if I was hit?

Search for versions 1.26.1 or 1.26.2, look for agent_framework_meta.pth or af_runtime_diag.pth, and check logs for the webhook.site URL.

What should I do if I installed a bad version?

Pin to 1.26.0, rotate every secret on the affected host or runner, and audit Azure sign-in logs for the exposed identities.

Sources

Malicious version of Microsoft’s Agent Framework published to PyPI – Wiz

Inside the LiteLLM 1.107.0 supply chain compromise – Microsoft Security

Two malicious versions of Microsoft's agent-framework package hit PyPI for about 55 minutes and ran a credential stealer on every Python start. Here is how it worked, who is exposed and what to rotate now.
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted