Microsoft's AI agent framework hijacked on PyPI to steal cloud keys

Two rogue releases of Microsoft's Agent Framework ran a credential stealer on every Python start before PyPI pulled them, security researchers say.

Illustration of a cardboard software package on a conveyor belt with a hook slipping out of a tear in its side, while cables run up to padlocks being picked beside a laptop. Image: AgenticFeed illustration

Attackers published two malicious versions of Microsoft's Agent Framework, the company's open-source Python toolkit for building AI agents, to the Python Package Index on Tuesday, according to security researchers at Wiz, JFrog, StepSecurity and Socket. The rogue releases carried a credential stealer aimed at cloud accounts and build pipelines, and PyPI removed both within about an hour.

Version 1.26.1 of the agent-framework package went live at 20:35 UTC on Nov. 17, and version 1.26.2 followed at about 21:08 UTC, Wiz said. JFrog reported that PyPI quarantined the first release 31 minutes after it appeared and had removed both by 21:16 UTC.

The last safe version is 1.26.0, published Nov. 12, according to Wiz. The firm put the package's downloads at about 41,000 a week, and BleepingComputer reported roughly 200,000 a month.

A hook that runs without an import

Both releases added a .pth file to the root of an environment's site-packages folder. Python processes those files every time the interpreter starts, so the stealer ran whenever Python launched in an affected environment, even if no code imported the agent framework, Wiz said.

JFrog noted that this includes everyday commands such as pytest, pip, container entrypoints and IDE language servers. The attacker left the dependency on the legitimate agent-framework-core 1.26.0 package untouched, so the framework kept working normally while the malware ran in the background, according to BleepingComputer.

The PyPI advisory says the payload collected environment variables with names matching strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB and OPENAI. It also read credential files, including Azure CLI sessions, .npmrc, .git-credentials, Docker configs and Hugging Face tokens, and requested Azure managed identity tokens.

Version 1.26.2 added requests for GitHub Actions OIDC tokens, the advisory says. Collected data was compressed and sent to a public webhook.site address.

AI tooling on the attacker's side

Wiz said the attacker appears to have compromised a client certificate and private key for Microsoft's Engineering System Release Pipeline, the internal service Microsoft uses to sign and publish the package. A first publishing attempt from AWS was rejected by IP filtering, and a second attempt from Microsoft-owned IP space succeeded, according to the firm. Wiz said how the credentials were obtained is not yet known.

The attacker's tooling identified itself as Cairn, an open-source AI penetration-testing framework, Wiz reported. Before publishing, the attacker ran the stealer on their own machine, and that run captured the configuration of an AI coding agent that appears to be the open-source Pi harness backed by a GLM-family model, the firm said.

A small haul, but fast exposure

Because the attacker used webhook.site's free tier, which logs at most 100 requests, Wiz was able to review the 50 requests the endpoint stored. Four came from the attacker's own machines, and 29 appeared tied to sandbox environments and vendor testing, the firm said. The remaining 17 represented three unique, successful thefts of victim data, according to Wiz.

The short window was still enough to reach automated systems. JFrog said dependency bots such as Renovate were opening upgrade pull requests in downstream repositories within six minutes of 1.26.1 appearing on PyPI.

According to the PyPI advisory, PyPI Security worked with Microsoft to review the project's accounts and complete remediation steps. BleepingComputer reported Wednesday that Microsoft had not responded to its questions about the point of breach by publication time.

Wiz also noted that another Microsoft Python package, durabletask, was compromised earlier this year after its PyPI token was stolen. The firm said it has not linked the two incidents.

What affected teams are told to do

The PyPI advisory says any system or CI job that installed either version should be treated as compromised, and that every credential reachable from it should be rotated. Wiz advised teams to search lockfiles, CI logs, virtual environments and container images for the two versions and to check egress logs for the webhook address, pinning installs to 1.26.0. The firm added that stolen managed identity and OIDC-exchanged tokens stay valid for up to 24 hours.

Source: Wiz, “Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines”

Additional sources: PyPI advisory (OSV), “agent-framework 1.26.1 and 1.26.2 contain credential-stealing code”; JFrog Security Research, “Microsoft's agent-framework Hijacked on PyPI via Silent .pth Startup Hook”; BleepingComputer, “Microsoft's Agent Framework PyPI package compromised to steal credentials”; StepSecurity, “Microsoft agent-framework PyPI Package Compromised”

Get the AgenticFeed newsletter

A free, regular roundup of the agent stories that matter. No spam, and you can unsubscribe at any time.

Want to reach readers following AI agents? Advertise with AgenticFeed

Next event · 19 Nov, 2026

MCP Dev Summit Nairobi

The Linux Foundation’s Nov. 19 and 20 summit brings Model Context Protocol developers to Kenya, with keynotes from OpenAI, GitHub and the Gates Foundation.

The AgenticFeed newsletter

A free, regular roundup of the agent stories that matter. No spam.