By Hamza Faisal
Hackers hijacked Microsoft's official agent-framework package on Python's package index on November 17, publishing two malicious releases that steal Azure and GitHub credentials from any machine that installs them. The attack shows even packages published under a trusted name can turn hostile — and in automated build pipelines, a single bad install can hand an attacker the keys to a company's cloud.
Versions 1.26.1 and 1.26.2 of agent-framework, Microsoft's official Python metapackage for its Agent Framework, appeared on PyPI on Monday evening. The first went up at 20:35 UTC; security firm SafeDep flagged it as malicious 22 minutes later. A second version followed 33 minutes later, carrying the same stealer under different file names. Both were removed from PyPI by about 21:20 UTC. The last known clean release is 1.26.0.
What makes the compromise especially dangerous is how little the victim has to do. Both releases plant a small .pth file in Python's site-packages directory, which runs the stealer every time Python starts — whether or not the application ever imports Agent Framework. A routine pip install in a CI job is enough to trigger it.
What the stealer grabs
The collector sweeps up environment variables whose names contain words like TOKEN, SECRET, KEY, AZURE, AWS, GITHUB or OPENAI, and reads credential files including Azure CLI data, Docker and npm configuration, Git credentials, Hugging Face tokens and application .env files. It also requests fresh tokens instead of relying only on stored credentials: Azure managed-identity tokens for services including Key Vault, Storage and Microsoft Graph, plus Azure DevOps pipeline tokens. The second release went further, adding requests for GitHub Actions identity tokens from workflows that can issue them.
The stolen data is compressed, encoded and sent to an address on webhook.site. Security firm Wiz, which tracked the incident, said the endpoint captured no more than 50 requests — a count of requests seen at the destination, not of affected machines. How many systems installed the two bad versions is not yet known. The package normally sees about 192,000 downloads a month, and the exposure window covered evening hours when automated builds routinely pull fresh dependencies.
Published under Microsoft's own account
The most unsettling detail is that the malicious releases appeared under the legitimate microsoft publisher account on PyPI — not a lookalike name or a typosquatted package. Wiz found no matching release tag for version 1.26.1 in Microsoft's GitHub repository, and no malicious code on the project's main branch. How the attacker obtained publishing access is still unknown.
SafeDep also noted that PyPI carried no attestation for the clean 1.26.0 release either, so users had no cryptographic way to tell Microsoft's genuine uploads from the attacker's. The incident follows a similar backdoor found in the LiteLLM package on PyPI in October — the latest in a run of supply-chain attacks on the AI developer toolchain.
What to do now
Anyone who installed agent-framework 1.26.1 or 1.26.2 — directly or through a loose version requirement — should pin the package to 1.26.0, check site-packages folders for agent_framework_meta.pth or af_runtime_diag.pth, and treat every secret the machine could reach as compromised: Azure service credentials, GitHub and npm tokens, and anything in .env files. CI images and containers built during the exposure window should be rebuilt from clean sources.
Removal from PyPI does not remove copies already installed or cached, so cleanup has to happen on every machine and pipeline that may have pulled the package. For teams running AI agents in production, the warning is blunt: the tools that build and run the agents are now targets themselves.



