News

Microsoft Agent Framework PyPI Package Hijacked: Rotate Secrets Now

Two poisoned releases of Microsoft's agent-framework Python package stole cloud and CI credentials on 17 November. Here is how to check if you were hit and what to do.

Read in 3 countries🇨🇭🇺🇸🇭🇰3 views
Software developer looking alarmed at code and a build pipeline on two monitors.
AI-generated image (Claude)
In this article
  1. Key takeaways
  2. What happened
  3. How the packages got onto PyPI
  4. How the malware worked
  5. Who is at risk
  6. Why this matters even if you do not write Python
  7. How to check if you were affected
  8. What you should do
  9. Sources

Developers and IT teams building AI agents with Python should check their systems now. On 17 November 2026, two poisoned releases of agent-framework, the official PyPI package for Microsoft Agent Framework, were published with a credential stealer hidden inside. They were online for well under an hour, but anything that installed them during that window may have handed cloud keys and tokens to an attacker. This article explains what happened and the clean-up steps to take.

Key takeaways

  • Malicious versions: agent-framework 1.26.1 and 1.26.2. The last clean release is 1.26.0.
  • The malware ran every time Python started, even if your code never imported the package.
  • It targeted Azure, Azure DevOps, GitHub, npm, PyPI, Docker and Hugging Face credentials, plus secrets in environment variables and .env files.
  • Removing the package does not undo the theft. If you were exposed, rotate your secrets.
Developer at a laptop at night with a padlock and keys beside it.
AI-generated image (Claude)

What happened

According to Aikido Security’s timeline, version 1.26.1 appeared on PyPI at 20:35 UTC on 17 November. A second malicious version, 1.26.2, followed about 33 minutes later. Both had been removed by around 21:20 to 21:30 UTC, leaving 1.26.0 as the latest release again. The package is widely used: Aikido puts it at about 190,000 downloads a month, and Wiz at roughly 41,000 a week.

The poisoned builds kept the real framework code, so applications carried on working normally and nothing looked broken. 1.26.1 even copied the previous release’s README and dependency pins to pass as a routine patch.

How the packages got onto PyPI

Researchers found no matching code or release in Microsoft’s main source repository, which suggests the uploads happened outside the normal build process. Unlike genuine releases, the malicious ones had no source distribution, only a built wheel. Wiz reports the attacker appears to have obtained a client certificate and private key used in Microsoft’s release pipeline, though how is unknown. SafeDep separately spotted a PyPI maintainer account created on the day of the attack with publishing rights to the package; its role has not been confirmed.

A Microsoft Agent Framework maintainer confirmed on GitHub that the releases were removed and an investigation was under way, SecurityWeek reported.

How the malware worked

Both versions dropped a .pth file into Python’s site-packages folder. Python processes these files every time the interpreter starts, so the stealer launched in the background on any Python run in that environment, with or without an import. The same trick was seen in the LiteLLM compromise earlier in 2026.

Once running, it collected:

  • Environment variables with names containing words such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB or NPM, including from other running processes.
  • Credential files for the Azure CLI, pip, npm, git, Docker and Hugging Face, plus .env and JSON files in common app folders.
  • Azure managed identity tokens for services such as Azure Resource Manager, Microsoft Graph and Key Vault, and Azure DevOps pipeline tokens.
  • In 1.26.2 only, GitHub Actions OIDC tokens from workflows allowed to request them.

The data was compressed and posted to a webhook.site address. Wiz, which could see part of the traffic, counted three unique victims whose data was successfully sent, alongside scanner and test traffic.

Who is at risk

The biggest exposure is in automated systems that install packages without fixed version pins: CI/CD pipelines, container builds, Azure DevOps and GitHub Actions workflows that deploy to Azure, and Azure virtual machines or App Services with managed identities. A requirements line such as agent-framework>=1.26 would have pulled in the bad version during the window.

For African startups and SMEs experimenting with AI agents, this is a reminder that a single build server often holds the keys to production cloud accounts, payment integrations and customer data.

Why this matters even if you do not write Python

If an outside developer or agency builds AI tools for your business, their build systems may hold your cloud keys. Ask them directly whether any project installed agent-framework between 20:35 and 21:30 UTC on 17 November, and whether they have rotated the credentials those systems could reach. Keep a record of their answer.

How to check if you were affected

  1. Run pip show agent-framework in each environment and check lockfiles, CI logs and container images built since 17 November for versions 1.26.1 or 1.26.2.
  2. Look in site-packages for agent_framework_meta.pth, af_runtime_diag.pth or af_runtime_diag.py.
  3. Search proxy and DNS logs for connections to webhook.site. Wiz notes a successful response suggests data was accepted.

What you should do

  1. Pin to agent-framework==1.26.0 and rebuild affected environments rather than trying to clean them in place.
  2. Rotate every secret the affected machines could reach: Azure service principals, Azure DevOps tokens and service connections, GitHub, npm, PyPI and Hugging Face tokens, Docker registry credentials and .env contents.
  3. Review Entra ID sign-in logs for service principals and federated credentials used by affected pipelines. Wiz warns stolen managed identity tokens can stay valid for up to 24 hours.
  4. Treat GitHub Actions OIDC tokens as exposed for any workflow that installed 1.26.2 with id-token: write.
  5. Pin dependency versions and use lockfiles with hashes in production builds, so a surprise release cannot slip in unnoticed.

Sources

Featured image: Photo: “computer laptop keyboard HP Pavilion Entertainment PC” by GoodNCrazy, CC BY 2.0, via Openverse — source

Was this article helpful?

Embed this on your website

Run a website, school, church or company intranet? Paste this code to show this article as a card. It stays up to date automatically.

Or show your visitors the latest scam alerts, updated automatically:

Written by

Verified expert

Cybersecurity Analyst

Federal Capital Territory (Abuja)

  • Phising
  • Fraud Prevention
  • Cybersecurity Awareness and Training
  • Cloud Security
  • IT Risk Management

Credentials: MCPN, MNCS, IAENG | System Analyst · Web Developer · CEH · CC · CDST

Got expertise to share? Write for us →

Leave a Reply

Your email address will not be published. Required fields are marked *