Microsoft’s own AI agent toolkit turned into a credential stealer last week, and the attack is a masterclass in how fragile the Python supply chain has become. On 17 November, attackers published two malicious versions of Microsoft’s Agent Framework package on PyPI. Both releases ran a stealer at Python startup, harvesting cloud credentials from environment variables and running processes before exfiltrating them to an attacker-controlled endpoint. PyPI quarantined the first release within minutes. The attacker republished a second one anyway. Here is exactly what happened and how to clean up if your team pulled the package.
What Happened to Microsoft Agent Framework on PyPI
Microsoft Agent Framework is the company’s open-source toolkit for building AI agents and coordinating them in workflows. It is popular enough to see roughly 200,000 monthly downloads on PyPI, which makes it an attractive target: one poisoned release reaches a lot of developer machines and CI pipelines.
The timeline, as documented by security firms Socket, Step Security and Ox Security:
- 17 November 2026: Versions 1.26.1 and 1.26.2 are published to PyPI under Microsoft’s official project, each containing a credential stealer.
- Both malicious releases kept their dependency on the legitimate
agent-framework-core1.26.0 package, so the toolkit kept working normally while the malware ran in the background. - PyPI quarantines 1.26.1 after the first detection.
- Roughly 2.5 minutes later the attacker publishes 1.26.2, showing they still had publishing access after the quarantine.
- PyPI quarantines 1.26.2 about eight minutes after that.
How the attacker gained publishing rights to Microsoft’s official PyPI project is still unclear. BleepingComputer contacted Microsoft and had not received a response by publication time.
How the Credential Stealer Worked
The technique is the part developers should study. Python’s .pth files are processed at interpreter startup, which means code in a package can execute even when the package is never imported. Anyone who ran python or pip in an environment with the malicious version installed triggered the stealer just by starting the interpreter.
- Version 1.26.1 used a file named
agent_framework_meta.pthto execute the stealer inagent_framework_meta/_telemetry.pyduring Python startup. - Version 1.26.2 restored the original package initializer and moved the malicious code into
af_runtime_diag.pthandaf_runtime_diag.py, a fresh disguise after the first quarantine. - Both versions exfiltrated collected data to the same attacker-controlled endpoint at
webhook.site, a public webhook service that makes tracking the traffic straightforward in egress logs.
Because the real agent-framework-core dependency stayed intact, no application behaviour changed. Nothing looked wrong in development or tests. That combination of a working package and startup-time execution is why this class of attack keeps succeeding.

What the Malware Stole
Version 1.26.1 harvested secrets from environment variables, local configuration files and other running processes where permissions allowed. The target list reads like a developer’s entire cloud life:
- Cloud platforms: Azure and AWS credentials
- Developer services: GitHub tokens, Docker credentials, Hugging Face and OpenAI keys
- Azure identity tokens: the stealer also attempted to obtain Azure managed identity access tokens and Azure DevOps OIDC tokens, which can unlock additional cloud resources beyond the immediate machine
- Version 1.26.2 added requests for GitHub Actions OIDC tokens and searches of GitHub runner directories, aiming at CI/CD infrastructure rather than just workstations
If a build agent ran one of these versions, assume that pipeline’s cloud roles are compromised, not just the package environment.
How to Check If You Are Affected and Clean Up
- Check your installed versions. Run
pip show agent-frameworkor inspect your lock files. Any environment that resolved 1.26.1 or 1.26.2 between 17 and 18 November must be treated as compromised. - Isolate the environment. Stop running Python or pip on affected machines until they are secured. Executing anything on the box can trigger the startup hook again.
- Search egress logs for the webhook endpoint. The specific webhook.site URL path in the exfiltration traffic tells you whether transfers completed or were blocked. This is the cleanest way to scope the breach.
- Rebuild from a known-clean state. Rebuild environments from scratch and pin the safe 1.26.0 release. Do not just uninstall the malicious version, since keys may already be gone.
- Rotate every reachable credential. Azure and AWS keys, GitHub tokens, Docker logins, Hugging Face and OpenAI keys, Azure managed identity credentials and Azure DevOps OIDC trust. Anything the environment could touch must be rotated.
- Audit CI/CD systems separately. The 1.26.2 variant specifically hunted GitHub Actions tokens and runner directories. Check your GitHub organisation audit logs for unexpected token issuance during the window.
This Is Not an Isolated Case
The Agent Framework compromise fits a pattern that has repeated across the developer ecosystem in recent months. BleepingComputer’s related coverage lists three similar incidents:
- LiteLLM: the release pipeline of the popular AI tooling project was hacked to distribute info-stealer malware.
- OVHcloud CLI: official command line tool releases on GitHub were backdoored to steal developer secrets.
- NIKKE PC game launcher: a compromised game launcher spread remote access and data-stealing malware to players.
The common thread is that the package or download came from the real, official channel. Trust in the brand name is exactly what the attackers borrow, which is why install-time verification and version pinning matter more than vendor reputation.
How to Protect Your Python Installs From Supply Chain Attacks
- Pin versions and use hash checking. Tools like
pip install --require-hashesstop surprise releases from ever resolving in production. - Watch for .pth files. A startup-executing file in a package that has no reason to ship one is a red flag. Script-level reviews of your dependency tree catch this class early.
- Use supply chain scanners. Socket, Step Security and Ox Security all flagged this attack publicly, and their tooling exists precisely to catch malicious releases between publish and install.
- Assume official projects are targets. The package came from Microsoft’s real PyPI namespace. Verified publishers are not safe publishers.
- Keep CI/CD credentials short-lived. OIDC-based cloud access limits what a stolen runner token is worth.
Frequently Asked Questions
Which Microsoft Agent Framework versions were malicious?
PyPI versions 1.26.1 and 1.26.2 of the Microsoft Agent Framework package, published on 17 November 2026, contained a credential stealer. The safe release is 1.26.0, and both malicious versions were quarantined by PyPI.
Did the malicious package run even if I did not import it?
Yes. The malware used .pth files to execute at Python startup, so running python or pip in an affected environment was enough to trigger the stealer, even if your code never imported the Agent Framework package.
What credentials did the PyPI malware steal?
The stealer targeted Azure and AWS credentials, GitHub tokens, Docker logins, Hugging Face and OpenAI keys, plus Azure managed identity and Azure DevOps OIDC tokens. The second version also searched for GitHub Actions OIDC tokens and runner directories.
What should I do if I installed the compromised version?
Isolate the environment, stop running Python or pip on it, check egress logs for the webhook.site exfiltration path, rebuild from a clean state with version 1.26.0, and rotate every credential the environment could reach.
