Hijacked Microsoft AI package stole Azure cloud credentials from developers
Two booby-trapped releases of Microsoft’s agent-framework package reached the Python Package Index on November 17, 2026, published 33 minutes apart and built to harvest cloud credentials from any machine that installed them. Both versions, 1.26.1 and 1.26.2, have since been quarantined on PyPI.

· Originally published by ontime+ · Last verified: 18 Nov 2026

Key Points
- Two malicious versions of Microsoft's agent-framework PyPI package ran a credential stealer on every Python launch.
- The package, used to build AI agents, draws roughly 190,000 downloads a month before quarantine.
- Stolen Azure and GitHub tokens could let attackers move into cloud pipelines, researchers warned.
The latest:
Two booby-trapped releases of Microsoft’s agent-framework package reached the Python Package Index on November 17, 2026, published 33 minutes apart and built to harvest cloud credentials from any machine that installed them. Both versions, 1.26.1 and 1.26.2, have since been quarantined on PyPI. Eight security firms, including Socket, Endor Labs and Google-owned Wiz, reported the compromise.
Details:
- The package: Agent-framework is the meta-package for Microsoft Agent Framework, an open-source toolkit for building and orchestrating AI agents in Python. It pulls about 190,000 downloads a month, according to the researchers, placing a large base of AI developers and build servers in the blast radius.
- The mechanism: Socket said both versions install Python startup hooks that silently collect credentials, environment data and cloud identity tokens. Each wheel dropped a .pth file into site-packages — agent_framework_meta.pth in 1.26.1 and af_runtime_diag.pth in 1.26.2. Endor Labs said Python runs those import lines on every interpreter start, so the stealer fired on any Python launch, including pip itself.
- What was taken: According to the reports, the payload swept environment variables by substring matching, plus credential files tied to Azure CLI, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face and Azure DevOps agents. It also grabbed Azure DevOps OIDC tokens, managed-identity tokens and up to 8,000 characters of instance metadata.
- Minting new secrets: SafeDep said the code does more than read stored credentials — it asks the platform to issue fresh ones, meaning rotating existing secrets does not close the exposure. In an Azure DevOps pipeline, SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI suffice to request a federated token for api://AzureADTokenExchange.
- Cloud reach: On Azure compute, the stealer queried the managed identity endpoint for access tokens, using IDENTITY_ENDPOINT or MSI_ENDPOINT on App Service and Functions and the local metadata address 169.254.169[.]254 elsewhere. That service returns details on the virtual machine, its region, tags and identity token.
- Exfiltration: Collected data was written to a JSON document, zlib-compressed, Base64-encoded and sent by HTTPS POST to a hard-coded webhook[.]site address. Version 1.26.2 added a top-level module, af_runtime_diag.py, pulled GitHub Actions OIDC tokens and widened the search patterns for credential-related environment variables.
- Entry point: Researchers have not established how the attacker obtained publishing access to the official Microsoft package. OX Security assessed that the attackers appear to have hijacked the wheel creation flow to insert malicious logic, rather than tampering with the published source.
- Remediation: The firms advised isolating affected hosts and runners, pinning to the last safe release 1.26.0, and checking exposure between 8:35 and roughly 9:20 p.m. UTC on November 17. They also urged searching proxy and DNS logs for the webhook address, rotating credentials from a clean system, and auditing Azure identities and GitHub Actions workflows.
- Not the first: This is the second Microsoft-linked PyPI package compromised this year. In May 2026, the group behind TeamPCP pushed three malicious versions of durabletask, Microsoft’s Python client for the Durable Task workflow framework, to spread the Mini Shai-Hulud worm.
Between the lines:
The design choices point at build infrastructure rather than individual laptops. A .pth hook that fires on every interpreter start, token requests aimed at Azure DevOps and GitHub Actions, and metadata-service calls all pay off inside CI runners holding deployment identities. OX Security framed the case as attackers targeting the AI developer ecosystem and the pipelines behind it.
What’s next
Watch for Microsoft’s account of how publishing access was obtained, any confirmed downstream compromise of Azure tenants or GitHub Actions deployments, and whether PyPI tightens release controls on high-traffic meta-packages.