Compromised Microsoft Agent Framework Releases Target Azure and CI Credentials
The Microsoft Agent Framework compromise exposed a supply chain risk with a broad reach: malicious PyPI releases could harvest credentials from developer machines and automated build systems while leaving applications apparently functional. The two versions, 1.26.1 and 1.26.2, were available for less than an hour on November 17.
Security researchers at OX Security, Aikido Security, Endor Labs and SafeDep analyzed the releases. OX described the payload as a credential stealer that collected cloud and package manager credentials, environment secrets and Azure managed identity tokens, then sent the data to an attacker controlled webhook. The package receives 192,534 monthly downloads, according to OX.
Designed to run quietly in build environments
The malware ran whenever Python started, even when an application didn’t import the framework. It also included the legitimate framework code, which could let affected software keep working and make the compromise harder to spot.
Its collection routine searched environment variable names for terms including TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI. It also read as many as 60 credential files, including Azure CLI settings, Git and Docker credentials, npm and pip configuration, Hugging Face tokens, Azure DevOps build agent credentials and application .env files. OX said the code also extracted secrets from up to 300 running processes.
The payload sought fresh credentials as well as stored ones. In Azure DevOps pipelines, it requested an identity token that could be exchanged for Azure access. It also requested managed identity tokens for Azure Resource Manager, Microsoft Graph, Key Vault, Storage, Cognitive Services, AI Foundry and Azure DevOps.
That emphasis points to build infrastructure as a primary target. Endor Labs said developer laptops were within scope, but that the code was written for CI runners and Azure workloads. Tokens for OpenAI and Hugging Face, along with Azure AI Foundry access, were among the resources the malware could reach.
Two releases, one changing payload
The code posed as diagnostics: it appeared in a module called _telemetry.py and identified its traffic with the user agent “af-runtime-diagnostics.” OX said it sent compressed, encoded JSON to a webhook.site address.
Aikido placed the first upload at 20:35 UTC and the second at 21:08 UTC; both had been removed by about 21:20 UTC. During OX’s investigation, version 1.26.1 was replaced with the clean 1.26.0, then the attacker published 1.26.2 with the same payload in a different file path.
OX suspects the attacker hijacked the process used to build the package’s wheel files. Endor Labs noted that the two malicious versions were uploaded as wheels only, without the source package distributed with the clean release. Microsoft has not publicly explained how the publishing process was compromised.
The brief availability window doesn’t rule out lingering exposure. An unpinned installation during that period could have retrieved a malicious release, and container images, CI caches or lockfiles created then may still include it.
Exposure can persist after removal
Deleting the package prevents it from running again, but it cannot retract credentials already transmitted. OX advised teams to search environments, CI images and lockfiles for versions 1.26.1 and 1.26.2, and to check hosts and build agents for agent_framework_meta.pth and agent_framework_meta/_telemetry.py. Aikido identified af_runtime_diag.pth and af_runtime_diag.py as files used by version 1.26.2.
If the package ran on a system, OX said, teams should assume that every secret accessible there may have been exposed. Its guidance includes rotating Azure service principal secrets and personal access tokens, as well as GitHub, npm, PyPI, NuGet, Docker, Hugging Face and OpenAI tokens. Teams should also review Azure sign-in and activity logs for managed identity or federated credential use from affected build agents.
Pinning Agent Framework to a verified Microsoft release with hash checking can reduce the chance of pulling an altered package. OX also recommends blocking outbound connections to webhook.site from build infrastructure. The incident follows a separate 2024 compromise involving trojanized versions of Microsoft’s durabletask Python SDK; researchers have not linked the two events. For teams running Python builds, checking cached artifacts and rotating reachable credentials are the immediate steps that address the exposure left behind.