SecurityNews
Microsoft’s AI agent toolkit shipped a credential stealer for under an hour. It ran even if you never imported it.
On 17 November, two poisoned versions of agent-framework, Microsoft’s Python toolkit for building AI agents, were published on PyPI. They stole cloud and CI credentials every time Python started, even in programs that never imported the package. They were gone within about 55 minutes. How the attacker got publishing access is still unexplained.
In short
- What happened. On 17 November, agent-framework 1.26.1 and 1.26.2, Microsoft’s Python toolkit for AI agents, were published on PyPI with a credential stealer inside.
- Who is affected. Anyone whose machine, container or CI job installed either version that evening. Version 1.26.0 is clean.
- The catch. The stealer ran on every Python start, even without importing the package. How the attacker could publish under Microsoft’s name is still unexplained.

Two poisoned releases on Microsoft’s own page
At 20:35 UTC on Tuesday, 17 November, version 1.26.1 of agent-framework appeared on PyPI, the main public index of Python packages. Version 1.26.2 followed at about 21:08 UTC. By about 21:30 UTC, both were gone, according to the timeline published by the cloud security firm Wiz.
Agent-framework is Microsoft’s open-source toolkit for building AI agents and chaining them into workflows. Wiz counts about 41,000 downloads a week; SecurityWeek puts it at about 190,000 a month.
Both releases worked like the real thing. They kept the legitimate agent-framework-core 1.26.0 as a dependency, BleepingComputer reports, so applications ran normally while the malware worked in the background.
When SIGNAL checked PyPI on 19 November, 1.26.0, published on 12 November, was listed as the latest version, and 1.26.1 and 1.26.2 no longer appeared.
Why never importing it did not protect you
The trick is a Python feature most developers never think about. When the interpreter starts, it reads every .pth file in the site-packages folder, and a .pth line that begins with “import” is executed.
Version 1.26.1 dropped a file called agent_framework_meta.pth. Its single line loads a module that starts the stealer in a detached background process, Socket and Wiz found. The code is labelled as a “lightweight runtime diagnostics hook”, so it reads like ordinary telemetry.
Not importing the package did not help. Any Python process started in that environment ran the payload: a test, a script, a build step.
Version 1.26.2 changed its hiding place. It restored the original package file byte for byte and moved the trigger to a new pair of files, af_runtime_diag.pth and af_runtime_diag.py. A check that only looks for the first file names misses it.
What it went looking for
The stealer read environment variables whose names contain strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI or HF_, and searched the environments of other running processes for the same kind of values.
It also collected credential files: Azure CLI sessions, .npmrc, pip.conf, .netrc, .git-credentials, Docker configuration, Hugging Face tokens, Azure DevOps agent credentials, and .env and JSON files under /app and /workspace.
It did not stop at copying. It requested fresh Azure managed-identity tokens for services including Key Vault, Storage and Azure AI, and Azure DevOps sign-in tokens. Version 1.26.2 added GitHub Actions: in workflows allowed to request identity tokens, it asked for tokens that can be exchanged for Azure access wherever Azure is set to trust that workflow.
Everything went out in one compressed HTTPS request to a webhook.site address. Socket says the payload did not download or run any further code.
How it got onto Microsoft’s page
Microsoft has not published an explanation. SecurityWeek reports that a maintainer confirmed in a GitHub discussion that the releases were removed and an investigation was under way. BleepingComputer had no answer from Microsoft when it published.
Wiz offers the most detailed account so far, from the attacker’s own mistakes. The attacker’s tools reported their progress to the same public webhook used for the stolen data. From those messages, Wiz says the attacker appears to have obtained a client certificate and private key for ESRP, the internal Microsoft service that signs and publishes this package.
A first publishing attempt from Amazon Web Services was rejected by ESRP’s IP filtering, Wiz says. A second, from Microsoft-owned IP space, went through. How the credentials were obtained is not known.
The attacker’s tooling identified itself as Cairn, an open-source AI penetration-testing framework, according to Wiz. SecurityWeek adds that the poisoned releases contained only built packages, without the usual source archive, and that Wiz found no matching code in Microsoft’s source repository.
How many were actually hit
Fewer than the download figures suggest, on the evidence available. The attacker used webhook.site’s free tier, which accepts at most 100 requests per address and expires after seven days. Wiz says it could analyse the 50 requests stored there.
Four came from the attacker’s own machines. Twenty-nine looked like sandboxes, security scanners and tests. The remaining 17 came from just three unique victims whose data was successfully sent.
That does not make the three cases minor: Wiz notes the captured data can contain working cloud, CI and registry credentials. Azure managed-identity and exchanged identity tokens are valid for up to 24 hours, Wiz says, so those have now expired. Long-lived secrets such as access tokens and package-registry keys do not expire on their own.
Why AI agent tools are a target
An agent framework is useful because it is trusted with access: model API keys, cloud identities, CI pipelines. The same access is what an attacker wants. This stealer’s list of targets reads like the inventory of a typical AI project, from OpenAI and Hugging Face tokens to Azure AI services.
It is also not the first Microsoft Python package hit this year. Wiz recalls that durabletask was compromised after its PyPI token was stolen, and says it has not linked the two incidents.
What to watch next
The key question is how ESRP credentials left Microsoft. If they came from a single compromised machine, the damage may be contained. If the publishing service itself was exposed, other packages it signs deserve a closer look.
SecurityWeek also noted that Microsoft’s Agent Framework repository and several others, including ONNX Runtime projects, were inaccessible on GitHub when it published. Whether that is linked is not established.
Original sources
- wiz.ioWiz — Microsoft agent-framework compromised: credential stealer targets Azure and CI pipelines (17 November 2026, updated 18 November 14:00 UTC)
- socket.devSocket — Microsoft’s agent-framework PyPI package compromised with credential stealer (17 November 2026)
- bleepingcomputer.comBleepingComputer — Microsoft’s Agent Framework PyPI package compromised to steal credentials (18 November 2026)
- securityweek.comSecurityWeek — Microsoft Agent Framework releases poisoned with credential stealer (18 November 2026)
- pypi.orgPyPI — agent-framework project page and release history (checked 19 November 2026)
- commons.wikimedia.orgWikimedia Commons — Microsoft sign at an entrance to the Redmond campus, photographed in April 2005 by Derrick Coetzee, released into the public domain
Sources checked 19 November 2026. Send a correction.
