Contact Open demo
Blog

agent-framework PyPI compromise: which identities the stealer targeted

nerl0 TeamSecurity research
News
agent-framework PyPI compromise: which identities the stealer targeted

On 17 November 2026, two malicious versions of agent-framework, the PyPI package for Microsoft's Agent Framework, were published and removed within about an hour. According to Wiz, Orca, Socket and others, versions 1.26.1 and 1.26.2 carried a credential stealer aimed at Azure, Azure DevOps, GitHub Actions and other developer secrets. SecurityWeek and Orca put the package at about 190,000 downloads a month.

The short answer for defenders: if either version ran anywhere, rotating stored secrets is not enough. The stealer also requested fresh managed-identity and CI federation tokens, so you need to review which managed identities and federated credentials were reachable from that host, and what their roles allow.

In this piece, we will cover:

  • What happened, in time order
  • What the stealer collected
  • Why identity tokens change the clean-up
  • What the researchers recommend
  • Questions to ask about hosts that build or run agents
  • Where nerl0 fits, and what this does not show

What happened to the agent-framework package?

Times below are UTC, as Wiz and Orca give them. The last clean release, 1.26.0, was published on 12 November. The related agent-framework-core package and 22 sibling packages were not affected, according to Orca.

Time (17 Nov 2026)EventSource
20:35Malicious version 1.26.1 is uploaded to PyPIWiz, Orca
about 21:08Malicious version 1.26.2 is uploaded after 1.26.1 is quarantinedWiz, Orca, Help Net Security
about 21:20 to 21:30Both versions are no longer available on PyPIOrca, Wiz
18 NovA maintainer confirms on GitHub that the releases were removed and an investigation is under waySecurityWeek

How the attacker got publishing rights is not settled. Help Net Security notes that none of the reports explain it. Wiz assesses that the attacker appears to hold a client certificate and private key for Microsoft's internal signing and publishing service, ESRP, and says it does not know how they were obtained. SecurityWeek reports that SafeDep found a newly created PyPI maintainer account with publish rights, and that its role is not confirmed. SecurityWeek also notes that, unlike earlier releases, the malicious versions shipped only built packages, and that Wiz found no matching code in Microsoft's source repository.

What did the stealer collect?

Both versions installed a .pth file in site-packages. Python processes these files at interpreter start, so the code ran whenever Python started in that environment, even if nothing imported the framework, as BleepingComputer and Socket describe. It then sent everything it found in one compressed, encoded POST request to a webhook.site address. Socket says the payload did not download or run further code.

The researchers list the same targets with small differences. Combined from Socket, Wiz and Orca, the stealer looked for:

  • Environment variables whose names contain terms such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI or HF_, in its own process and in up to 300 other processes.
  • Credential files: Azure CLI files, Azure DevOps agent credentials, .npmrc, pip.conf, .netrc, .git-credentials, Docker config.json, Hugging Face tokens and .env files.
  • Azure managed-identity tokens for 12 resources, including Azure Resource Manager, Microsoft Graph, Key Vault, Storage, Container Registry and Azure DevOps, requested from the instance metadata endpoint.
  • Azure DevOps tokens: the pipeline access token and an OIDC token when the pipeline exposes one.
  • GitHub Actions OIDC tokens (1.26.2 only) for Azure audiences, in workflows that allow id-token: write.

On impact, Wiz gives the only numbers. The attacker used the free tier of webhook.site, which keeps a limited number of requests. Of the 50 requests Wiz could see, it counted 3 unique successful exfiltrations of victim data. Wiz notes that this free tier stores at most 100 requests and deletes them after seven days.

Why do identity tokens change the clean-up?

A stolen API key is a stored secret. You rotate it and the old one stops working. A managed-identity or OIDC token is different. It is issued on request to whatever code runs on the host, and it carries the roles assigned to that identity. Help Net Security quotes StepSecurity's point that rotating stored secrets does not cancel tokens that were already issued. Wiz says the stolen managed-identity and OIDC tokens stay valid for up to 24 hours.

So the useful question is not only which secrets sat on the host. It is which identities the host could act as, and what those identities can reach. A CI runner with a federated credential for a production subscription is worth more to an attacker than a laptop with an npm token. We compared the Azure identity types in Azure identities for AI agents, and the same logic applies to credentials a coding agent inherits on a developer machine.

What do the researchers recommend?

Wiz, Orca, BleepingComputer and Help Net Security converge on these steps:

  1. Find exposure. Search lockfiles, CI logs, virtual environments, caches and images for versions 1.26.1 and 1.26.2, and site-packages for agent_framework_meta.pth or af_runtime_diag.pth.
  2. Isolate first. Take affected hosts and runners offline before running Python or pip there again, and rebuild from a clean base.
  3. Pin a clean version. Use agent-framework==1.26.0, with hash verification as Orca suggests.
  4. Check egress. Look in proxy and DNS logs for the webhook.site path. Wiz notes that a 200 response means the data was accepted.
  5. Rotate stored secrets from a clean system: service principal credentials, Azure DevOps PATs and service connections, GitHub, npm, PyPI, Hugging Face and Docker tokens, and anything in .env files.
  6. Review identities. Audit Entra sign-in and activity logs for managed identities and federated credentials, and review OIDC permissions and role assignments.

Step six is the one most clean-up lists treat as an afterthought. It needs an answer to a plain question: which identities did that runner or host have, and what can they do?

Which questions should you ask about hosts that build or run agents?

  • Which identities can code on this host request tokens for? Managed identities, workload identity federation, pipeline tokens.
  • What roles do those identities hold, and at what scope? A subscription-wide role turns a short-lived token into a large blast radius.
  • Which workflows allow id-token: write, and which cloud roles trust them?
  • Who owns each identity? Someone has to decide whether a role can shrink.
  • Which long-lived secrets live in files or environment variables on build agents and developer machines?

Our guide to least privilege for AI agents walks through shrinking a role once you know what it reaches.

Where nerl0 fits

nerl0 maps every AI agent and non-human identity and what each can reach, including service accounts and the credentials behind them. It connects read-only through each platform's own interfaces and reads configuration and permission data, never the contents of data stores.

The Security Graph shows authority paths: agent, credential, role, crown-jewel data store. Every step is an observed relationship. A question like 'which non-human identities can reach production data, and who owns them?' can be activated as one of your Questions and is measured again with every scan. Issues carry severity, evidence, an owner and a recommended breakpoint, and the next scan verifies the fix. Other agent-related incidents are collected in the Incident Tracker.

What this does not show

An authority path shows what an identity can reach in configuration. 'Proven' describes the route, not that anyone used it. A map of reach does not show which package versions were installed, whether a token was stolen, or what an attacker did with it. For that you need package inventories and sign-in and activity logs. Every answer states what it cannot show. More in A route is not proof of use.

Summary

On 17 November 2026, versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package on PyPI carried a credential stealer that ran on any Python start. It collected environment secrets and credential files and requested managed-identity, Azure DevOps and GitHub Actions OIDC tokens. How the attacker got publishing rights is still unclear. If either version ran on a host, rebuild it, rotate its secrets and review what every identity on that host can reach.

Sources

  1. Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines, Wiz, accessed Nov 20, 2026
  2. Microsoft Agent Framework PyPI Supply-Chain Attack: Versions 1.26.1 and 1.26.2 Steal Cloud Credentials, Orca Security, accessed Nov 20, 2026
  3. Microsoft's agent-framework PyPI package Compromised with Credential Stealer, Socket, accessed Nov 20, 2026
  4. Microsoft Agent Framework Releases Poisoned With Credential Stealer, SecurityWeek, accessed Nov 20, 2026
  5. Microsoft's Agent Framework PyPI package compromised to steal credentials, BleepingComputer, accessed Nov 20, 2026
  6. Credential stealer slipped into Microsoft's official Python agent framework, Help Net Security, accessed Nov 20, 2026
nerl0 TeamSecurity research

We write about what AI agents and non-human identities can reach, and build nerl0 to keep that visible.

See it on your own data.