Two malicious versions of Microsoft agent-framework were published to the Python package index PyPI on 17 November 2026, carrying a credential stealer that harvested cloud identity tokens, API keys and other secrets from developer machines. Versions 1.26.1 and 1.26.2 of agent-framework were live for less than an hour before PyPI quarantined them. Security firms including JFrog, Orca, Socket, Step Security and Ox Security discovered and documented the attack. Microsoft agent-framework is the company open source toolkit for building AI agents and coordinating them in workflows.
Version 1.26.1 reached PyPI at 20:35 UTC on 17 November, and PyPI quarantined it 31 minutes later at 21:06 UTC. The attacker uploaded version 1.26.2 two minutes after that, at 21:08 UTC, and PyPI removed both releases by about 21:16 UTC. The whole exposure window ran from 20:35 to about 21:20 UTC. JFrog said the package receives roughly 40,000 downloads a week, while Orca put the figure at about 190,000 monthly downloads. It remains unclear how the attacker gained access to publish releases under Microsoft official PyPI project.
How the agent-framework malware worked
The attack was entirely in packaging. Neither malicious release changed agent-framework code or pulled in a rogue dependency. Instead, each version added a Python .pth startup hook file that runs on every Python interpreter launch, even when the code never imports agent-framework. Version 1.26.1 appended a silent telemetry start call to the package initializer and added a 28 byte .pth file. Version 1.26.2 restored the legitimate initializer file byte for byte, to evade checks that compare files, and moved the payload to a new top level module with its own .pth file.
The collector ran as a detached background process and quietly harvested credentials. It collected environment variables matching sensitive words such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI and HF, from the current process and up to 300 other processes through the Linux process file system. It also requested fresh Azure managed identity tokens for 12 Azure resources, including Key Vault, Storage, Microsoft Graph and Container Registry, and Azure DevOps identity tokens. Version 1.26.2 widened the net to GitHub Actions identity tokens and searches of GitHub runner directories. All harvested data was compressed, encoded and posted to a webhook.site address controlled by the attacker.
Why the agent-framework attack was hard to spot
Both malicious versions kept their dependency on the legitimate agent-framework-core 1.26.0 package, so the framework kept working without errors while the malware ran in the background. The attacker repacked the clean wheel locally rather than building it through Microsoft normal release pipeline. JFrog found that the archive headers show the repack happened at 20:26 UTC on 17 November, nine minutes before upload, on a host with a clock set to UTC plus 8 hours. That scripted build let the operator push version 1.26.2 two minutes after PyPI quarantined version 1.26.1, which shows the attacker still had publishing access after the first quarantine.
BleepingComputer reported that it had contacted Microsoft to learn how the breach happened and had received no response by publication time. No CVE identifier has been assigned to the incident. The last clean version is 1.26.0, and the malicious versions have been quarantined by PyPI. The Microsoft publisher account has been secured, according to Orca, but removal from PyPI does not clean copies cached during the exposure window, including container images and build caches.
What agent-framework users should do now
Developers who installed either malicious version of agent-framework should assume every secret reachable from that host, container or runner is compromised. Security firms advise isolating affected environments and rebuilding from a known clean environment using the safe 1.26.0 release. Any potentially exposed credentials should be rotated at once. JFrog warned against running a bare pip uninstall in an infected environment first, because that starts Python and can trigger the hook again. Its guidance is to set the environment variable _AF_TEL to 1 first, which blocks both malicious versions, and then run cleanup using the affected environment Python binary. Teams should also check CI runners, container images and caches built during the exposure window for the hook files.

