Join our Newsletter — 33% off our NHI Course
Home› NHI Breaches› Microsoft Agent Framework PyPI Compromise 2026: How a…
Breach analysis Incident: 17 Nov 2026

Microsoft Agent Framework PyPI Compromise 2026: How a Hijacked Publishing Identity Shipped a Cloud and CI Credential Stealer

PDF for newsletter subscribers · free to read online

← All NHI breaches
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 20 November 2026 13 min read
On this page

On 17 November 2026, researchers at Wiz and Aikido reported that two malicious versions of agent-framework, the PyPI meta-package for Microsoft Agent Framework, Microsoft's Python SDK for building AI agents, had been published under the project's legitimate name. Versions 1.26.1 and 1.26.2 appeared 33 minutes apart that evening and each carried a credential stealer that ran on every Python start-up. It collected environment variables, credential files, Azure managed-identity tokens, Azure DevOps details and, in 1.26.2, GitHub Actions OIDC tokens, and sent them to a webhook endpoint. PyPI quarantined both releases within roughly 45 minutes. How the attacker obtained publishing rights is not confirmed: Wiz says the attacker appears to have compromised a client certificate and private key for Microsoft's release pipeline, while other researchers point to a PyPI token or maintainer session. Wiz saw three unique cases of successful victim data exfiltration. Microsoft had not published a statement at the time of writing.

Key takeaways

  • Malicious agent-framework 1.26.1 was uploaded at 20:35 UTC and 1.26.2 at about 21:08 UTC on 17 November 2026; StepSecurity records the second quarantine at 21:16:44 UTC. Version 1.26.0 is the last clean release.
  • The package has about 190,000 downloads a month, according to Aikido and The Hacker News, so even a window of under an hour reached automated builds and dependency bots.
  • The payload targeted machine identities, not people: cloud tokens minted from the instance metadata service for about twelve Azure audiences, Azure DevOps and GitHub OIDC tokens, and registry, Git and model-provider secrets.
  • Wiz analysed the attacker's webhook and found 17 requests representing three unique cases of successful victim data exfiltration; the initial access route remains unconfirmed and no group has been named.
  • The identity lesson: a single publishing credential for a popular agent SDK becomes a key to every downstream build that trusts it, so publishing identities need short-lived, attested, tightly scoped issuance.

At a glance

OrganisationsMicrosoft (publisher of the agent-framework PyPI project) and downstream developers and CI environments that installed 1.26.1 or 1.26.2
WhenMalicious releases published and disclosed 17 November 2026, between about 20:35 and 21:20 UTC
AttackerUnknown. No group named; Wiz says the tooling identified itself as Cairn, an open-source AI penetration-testing framework
Entry pointHijacked publishing access to Microsoft's official PyPI project; Wiz points to a release pipeline client certificate and key, others to a PyPI token or maintainer session (unconfirmed)
Identities abusedPackage publishing identity; on victim hosts, Azure managed identities, Azure DevOps and GitHub Actions OIDC tokens, Azure CLI caches, npm, PyPI, Git, Docker, Hugging Face and model-provider secrets
ImpactCredential theft from environments that installed the releases; Wiz observed three unique cases of successful exfiltration; full victim count unknown
CategoryNHI; Agentic AI and AI agents (an AI agent SDK was the delivery vehicle). Incident class: Confirmed NHI breach (software supply chain compromise)

What happened

Microsoft Agent Framework is Microsoft's Python and .NET framework for building AI agents, and agent-framework is the PyPI meta-package that pulls in its core components. The legitimate 1.26.0 release was published on 12 November 2026 with both a wheel and a source distribution. Five days later, according to StepSecurity, version 1.26.1 was uploaded at 20:35:20 UTC on 17 November as a wheel only, with no provenance attestation. Aikido says the wheel appears to have been unpacked, edited by hand and re-uploaded, which the Cloud Security Alliance (CSA), citing JFrog, supports.

The added code was a start-up hook. Each malicious wheel dropped a .pth file into site-packages, which Python runs whenever the interpreter starts, including when pip runs, whether or not the package is imported. The Hacker News lists what it collected: environment variables matched by name, credential files such as Azure CLI token caches, .npmrc, pip.conf, .netrc, .git-credentials, Docker configuration and Hugging Face and Azure DevOps agent files, plus Azure DevOps OIDC tokens and Azure managed-identity tokens, which the code requested fresh from the platform. Wiz says it asked for tokens for 12 Azure resources. Data was compressed, encoded and sent in one HTTPS POST to a hard-coded webhook.site address. PyPI quarantined 1.26.1 at 21:06 UTC, and 1.26.2 followed about two and a half minutes later with the hook moved to new file names and with added collection of GitHub Actions OIDC tokens. That release was quarantined at 21:16 UTC.

The route to publishing rights is the main open question. Wiz says the attacker "appears to have compromised a client certificate and private key for Microsoft ESRP", Microsoft's release pipeline, and reports that a first publishing attempt from AWS was rejected by IP filtering before a second attempt from Microsoft-owned IP space succeeded. It adds: "How the credentials were obtained is not yet known." StepSecurity reports that a new maintainer account was added to the project on 17 November before the first malicious upload, and CSA concludes that a long-lived PyPI API token or maintainer session was more likely than a CI workflow compromise, while stressing that this is not confirmed. The Hacker News notes a separate May 2026 compromise of Microsoft's durabletask package attributed to TeamPCP but does not link the two; Wiz also says the two incidents have not been linked.

Microsoft had not commented publicly at the time of writing. BleepingComputer said it had contacted Microsoft "to learn what the point of breach was" and had not received a response by publication time. Aikido summarised the position for affected users: "Removing the package stops future runs, but it doesn't undo anything that was already sent."

Timeline

DateEvent
12 November 2026Legitimate agent-framework 1.26.0 is published as a wheel and source distribution.
17 November 2026A new maintainer account is added to the project, according to StepSecurity; malicious 1.26.1 is uploaded at 20:35 UTC.
17 November 2026PyPI quarantines 1.26.1 at 21:06 UTC; 1.26.2 is uploaded at 21:08 UTC and quarantined at 21:16 UTC.
17 November 2026Wiz and Aikido publish their analyses; Wiz reports its findings to Microsoft.
18 November 2026The Hacker News, BleepingComputer and StepSecurity report the compromise; Microsoft has not responded.
19 November 2026The Cloud Security Alliance publishes a research note; the root cause remains unconfirmed.

How it happened: the identity attack path

  1. Publishing identity obtained. The attacker gained the ability to publish to Microsoft's official PyPI project. Wiz points to a stolen release pipeline client certificate and private key; StepSecurity and CSA note a newly added maintainer account and a possible long-lived token or session. None of these has been confirmed.
  2. Trusted release repacked. The clean 1.26.0 wheel was modified locally and uploaded as 1.26.1 without the source distribution or provenance attestation that normal releases carry, so it inherited the project's name and reputation.
  3. Automatic adoption downstream. Loose version ranges, fresh installs and dependency bots picked up the new version within minutes. CSA reports that automated upgrade pull requests began appearing about six minutes after the first upload.
  4. Machine identities harvested on start-up. On every interpreter start the hook read secrets from environment variables, other processes and credential files, and asked the local identity endpoint for fresh Azure tokens. Version 1.26.2 also tried to obtain GitHub Actions OIDC tokens, which can be exchanged for cloud access where a workflow has id-token: write.
  5. Exfiltration and persistence attempt. Collected data was posted to a webhook endpoint. When the first release was quarantined, the attacker published a second with renamed files, which Wiz says could be missed by anyone searching only for the first set of indicators.

Impact

  • Confirmed: Two malicious releases of an official Microsoft package were live on PyPI for under an hour and executed a credential stealer in any environment that installed them. Wiz captured 50 requests to the attacker's endpoint: 4 from the attacker, 29 that appear to be sandbox or scanner traffic, and 17 representing three unique cases of successful victim data exfiltration.
  • Unconfirmed: Whether stolen cloud tokens were used. CSA says researchers have not confirmed that any token was actually issued, and that JFrog found the Azure DevOps token request was malformed and would have failed. Wiz notes that stolen managed-identity tokens can be valid for up to 24 hours.
  • Potential: With about 190,000 downloads a month, any CI runner, container build or developer machine that resolved the package in the window could have exposed Azure, GitHub, npm, PyPI, Docker, Hugging Face and model-provider credentials, giving a route to further supply chain attacks.
  • Open questions: Microsoft has not disclosed how access was obtained or how many customers were affected.

What this means for NHI and AI agent security

This incident sits on an NHI list twice over. The way in was a machine publishing identity: whether a pipeline certificate, an API token or a maintainer session, it was a credential trusted by PyPI to speak for Microsoft. The payload then went after the non-human identities of everyone downstream, minting cloud tokens from managed identities and OIDC providers rather than only scraping static keys. Agent builders typically hold model-provider keys, cloud workload identities and deployment credentials in the same environment, so an agent SDK is a high-value carrier.

The general lesson matches the LiteLLM supply chain attack and the Tensorlake npm worm: publishing credentials for AI tooling are now a favoured entry point, and the stolen material is used to reach the next project. Publishers should move to short-lived, attested issuance as described in our PyPI API Tokens and Trusted Publishing Security Guide. Consumers should treat CI runners as identity holders, with the controls in our CI/CD Pipeline Identity Security Guide, and limit what a single interpreter can mint, as covered in the Azure Managed Identities Security Guide.

The quick second release also shows that takedown is not containment: until the publishing identity is revoked, the attacker can publish again. The same pattern of CI secrets being harvested at scale appears in the wfx-loot GitHub Actions campaign reported the same month.

Recommendations

  • Find every environment that resolved the bad versions. Search lockfiles, CI logs, dependency bot pull requests, mirrors and images built on the evening of 17 November for 1.26.1 or 1.26.2, and look for the .pth files named in the researchers' indicators. Rebuild from clean images pinned to 1.26.0 rather than cleaning in place; CSA warns that uninstalling with pip can trigger the hook again. See our CI/CD Pipeline Compromise Playbook.
  • Rotate everything the affected hosts could reach. Treat cloud keys, Azure DevOps service connections, Git, npm, PyPI, Docker, Hugging Face and model-provider keys on affected machines as stolen, and revoke cached Entra ID sessions where Azure CLI caches were present. See our Secrets Rotation Runbook Template.
  • Review managed identity and federated credential activity. Check sign-in logs for managed identities and service principals, GitHub OIDC federated credentials and role assignments for at least 24 hours after exposure, and recycle affected compute so tokens expire. See our How to audit Entra workload identity federated credentials.
  • Restrict what CI jobs can mint. Remove id-token: write and metadata service access from jobs that do not need them, scope federated trust to specific repositories and branches, and allowlist egress from runners. See our GitHub Actions OIDC Federation Hardening Guide.
  • Slow down automatic adoption of new releases. Pin dependencies with hashes, add a cooldown before bots adopt new versions, and flag releases that lack provenance or break a project's usual wheel and source pattern. See our Dependency Pinning vs Version Ranges.
  • Harden publishing identities. Project owners should use Trusted Publishing, retire long-lived API tokens, protect signing and pipeline certificates in hardware-backed stores, and alert on new maintainers. See our PyPI API Tokens and Trusted Publishing Security Guide.
  • Separate agent secrets from deployment identity. Keep model-provider keys, cloud workload identities and release credentials in different environments, so one compromised interpreter cannot harvest them all. See our Secrets Management Guide.

Frequently asked questions

Which versions of Microsoft agent-framework were malicious?

Versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI, published on 17 November 2026, were malicious. Version 1.26.0, released on 12 November 2026, is the last known clean release, and researchers recommend pinning to it and rebuilding any environment that installed either bad version between about 20:35 and 21:20 UTC.

How did attackers get access to Microsoft's PyPI package?

It has not been confirmed. Wiz says the attacker appears to have compromised a client certificate and private key for Microsoft's ESRP release pipeline, but says how they were obtained is not known. StepSecurity reports a new maintainer account added the same day, and the Cloud Security Alliance thinks a long-lived PyPI token or maintainer session was more likely. Microsoft has not published an explanation.

Were any credentials actually stolen?

Yes, in at least some cases. Wiz analysed the attacker's webhook endpoint and found three unique cases of successful victim data exfiltration among 50 captured requests. Whether stolen tokens were later used has not been reported, and some token requests in the code would have failed, according to JFrog as cited by the Cloud Security Alliance.

LiteLLM supply chain attack 2026 · wfx-loot GitHub Actions campaign 2026 · Tensorlake npm worm 2026 · PyPI API Tokens and Trusted Publishing Security Guide · CI/CD Pipeline Identity Security Guide

How NHI Mgmt Group can help

Publishing credentials, CI runner tokens and cloud workload identities are non-human identities that need inventory, ownership, scoping and rotation. NHI Mgmt Group helps security and platform teams map the machine identities in their build and release pipelines, replace long-lived publishing tokens with short-lived federated issuance, and prepare response playbooks for supply chain compromises like this one. See our NHI and AI agent security training.

References

PDF for subscribers

Take this breach analysis with you

The full analysis in one PDF: timeline, attack path, impact and recommendations, with links to the sources and related pages. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.