Malicious Microsoft Agent Framework Releases Target Cloud Credentials
Two compromised releases of Microsoft’s Python package for Agent Framework planted a credential-stealing component that runs whenever Python starts in an affected environment. The versions, 1.26.1 and 1.26.2, were published on November 17, 2026, and have since been quarantined on the Python Package Index (PyPI), according to security researchers.
The package, named agent-framework, is a meta-package for Microsoft Agent Framework, an open-source toolkit for building and orchestrating AI agents with Python. The malicious releases appeared 33 minutes apart. Researchers have not established how the attacker gained the ability to publish them.
Startup hooks enabled broad collection
Both releases placed a Python .pth file in the environment’s site-packages directory. Python processes import instructions in these files during interpreter startup, so the malicious code could run even when an application did not explicitly import Agent Framework. Researchers said this behavior could also affect Python tooling, including pip, when launched in the compromised environment.
Version 1.26.1 dropped a file named agent_framework_meta.pth, while 1.26.2 used af_runtime_diag.pth. The later release also introduced a top-level module named af_runtime_diag.py, added collection of GitHub Actions OIDC tokens and broadened its matching of credential-related environment variables.
Reports from security firms including Aikido, Chainguard, Endor Labs, OX Security, SafeDep, Socket, StepSecurity and Google-owned Wiz described collection of environment data, local credentials and cloud identity tokens. The code searched for credentials in files associated with Azure CLI, npm, pip, Git, Docker, Hugging Face and Azure DevOps agents, as well as .env and JSON files.
The exposure was not limited to secrets already stored on disk. In Azure DevOps pipelines, the code could use the SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI variables to request a federated token for api://AzureADTokenExchange. On Azure compute, it queried managed identity endpoints for access tokens and retrieved instance metadata. Researchers said the code used the relevant endpoint variables on App Service and Functions, and the local metadata address 169.254.169[.]254 in other environments.
Collected information was assembled into a JSON document, compressed, encoded and sent through an HTTPS POST request to a hard-coded webhook[.]site address. The campaign therefore could expose both credentials available to a build or runtime environment and tokens that the malicious code obtained directly from cloud identity services.
Containment and credential response
Organizations that installed either affected release should isolate the relevant hosts and CI runners, then rebuild from a clean environment using the most recent safe version identified in the reports: 1.26.0. Teams should establish whether the package was present during the exposure window, reported as approximately 8:35 to 9:20 p.m. UTC on November 17, 2026.
Security and platform teams should review proxy and DNS records for connections to the reported webhook[.]site endpoint. If an affected environment had access to secrets or identity tokens, rotate exposed credentials from a clean system. Because the malware could request fresh cloud tokens, rotating stored secrets alone may not address every exposure. Responders should also audit Azure identities and examine sign-in and activity logs for unexpected use.
Teams using GitHub Actions to deploy to Azure should review the relevant workflows and the credentials and permissions available to their runners. The incident highlights the risk of treating CI systems as isolated build infrastructure: packages executed there may inherit access to deployment identities, repository secrets and cloud resources.
The agent-framework incident is the second compromise of a Microsoft-related PyPI package reported in 2026. In May, three malicious versions of durabletask, Microsoft’s Python client for the Durable Task workflow execution framework, were distributed by actors associated with the TeamPCP worm. The incidents underscore the need to monitor dependency changes and treat unexpected package updates as potential credential exposure, particularly in automated environments.