On 17 November 2026, two malicious versions of Microsoft Agent Framework appeared on PyPI carrying a credential stealer. Versions 1.26.1 and 1.26.2 were live for about 41 minutes before PyPI quarantined and removed them, but in that short window automated dependency tools were already opening upgrade pull requests, and anyone who installed either version must now treat every reachable credential as compromised. The last clean release is 1.26.0, published on 12 November.

Key takeaways

  • Versions 1.26.1 and 1.26.2 of agent-framework were published without authorisation on 17 November 2026 and removed the same evening. Version 1.26.0 is clean.
  • A Python .pth startup hook ran the stealer every time Python started, even if the framework was never imported.
  • The stealer harvested environment variables, credential files and fresh Azure, Azure DevOps and GitHub Actions tokens, sending them to a webhook.site address.
  • Wiz analysis points to a compromised Microsoft ESRP signing certificate and private key. Microsoft has not confirmed that finding and has published no advisory.
  • The attacker’s dropbox was rate-limited: only 50 requests were captured, and Wiz traced three successful victim exfiltrations, a floor rather than the full extent.

What happened in 41 minutes

This was not a typosquat. The malicious wheels were published under Microsoft’s own agent-framework project on PyPI, so checking the package name, the publisher or the project page would not have helped anyone whose install resolved to 1.26.1 or 1.26.2. The Python Packaging Authority’s advisory, PYSEC-2026-4388, says both versions were uploaded without authorisation, repackaged from the legitimate 1.26.0 wheel, and both have been removed after PyPI Security worked with Microsoft to review the project’s accounts.

Time (UTC, 17 November 2026) Event
12 November, 18:25 Legitimate version 1.26.0 published
20:26 Attacker repacks the 1.26.0 wheel locally, according to ZIP header evidence
20:35 Malicious version 1.26.1 published on PyPI
21:06 PyPI quarantines 1.26.1, 31 minutes after publication
21:08 Malicious version 1.26.2 published, two minutes after the quarantine
21:16 Both versions removed from PyPI

The second upload is the detail that matters most. Quarantining one version did not revoke the attacker’s publishing access, so 1.26.2 followed within two minutes. JFrog reports that automated dependency tools such as Renovate were already opening upgrade pull requests in downstream repositories within six minutes of 1.26.1 landing. The package is widely used: Wiz and JFrog put it at about 41,000 downloads a week, while BleepingComputer reports roughly 200,000 downloads a month.

Microsoft itself has been treating AI agents as potential insider threats, building continuous risk scoring and permission controls for them, as we covered in our report on Microsoft AI agent security controls. OpenAI, meanwhile, has started selling security products on both sides of the breach, as we reported in GPT-6 Cyber and Daybreak.

How the credential stealer worked

The attack’s cleverness is in its trigger. Python runs .pth files found in site-packages every time the interpreter starts, executing any line that begins with import before user code runs. Version 1.26.1 dropped a 28-byte file, agent_framework_meta.pth, containing a single line: import agent_framework_meta. Installing the wheel did not execute code by itself, but the next python, pytest, pip or IDE language-server launch in that environment did, whether or not any code imported the framework.

The hiding place was chosen with care. agent-framework is a thin meta-package: the real code lives in agent-framework-core, and applications import agent_framework, never the small agent_framework_meta stub. The attacker left the dependency pin on agent-framework-core[all]==1.26.0 untouched, so the framework kept working normally while the stealer ran in the background. The payload was disguised as legitimate telemetry, named _telemetry and described as a “Lightweight runtime diagnostics hook”. On Linux and macOS it forked into a detached session and set _AF_TEL=1 so child processes would not trigger it again; on Windows it started a daemon thread instead.

Version 1.26.2 adapted after the first quarantine. It restored the clean agent_framework_meta/__init__.py and moved the hook to af_runtime_diag.pth and af_runtime_diag.py, so searching only for the 1.26.1 file names would miss it. It also added GitHub Actions token theft, widened the environment-variable matching and raised the file cap from 60 to 80.

What the stealer collected

The stealer was focused on Azure and CI pipelines, but its net was wide. It swept environment variables for names containing strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI, and read the environments of up to 300 other running processes through /proc/*/environ on Linux. It read credential files including Azure CLI token caches, .npmrc, pip.conf, .netrc, .git-credentials, Docker configuration, Hugging Face tokens, Azure DevOps agent .credentials stores, and .env and JSON files under /app and /workspace.

More seriously, it requested fresh tokens rather than only stealing stored ones. It asked Azure DevOps for OIDC tokens and requested Azure managed-identity tokens from the instance metadata service or the App Service identity endpoint, across 12 resources including Key Vault, Storage, Microsoft Graph and Azure Resource Manager. Version 1.26.2 added GitHub Actions OIDC tokens; where an Entra ID federated credential trusts the workflow, those tokens can be exchanged for Azure access with no stored secret needed.

Everything was packed into one JSON document, compressed, base64-encoded and sent in a single HTTPS POST to a webhook.site address, with no fallback channel and no encryption beyond the transport layer; failures were silently ignored. One flaw did not materialise in the attacker’s favour: the Azure DevOps OIDC request in 1.26.1 was broken, missing a required parameter, so real endpoints rejected it. The SYSTEM_ACCESSTOKEN value itself still leaked through the environment, so the failure limited only one token path.

The root cause points to a stolen signing certificate

The most consequential finding came in Wiz’s update of 18 November, and it must be labelled for what it is: Wiz’s analysis, not a Microsoft statement. According to Wiz, the attacker appears to have compromised a client certificate and private key for Microsoft ESRP, the Engineering System Release Pipeline used to sign and publish this package. The attacker’s tooling reported its own progress to the same public webhook it used for exfiltration, which let Wiz observe part of the operation. A first publish attempt from AWS was rejected by ESRP’s IP filtering; a second attempt from Microsoft-owned IP space succeeded. How the certificate and key were obtained is not yet known.

That framing matters. If Wiz is right, this was not a stolen PyPI password or a compromised maintainer account, but a compromise of the signing infrastructure itself, which is why the attacker could publish under Microsoft’s own project and keep publishing after a quarantine. Microsoft has not confirmed the finding. The company has published no advisory and no dedicated blog post, and its only public comment, given to a spokesperson’s statement to The Register on 18 November, was: “We have made some repositories private while we investigate malicious content.” As of 20 November, the GitHub repositories microsoft/agent-framework, microsoft/onnxruntime and microsoft/onnxruntime-genai still returned 404, according to Corgea. No link has been established between the ONNX Runtime repositories going private and this attack, and it should not be assumed.

The attacker’s tooling identifies itself as Cairn, an open-source AI penetration-testing framework, which says something about the tools used, not about who used them. JFrog’s analysis of the wheel’s ZIP headers shows it was repacked locally at 20:26:19 UTC on 17 November, under Unix user ID 1000 on a host with a UTC+8 clock, rather than built through Microsoft’s release pipeline. JFrog has not attributed the attack to a known threat group. Earlier in 2026, another Microsoft Python package, durabletask, was compromised after its PyPI token was stolen; Wiz says the two incidents have not been linked.

Why the damage stayed limited

The attacker’s choice of exfiltration channel blunted the attack. Webhook.site is a public request-inspection service, and on its free tier an unattached URL accepts at most 100 requests before new ones are rejected, and expires after seven days. Wiz confirmed the attacker’s token was on the free tier and that a maximum of 50 requests were captured: four from the attacker’s own machines, 29 linked to sandbox environments, vendor scanning and tests, and the remaining 17 representing only three unique, successful cases of victim exfiltration.

That number must not be read as the full extent of the theft. Requests beyond the free-tier cap were rejected with HTTP 410 or 429 and never logged, so the true number of victims is unknown. But the cap clearly limited the damage: a stealer that runs on every Python start would otherwise have exfiltrated far more. The attacker also made several operational mistakes, according to JFrog: the broken Azure DevOps OIDC request, a 104-second delay on non-Azure Linux hosts while the stealer waited on unreachable metadata endpoints, and Linux-centric file paths that miss macOS credential locations. There was no second-stage loader, no persistence outside site-packages and no worm propagation. Even so, three confirmed victim exfiltrations, each potentially carrying working cloud, CI and registry credentials, is a serious outcome from 41 minutes of exposure.

What to do if you installed 1.26.1 or 1.26.2

Anyone whose environment installed either version should treat every secret reachable from it as compromised. The order of operations matters. Do not run a bare pip uninstall first, because pip is itself a Python process and launching it runs the hook once more. Export _AF_TEL=1 first to block the stealer, then delete the hook files, then uninstall and reinstall the clean release. The uv package manager is safe to use directly for removal, because it is a compiled binary that does not execute .pth hooks.

  1. Search lockfiles, CI logs, virtual environments and container images for agent-framework 1.26.1 or 1.26.2, and pin agent-framework==1.26.0 exactly.
  2. Check site-packages for agent_framework_meta.pth and agent_framework_meta/_telemetry.py (1.26.1) or af_runtime_diag.pth and af_runtime_diag.py (1.26.2). Any Python process started in that environment ran the payload.
  3. Rotate every credential that was in the environment: cloud keys, LLM API keys, package registry tokens, GitHub secrets, Azure CLI sessions, Azure DevOps personal access tokens and service connections, and self-hosted runner credentials.
  4. Treat managed-identity and OIDC tokens as exposed. They cannot be rotated and stay valid for up to 24 hours, so recycle affected compute, review Entra ID sign-in logs for the targeted services and narrow role assignments where you detect unauthorised use.
  5. Check proxy and DNS logs for the webhook.site address: a 200 response means that host’s data was accepted, while 410 or 429 means it was rejected. Search internal package mirrors and artifact caches for the malicious wheel hashes below, and audit lockfiles, Renovate and Dependabot pull requests from 17 November and Docker images built in the window.
Malicious file SHA-256
agent_framework-1.26.1-py3-none-any.whl d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110
agent_framework-1.26.2-py3-none-any.whl 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9

Version 1.26.0 is the safe state: PyPI Security says it is not affected, and it is the latest release listed on PyPI. No newer fixed version exists yet. The UK National Cyber Security Centre has warned separately that AI is accelerating ransomware and attacks on critical infrastructure, as we reported in the NCSC AI ransomware warning.

What is still unknown

Several questions remain open, and none should be filled in by speculation. How the ESRP certificate and private key were obtained, which account was used and who uploaded the packages are all unestablished. No CVE has been assigned; the incident is tracked as PyPA advisory PYSEC-2026-4388, GitHub advisory GHSA-764m-3ppc-5m73 and OSV entry MAL-2026-20101. Microsoft has not published an advisory, has not confirmed the ESRP root cause and has not said when, or whether, a new release will replace 1.26.0. The three confirmed victim exfiltrations are the only cases Wiz could see; the free-tier cap means the true count is unknowable from the dropbox alone. What is established is the mechanism, the timeline and the fix, and for anyone who installed 1.26.1 or 1.26.2, the safe course is to assume compromise and rotate.

Frequently asked questions

Am I affected if I installed agent-framework recently?

Only if you installed version 1.26.1 or 1.26.2 during the exposure window on 17 November 2026, between about 20:35 and 21:16 UTC. Version 1.26.0 and earlier releases are clean. Check your lockfiles and installed packages for the hook files named in the cleanup steps above.

Does uninstalling the package remove the stealer?

Not safely on its own. Running pip launches Python, which executes the .pth hook once more before uninstalling. Export _AF_TEL=1 first to block the stealer, delete the hook files, then uninstall and reinstall agent-framework==1.26.0.

Is version 1.26.0 safe to use?

Yes. PyPI Security says 1.26.0 is not affected, and it is the latest release listed on PyPI. Pin it exactly rather than taking the latest version, until Microsoft publishes a newer release.

Why did the attack not steal more credentials?

The attacker exfiltrated data to a free-tier webhook.site address, which accepts at most 100 requests. Only 50 were captured, and Wiz traced three successful victim exfiltrations among them. Requests beyond the cap were rejected and never logged, so the true number of victims is unknown.

Has Microsoft explained what happened?

No. Microsoft has published no advisory and has not confirmed the root cause. Its only public comment, given to The Register on 18 November, was that it had made some repositories private while it investigates malicious content. The signing certificate finding comes from Wiz’s analysis.

Sources and Further Reading