Technology
Attackers Hijacked Microsoft's AI Agent Package on PyPI to Steal Cloud Credentials
Two poisoned releases of Microsoft's agent-framework package ran a credential stealer every time Python started, even if the package was never imported, before PyPI quarantined them.

Hackers compromised Microsoft's official Agent Framework Python package on PyPI, publishing two malicious versions designed to steal cloud credentials and other sensitive information from developers' systems. The malicious releases, versions 1.26.1 and 1.26.2, were published on November 17, 2026, and contained a credential stealer that executed automatically during normal Python startup in affected environments, even when the Agent Framework package was not imported.
Microsoft Agent Framework is Microsoft's open-source toolkit for building AI agents and coordinating them in workflows. It is a fairly popular tool with about 190,000 downloads a month on PyPI, according to The Hacker News. The package is the meta-package for the framework, so a compromise of this one package reaches a large share of the people building AI agents with Microsoft's tools.
The attack worked because of a long-standing Python feature. According to Socket and StepSecurity, the first malicious release used agent_framework_meta.pth to execute the credential stealer in agent_framework_meta/_telemetry.py during Python startup. The second release restored the original package initializer and moved the malicious code into af_runtime_diag.pth and af_runtime_diag.py. Python executes import lines in .pth files on every interpreter start, so the stealer ran on any Python launch in an affected environment, including pip itself, whether or not anything imported Agent Framework.
Version 1.26.1 contained a credential stealer that harvested secrets from environment variables, local configuration files, and other running processes where permissions allowed, targeting Azure, AWS, GitHub, Docker, Hugging Face, OpenAI, and other services. The malware also attempted to obtain Azure managed identity access tokens and Azure DevOps OIDC tokens, potentially giving attackers access to additional cloud resources. Version 1.26.2 added GitHub Actions OIDC token requests and searches of GitHub runner directories, and it collects GitHub Actions OIDC tokens and expands the search patterns used for harvesting credential-related environment variables.
"Both versions install Python startup hooks that silently collect credentials, environment data, and cloud identity tokens, then exfiltrate them to a webhook[.]site endpoint," Socket said in a report. The stolen information was saved into a JSON document, compressed, encoded, and sent to an attacker-controlled webhook endpoint. The code also asked the platform to issue new credentials, pulling Azure instance metadata and retaining up to 8,000 characters of the response, which means rotating stored secrets alone would not cover everything the stealer could reach.
Both versions retained their dependency on the legitimate agent-framework-core 1.26.0 package, allowing the framework to function normally while the malware ran in the background. That is what made the compromise hard to spot: applications built on the framework kept working, and nothing in the package's normal behavior would have told a developer that a credential stealer was running alongside it.
PyPI quarantined the first malicious release, but the attacker published a second version, which was also quarantined. The two malicious versions were published 33 minutes apart on November 17, 2026, and users were advised to check for exposure to the malicious versions between 8:35 and roughly 9:20 p.m. UTC on November 17, 2026. The second release indicates that the attacker still had publishing access after the initial quarantine.
Multiple security firms discovered and documented the attack, including Socket, Step Security, and Ox Security, with reports also coming from Aikido, Chainguard, Endor Labs, SafeDep, and Google-owned Wiz. It remains unclear how the attacker gained access to publish malicious releases under Microsoft's official PyPI project, and BleepingComputer has contacted Microsoft to learn what the point of breach was, but had not received a response by publication time.
Developers who installed either malicious version should isolate affected environments, avoid running Python or pip until they are secured, and rebuild from a known-clean environment using the safe 1.26.0 release. Any potentially exposed credentials that were within the reach of the compromised environment should be rotated immediately, and investigators should look for the specific webhook URL path in egress logs and distinguish blocked requests from completed transfers. Users were also advised to audit Azure identities and review sign-in and activity logs, and to audit GitHub Actions workflows that deploy to Azure.
"The malicious agent-framework shows how attackers are targeting the AI developer ecosystem and the CI pipelines behind it," OX Security said. Agent-framework is the second Microsoft-related PyPI package to be compromised this year. In May 2026, the threat actors behind TeamPCP pushed three malicious versions of durabletask, Microsoft's Python client for the Durable Task workflow execution framework, to distribute the Mini Shai-Hulud worm.
Why it matters: This incident matters because it hits the exact place where AI development is most trusting: the official package registry. Developers install agent-framework without a second thought because it comes from Microsoft, and the malware exploited that trust plus a Python startup mechanism that runs code before any import happens, so normal caution about what you import would not have helped. The eight-minute second release is the detail that should worry package maintainers most, because it shows quarantining one bad version did not end the compromise while the attacker still held publishing access. With AI agent tooling now sitting on top of cloud credentials and CI pipelines, a short-lived poisoned package can turn into long-lived access to a company's cloud, which is why the advice is to rebuild environments and rotate credentials rather than just uninstalling the bad versions.
Reporting: BleepingComputer · The Hacker News
Spot an error? Orbit News corrects articles promptly and notes the correction in the article. See our Editorial Policy, or flag an error by messaging us on Facebook, X, or Instagram.


