Get a demo — 30 minutes →
← Back to blog
Anomity robot illustrating Microsoft Agent Framework Hijacked on PyPI - What the agent-framework 1.26.1 and 1.26.2 Credential Stealer Took
Research

Microsoft Agent Framework Hijacked on PyPI - What the agent-framework 1.26.1 and 1.26.2 Credential Stealer Took

TL;DR
  • On November 17, 2026 two malicious releases of agent-framework, the PyPI meta-package for Microsoft Agent Framework, went live 33 minutes apart: 1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC. Both were removed from PyPI within the hour. 1.26.0 is the last clean release.
  • Each release added a .pth startup hook, so the stealer ran every time Python started in that environment, including during pip itself, even if nothing imported the package.
  • It collected secret-looking environment variables, other processes' environments and credential files, then asked Azure managed identity, Azure DevOps and, in 1.26.2, GitHub Actions for fresh OIDC and access tokens, and sent everything to a public webhook.site URL.
  • Wiz says the attacker appears to have used a stolen client certificate and private key for Microsoft's internal release pipeline (ESRP), and that the attacker's own tooling identified itself as Cairn, an open-source AI penetration-testing framework. Microsoft has not published a root cause.
  • The lesson for security teams: the machines that install AI agent frameworks are the ones holding cloud, CI and model provider credentials. Know where those credentials sit, and treat any host that took 1.26.1 or 1.26.2 as exposed.

The short version: for about an hour on the evening of November 17, 2026 (UTC), anyone who installed or upgraded Microsoft's agent-framework package from PyPI could have received a credential stealer instead of a routine patch release. The package is how many Python teams pull in Microsoft Agent Framework, Microsoft's open-source SDK for building AI agents and multi-agent workflows, and it sees roughly 200,000 downloads a month according to Wiz and BleepingComputer.

That download base is the point. The laptops, build agents and containers that install an AI agent framework are usually the ones wired into Azure subscriptions, model provider keys and CI pipelines. A stealer riding on that package lands exactly where the valuable credentials are.

What to do now

  • Find the versions. Search lockfiles, CI logs, virtual environments, caches and container images built since November 17 for agent-framework 1.26.1 or 1.26.2. A loose requirement such as agent-framework>=1.26 could have resolved to either. Pin to 1.26.0 and rebuild affected environments from a clean base.
  • Look for the hook files. In site-packages, check for agent_framework_meta.pth and agent_framework_meta/_telemetry.py (1.26.1) or af_runtime_diag.pth and af_runtime_diag.py (1.26.2). Searching only for the 1.26.1 file names misses the second release.
  • Check egress. Wiz and the GitHub advisory publish the exfiltration endpoint on webhook.site. Search proxy and DNS logs for it. Wiz notes that an HTTP 200 means the host's data was accepted.
  • Rotate everything the host could reach. Environment secrets, Azure CLI sessions, Azure DevOps personal access tokens and service connections, GitHub, npm, PyPI, NuGet, Docker and Hugging Face tokens, git credentials and .env files. Removing the package stops future runs, but it does not recall what was already sent.
  • Audit Azure and CI identities. Review sign-in and activity logs for managed identities, service principals and federated credentials reachable from affected VMs, App Services, AKS nodes, Azure DevOps pipelines and GitHub Actions workflows with id-token: write.

Timeline of the agent-framework compromise

Times are UTC, from Wiz, the GitHub advisory and the PyPI release history.

WhenWhat happened
Nov 12, 18:25Legitimate 1.26.0 published to PyPI, alongside agent-framework-core 1.26.0.
Nov 17, 20:35Malicious 1.26.1 published as a wheel only. Elastic says its supply-chain monitor flagged it six minutes later.
Nov 17, 21:08Malicious 1.26.2 published, 33 minutes after 1.26.1, with the same stealer under new file names and GitHub Actions token theft added.
Nov 17, about 21:30Wiz reports both versions no longer available on PyPI. 1.26.0 is again the latest release.
Nov 18GitHub publishes malware advisory GHSA-764m-3ppc-5m73. Wiz updates its post with a root cause and an analysis of the captured data. Microsoft tells The Register it has made some repositories private while it investigates malicious content.

The first malicious release was built to look boring. Aikido found that 1.26.1 kept the same README and the same pinned dependency on agent-framework-core[all]==1.26.0, so a dependency bot proposing the bump would look like routine noise. Only two files were new and one was edited. SafeDep makes a sharper point: pulling 1.26.1 did not stop an attacker who could still publish, which is why a second release appeared half an hour later.

How the stealer worked

Python processes .pth files in site-packages every time the interpreter starts, and a line that begins with import is executed. Both releases used that mechanism. The hook imported a helper module that forked into a detached background process, set an _AF_TEL marker so child processes would not repeat the work, silenced every error, and dressed itself up as SDK telemetry with names like "runtime diagnostics". The result is that any Python launch in the environment ran the payload, whether or not the code ever imported agent_framework. We saw the same startup-hook trick in the Hades PyPI campaign.

According to Wiz and the GitHub advisory, the payload collected:

  • Host context: hostname, user, working directory and command-line arguments.
  • Environment variables whose names contain strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, OPENAI, HF_, FOUNDRY, NPM, PIP and NUGET, plus secret-looking values from other processes' /proc/*/environ.
  • Credential files, up to 60 in 1.26.1 and 80 in 1.26.2: Azure CLI token caches, .npmrc, pip.conf, .netrc, .git-credentials, Docker config.json, Hugging Face tokens, Azure DevOps agent credentials and .env files.
  • Freshly minted tokens: Azure managed-identity tokens from the instance metadata or App Service identity endpoint for resources including Azure Resource Manager, Microsoft Graph, Key Vault and Storage, Azure DevOps OIDC tokens, and in 1.26.2, GitHub Actions OIDC tokens.

That last category is what separates this from a simple secrets grab. The stealer did not only read what was on disk. It asked the platform for new tokens, which matters most in CI and on cloud VMs, where a workflow or a managed identity can be exchanged for cloud access with no stored secret at all. Wiz notes these managed-identity and OIDC-exchanged tokens stay valid for up to 24 hours.

Everything went out in one compressed, base64-encoded POST to a hardcoded webhook.site URL, with no fallback channel. That choice limited the damage. Wiz says the attacker used webhook.site's free tier, which keeps at most 100 requests, and that it analyzed the 50 requests that were captured: four came from the attacker's own machines, 29 looked like sandboxes, vendor scanners and tests, and the remaining 17 represented three unique cases of successful exfiltration of victim data. Three is small, but each one can carry working cloud, CI and registry credentials.

How the attacker got publishing access

This part is still open. Wiz says the attacker appears to have compromised a client certificate and private key for Microsoft ESRP (Engineering System Release Pipeline), the internal service Microsoft uses to sign and publish the package. The first publish attempt, from AWS, was rejected by ESRP's IP filtering. A second attempt from Microsoft-owned IP space succeeded. Wiz says it does not yet know how the credentials were obtained. SafeDep separately found a PyPI account created on November 17 listed as a maintainer of agent-framework and five related projects, while noting that PyPI and Microsoft have not released the upload log that would confirm who published the files.

Microsoft's only public statement so far, given to The Register on November 18, is that it has made some repositories private while it investigates malicious content. When we checked on November 19, the microsoft/agent-framework GitHub repository returned a 404. Microsoft has not said how the access was gained or how many installs the two versions received.

An AI agent harness on the attacker's side

One detail deserves attention beyond this incident. The attacker's tooling reported its progress to the same webhook it used for stolen data, which let Wiz watch part of the operation. That tooling identified itself as Cairn, an open-source AI penetration-testing framework, staging the package in /tmp/cairn_pkg. Before publishing, the attacker ran the stealer on their own machine, and that run captured an AI coding agent configuration that Wiz reads as the open-source Pi harness backed by a GLM-family model, routed through a local proxy.

In other words, an agent framework was poisoned with help from agent tooling. It fits the wider pattern of attackers putting agents to work, which we covered in our look at autonomous hackbots and agent-layer visibility. For defenders the practical reading is speed: the gap between a stolen publishing credential and a working, disguised release is now measured in minutes.

Why AI agent frameworks are a high-value target

Agent frameworks sit in an awkward spot for governance. A data team or a developer adds one with a single pip install, often on a machine that already holds Azure credentials, model provider keys and CI tokens, and it rarely goes through the review an IDE extension or SaaS app would get. The framework is trusted because of who publishes it, which is exactly what this attack borrowed. Our guide to securing AI agent frameworks covers the orchestration layer's own bugs. This incident shows the other half: the install path itself.

It also repeats a lesson from the Fireworks AI breach: credentials spread into places nobody inventories. Here they sat in environment variables, CLI token caches and .env files on the hosts that build and run agents. Pinning versions and using hash-checked installs narrows the window, but the durable fix is knowing which credentials live on which machines so a rotation list can be built in minutes, not days. Our guide to secrets management for AI agents goes deeper on that.

How Anomity helps you respond

See the secrets on every machine. The Anomity Endpoint Sensor reports which credentials and AI provider keys sit on each managed Windows, macOS and Linux endpoint, by type and location, with values redacted on the endpoint. After an incident like this, the question "which developer machines hold Azure CLI sessions, Hugging Face tokens or .env secrets?" becomes a query instead of a survey.

See the agents and tools around them. The same sensor inventories the AI agents, MCP servers, extensions, plugins, skills, hooks, CLIs and local LLM runtimes on each endpoint, so you know where agent development is happening. Cloud discovery adds the Google Workspace and GitHub OAuth grants that AI apps hold, and the 90-day audit trail shows what changed and when.

Enforce before the call runs. On agents that expose a hook, such as Claude Code PreToolUse, Anomity's managed hooks can allow, deny or log a tool call before it runs, for example an agent running an unpinned pip install or reading credential files it has no reason to touch. Findings route to SIEM, Slack, email or Jira. Anomity is SOC 2 Type II and complements EDR, DLP, network and GRC tooling rather than replacing them. To see which AI agents and secrets are on your fleet today, book a 30-minute demo.

Frequently asked questions

Which versions of Microsoft's agent-framework package were malicious?

Versions 1.26.1 and 1.26.2 of agent-framework on PyPI, both published on November 17, 2026 (20:35 and 21:08 UTC). Both have been removed. Version 1.26.0 and earlier are not affected, according to the GitHub advisory GHSA-764m-3ppc-5m73.

Did I need to import agent-framework for the stealer to run?

No. Each release added a .pth startup hook in site-packages. Python processes .pth files every time the interpreter starts, so the stealer ran on any Python launch in that environment, including pip itself, whether or not the package was imported.

What did the agent-framework credential stealer collect?

Host details, secret-looking environment variables, other processes' environments, and credential files such as Azure CLI token caches, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face tokens and .env files. It also requested fresh Azure managed-identity and Azure DevOps OIDC tokens, and in 1.26.2, GitHub Actions OIDC tokens.

How do I check if a machine or pipeline was affected?

Search lockfiles, CI logs, virtual environments and container images for agent-framework 1.26.1 or 1.26.2. Look in site-packages for agent_framework_meta.pth, agent_framework_meta/_telemetry.py, af_runtime_diag.pth or af_runtime_diag.py. Then search proxy and DNS logs for the webhook.site endpoint published in the advisory.

What should I do if a host installed one of the bad versions?

Treat it as exposed. Pin to 1.26.0 and rebuild from a clean base, then rotate every credential the host or pipeline could reach, including Azure DevOps tokens and service connections, cloud credentials, registry tokens and git credentials, and review Azure and CI identity logs. Wiz notes stolen managed-identity and OIDC-exchanged tokens stay valid for up to 24 hours.

How did the attacker publish to Microsoft's PyPI project?

It is not confirmed. Wiz says the attacker appears to have used a stolen client certificate and private key for Microsoft's ESRP release pipeline. Microsoft has said only that it made some repositories private while it investigates malicious content.

Was AI involved in the attack?

Wiz reports that the attacker's tooling identified itself as Cairn, an open-source AI penetration-testing framework, and that a test run captured an AI coding agent configuration that appears to be the open-source Pi harness with a GLM-family model.

How does Anomity help with this?

Anomity's Endpoint Sensor reports which credentials and AI provider keys sit on each managed machine, with values redacted on the endpoint, alongside the AI agents, MCP servers, extensions, skills, hooks and CLIs installed. Hooks on agents such as Claude Code can allow, deny or log tool calls before they run, and a 90-day audit trail keeps the record.

Ask AI about Anomity
ChatGPT Claude Perplexity Google AI Grok