- Subject
- Microsoft 365 & SharePoint
- Filed
- Source
- David Garcia
- Loans
- 394
Malicious Microsoft Agent Framework Releases Target Azure and CI Credentials
Two compromised PyPI versions ran credential theft code during Python startup. Teams should check build artifacts and rotate secrets exposed to affected hosts.

Two malicious releases of Microsoft’s Agent Framework package on PyPI put Azure credentials, developer secrets and CI/CD tokens at risk. Versions 1.26.1 and 1.26.2 were available on November 17 for less than an hour, but that brief window may still matter: package installs, cached dependencies and build artifacts created during it could carry the malware into environments that use the framework.
The malicious code ran whenever Python started, even when an application didn’t import the package. At the same time, the releases included genuine framework code, so software could continue to work and the compromise might not be immediately apparent. OX Security reported that the package had 192,534 monthly downloads. Aikido Security, Endor Labs and SafeDep also published analyses of the incident.
What the package collected
The payload searched for environment variables whose names included terms such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI, OX Security said. 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. The malware also gathered secrets from as many as 300 other running processes.
It could request credentials as well as search for ones already present. Within Azure DevOps pipelines, the code asked for 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.
Endor Labs assessed that automated build systems were the main target, while developer laptops were also within scope. That distinction matters for incident response: a build runner can hold credentials for cloud services and package registries that reach beyond the machine itself. Teams should consider what each affected host could access when deciding which secrets to replace.
The malware was tucked into a module called _telemetry.py and presented its network traffic with the user agent “af-runtime-diagnostics,” OX Security reported. It sent stolen data to an attacker-controlled webhook.site address as compressed, encoded JSON. The diagnostics framing and continued presence of the real framework code could make the malicious behavior less obvious during routine checks.
A short release window can leave persistent traces
Aikido Security recorded the first malicious upload at 20:35 UTC and the second at 21:08 UTC. Both versions had been removed by about 21:20 UTC. The incident nevertheless involved two uploads: after version 1.26.1 was reverted to clean version 1.26.0, the attacker uploaded 1.26.2 with the same payload placed at a different file path, OX said.
Researchers have not established publicly how the attacker gained the ability to publish the releases. OX Security said the activity appeared consistent with a hijacked package wheel build process. Endor Labs noted that the malicious releases were uploaded as wheel files only, without the source package that accompanied the clean release. Microsoft has not confirmed the method of compromise.
Removing a malicious release from a package index doesn’t remove copies already installed or cached. An unpinned install made while either version was available could have retrieved it, Endor Labs said. Container images, CI caches and lockfiles created in that period may also retain the compromised package. Teams should therefore check build outputs and dependency records as well as current developer environments.
AI development credentials were among the targets
The targeted credentials included OpenAI and Hugging Face tokens, alongside access to Azure AI Foundry. OX Security described the activity as part of a wider focus on AI development tools and the automated pipelines used to build and deploy them. For teams, the practical concern is the path from a developer dependency to the credentials available on a workstation or runner: an otherwise routine package installation can expose secrets beyond that project.
This was the second reported compromise this year involving a Microsoft Python package. In May, Endor Labs detected three trojanized releases of durabletask, Microsoft’s Python SDK for Azure Durable Functions. Researchers have not linked that incident to the Agent Framework compromise.
Checks and response for affected teams
Search environments, CI images and lockfiles for versions 1.26.1 and 1.26.2, and remove affected copies. OX Security identified agent_framework_meta.pth and agent_framework_meta/_telemetry.py as files to check on hosts and build agents. Aikido Security reported different indicators for version 1.26.2: af_runtime_diag.pth and af_runtime_diag.py.
If either release ran on a host, treat every secret accessible from that host as exposed. OX Security recommended rotating Azure service principal secrets and personal access tokens, along with GitHub, npm, PyPI, NuGet, Docker, Hugging Face and OpenAI tokens. It also advised reviewing Azure sign-in and activity logs for managed identity and federated credential use originating from affected build agents.
For future installs, OX Security recommended pinning Agent Framework to a verified Microsoft release and checking its hash. The firm also advised blocking outbound traffic to webhook.site from build infrastructure. These steps address different parts of the exposure: dependency controls reduce the chance of pulling an unexpected package, while outbound restrictions can limit where a compromised build environment sends data.
Teams should include cached dependencies and image rebuilds in their cleanup. Removing the package stops it from running in future Python starts, but it cannot retrieve credentials already sent out. The response should focus on identifying every environment that may have installed either release, replacing reachable secrets, and confirming that rebuilt systems use a verified package version.