Attackers pushed two poisoned releases of Microsoft's Agent Framework package to PyPI on November 17. Both were gone in under an hour, and that was enough. The payload was a credential stealer built to take cloud tokens, developer secrets, and CI/CD credentials from laptops and automated build runners. My read is that the build systems were the real target.
Version 1.26.1 appeared at 20:35 UTC and 1.26.2 at 21:08 UTC. Both were off the index by about 21:20 UTC, according to Aikido Security. Microsoft hasn't said how the attacker got publishing access, and it didn't immediately respond to a request for comment. Endor Labs, SafeDep, and others published their own analyses of the same releases.
How the stealer worked
The payload ran every time Python started, even if no code imported the package. It also installed the genuine framework code, so applications kept working and nothing looked broken. OX Security, which flagged the releases, said the package has 192,534 monthly downloads. In its blog post, OX put it bluntly: "The package is a credential stealer: it harvests environment secrets, cloud and package-manager credentials, and Azure managed identity tokens, then exfiltrates them to an attacker-controlled webhook."
The collection net was wide. It swept environment variables whose names contained TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, or OPENAI. It read up to 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. It also pulled secrets from up to 300 other running processes.
It didn't stop at stealing what already existed. Inside Azure DevOps pipelines, the stealer requested an identity token that can be exchanged for Azure access. It also requested managed identity tokens for Resource Manager, Microsoft Graph, Key Vault, Storage, Cognitive Services, AI Foundry, and Azure DevOps. That's the difference between a leaked key and a live foothold.
Endor Labs framed the target clearly. "Developer laptops are in scope, but the payload is written for CI runners and Azure workloads," the firm wrote in its analysis.
The code hid behind a diagnostics label. It lived in a module named _telemetry.py and sent traffic with a user agent string of "af-runtime-diagnostics." Stolen data left as compressed, encoded JSON sent to a webhook.site address.
A second release and a wheel-only upload
The attacker kept going after the first release was spotted. While OX was analyzing the malware, 1.26.1 was reverted to the clean 1.26.0. The attacker then uploaded 1.26.2, which carried the same payload under a different file path. OX said the attack was designed to keep working around blocks. "This attack isn't just a one-off exfiltration attempt, but a planned, live and coordinated effort to reach as many victims as they can, while still being able to bypass blocks and restrictions," the firm said.
OX believes the attackers found a way into the process that builds the package's wheel files. Endor Labs noticed that both malicious versions were uploaded as wheels only, without the source distribution that accompanied the clean release. That's a useful tell for anyone auditing their own pipelines. Microsoft still hasn't confirmed how the breach happened.
The short window doesn't cap the damage. Endor Labs warned that any unpinned install during those minutes pulled in a malicious version. Container images, CI caches, and lockfiles built in that window could still carry it long after the package was pulled.
Why AI pipelines are the target
OX sees this as part of a broader push against the AI developer ecosystem and the CI pipelines that feed it. The stealer's target list includes OpenAI and Hugging Face tokens along with Azure AI Foundry access. Those are the keys that unlock model endpoints, training data, and deployment environments.
This isn't the first time a Microsoft Python package has been compromised this year. In May, Endor Labs detected three trojanized versions of durabletask, Microsoft's Python SDK for Azure Durable Functions. No researcher has linked the two incidents, but the pattern of official, trusted packages being turned into credential harvesters should concern anyone running Python in CI.
What security teams should do now
Removing the package doesn't reverse the damage. "Removing the package stops future runs, but it doesn't undo anything that was already sent," Aikido said.
OX recommends checking every environment, CI image, and lockfile for either version and removing it. On hosts and build agents, look for agent_framework_meta.pth and agent_framework_meta/_telemetry.py. Version 1.26.2 used different files, af_runtime_diag.pth and af_runtime_diag.py, according to Aikido.
If the package ran anywhere, treat every secret reachable from that host as compromised. That means rotating Azure service principal secrets, personal access tokens, and GitHub, npm, PyPI, NuGet, Docker, Hugging Face, and OpenAI tokens. Review Azure sign-in and activity logs for managed identity and federated credential use from affected build agents. OX also recommends pinning the agent-framework to a verified Microsoft release with hash checking, and blocking outbound traffic to webhook.site from build infrastructure.
The next compromised dependency may not crash anything or generate a bug report. Here, applications kept running, which is exactly why this one slipped through. For under an hour on November 17, an unpinned install was a trust decision, and the pipelines that made it are the ones that need auditing first.