Are agent-framework 1.26.1 and 1.26.2 malicious on PyPI?
On 17 November 2026, the attacker published two malicious releases of Microsoft's agent-framework package on PyPI. Version 1.26.1 went out at 20:35 UTC, and version 1.26.2 followed at 21:08 UTC. Each carried a credential stealer [1]. Both versions have since been removed from PyPI [2]. Wiz says that "As of 21:30 UTC, both versions were no longer available on PyPI." [3]
Wiz reports that the attacker appears to have compromised a client certificate and private key for Microsoft ESRP, the internal release service Microsoft uses to sign and publish this package. Wiz also says how the credentials were obtained is not yet known [3].
Which versions are affected?
Only 1.26.1 and 1.26.2 are affected. The advisory states that "Versions 1.26.1 and 1.26.2 add a credential stealer that is not present in the last clean release, 1.26.0." [1] It also says that "1.26.0 and earlier are not affected." [1]
If your environment pins agent-framework at 1.26.0 or older, the stealer was not in that build. Check the exact version you have, not the package name, because the name alone does not tell you which release was installed.
Does the stealer need an import to run?
No. The advisory explains that "Python runs .pth files at every interpreter start, so the code executes as soon as the package is installed" [1]. Wiz describes the same mechanism: when a malicious version is installed, it drops a .pth file into the site-packages directory [3]. According to the advisory, the helper then detaches into a background process and silences all errors [1], so a run can finish without any visible sign of the stealer.
In practice, any Python process started in that environment can run the stealer, including a script that never imports agent_framework. A CI job that only installs the package and runs a different tool is still exposed.
What did the stealer take?
According to Wiz's analysis, the stealer reads environment variables whose names contain terms such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS and GITHUB. It also reads credential files, including Azure CLI sessions, .npmrc, pip.conf, .netrc, .git-credentials and Docker configuration. Azure managed-identity tokens are requested from the instance metadata service [3]. Wiz says everything is packed into one JSON document, compressed and base64-encoded, and sent in a single HTTPS POST to webhook.site [3].
Version 1.26.2 goes further. Wiz says it adds theft of GitHub Actions OIDC tokens, so a workflow that installed 1.26.2 with id-token: write may have exposed cloud access as well [3]. Wiz also notes that stolen managed-identity and OIDC-exchanged tokens are valid for up to 24 hours [3]. That window is why rotating a password alone may not be enough.
How do I check whether I installed a bad version?
Work through each place the package could have been installed: developer laptops, virtual environments, container images, CI runners and build caches.
- From a trusted shell, outside the suspected environment, read the
Version:line in theagent_framework-*.dist-info/METADATAfile of each install. Do not run Python or pip inside a suspected environment, because startup runs the malicious.pthhook again [4]. - Search your lock files and requirements for the package:
grep -rn "agent-framework" requirements*.txt poetry.lock uv.lock Pipfile.lock. A lock file that pins 1.26.1 or 1.26.2 means any machine that resolved that file could have installed the bad release, so check when it was last resolved. - Check the install dates in your CI logs. A build that ran between 17 November 2026 at 20:35 UTC and the removal is the main concern.
- Look in
site-packagesfor a.pthfile you did not add yourself. Compare it with a known-good environment built from 1.26.0.
Removal from PyPI does not clean up copies you already have. Ostorlab warns that "A wheel that was already downloaded, or a layer built while the releases were live, still carries the code." [4] Check cached wheels and container layers as well.
Which credentials should I rotate?
The advisory is direct: "Anyone who installed 1.26.1 or 1.26.2 should treat the environment as exposed and rotate the credentials reachable from it, including CI and GitHub Actions secrets." [1]
Wiz's remediation list is a useful checklist for what to rotate [3]:
- Azure CLI sessions and any Azure DevOps personal access tokens or service connections.
- Package registry tokens for npm, PyPI, NuGet and Docker.
- Hugging Face tokens and git credentials.
- Every secret that was in the environment variables of the affected host or runner.
Rebuild the affected environments from a clean state, not from the same image or cache. Wiz advises reviewing the sign-in and activity logs for managed identities and federated credentials that were reachable from affected hosts [3].
What was the timeline?
Wiz publishes a timeline in UTC. The clean release came first, on 12 November 2026, and the malicious releases followed five days later [3]:
- 12 November 2026, 18:25: the legitimate 1.26.0 is published [3].
- 17 November 2026, 20:35: the malicious 1.26.1 is published [3].
- 17 November 2026, about 21:08: the malicious 1.26.2 is published [3].
- 17 November 2026, by 21:30: both malicious versions are no longer available on PyPI [3].
The short window matters for your logs. Any install between 20:35 and the removal is the main concern. An install before 20:35 on 17 November could only have got 1.26.0 or an older release, which the advisory does not list as affected [1].
Who is behind the attack?
Wiz says the tooling "identifies itself as Cairn, an open-source AI penetration-testing framework" [3]. Before publishing, the attacker ran the stealer on their own machine, according to Wiz [3]. The advisory does not link the activity to a known campaign: "We have not attributed this to a known campaign." [1]
Wiz describes a mistake that exposed part of the operation. The tooling "reported its own progress to the same publicly accessible webhook it used for exfiltration, which let Wiz Research observe part of the operation." [3] Wiz says it "promptly reported these findings to Microsoft on the 17th." [3]
How do I keep future installs safer?
Pinning helps only when the pinned version is one you have checked. Keep a lock file that records exact versions. Where your tooling supports it, install from a hashed requirements file, for example with pip install --require-hashes, so a changed artifact fails the install instead of slipping in.
Limit what CI jobs can reach. Wiz ties the 1.26.2 OIDC theft to workflows that installed that release with id-token: write [3], so grant that permission only to the jobs that need cloud access. Review a new release before you upgrade, especially for a package that runs code when it is installed.
Agent frameworks pull in many dependencies, so one compromised release reaches every project that installs it without a version check. Treat an automatic upgrade of an AI tool like any other change to production code.
Has Microsoft said how many installs were hit?
No. Ostorlab says: "Neither Microsoft nor PyPI has published how many environments installed either release." [4] The pypistats figure is a different number. Ostorlab reports 39,963 downloads of the project name in the week to 18 November 2026, and it notes that these figures "cover the project name, not the two malicious versions" [4]. Wiz gives a separate estimate of about 41,000 downloads a week [3]. Neither number is an install count for the bad releases, so treat them as context, not as a victim count.
At the time of writing, this article found no Microsoft security advisory for the incident. Wiz also says that an earlier Microsoft package, durabletask, was compromised after its PyPI token was stolen, and that "We have not linked the two incidents." [3] Do not assume the two are connected.
What if I cannot rebuild today?
Pin the package to the last clean release until you can rebuild. In your requirements file, use agent-framework==1.26.0 so neither bad release can install again, without changing your code. The same pin works through a constraints file with pip install -c constraints.txt. Remove the pin once you have reviewed the next release.
An exclusion does not clean an environment that already has a bad version. Treat it as a stopgap. Keep any exposed environment away from production secrets until rotation is finished, and write down which secrets you rotated and when, so your audit trail matches what changed.
What should I do this week?
- Find every environment where
agent-frameworkwas installed, and check the exact version. - If 1.26.1 or 1.26.2 ran anywhere, treat that environment as exposed and rotate the credentials it could reach.
- Rebuild those environments and pin the package to 1.26.0 or a later release that the maintainers publish after review.
- Re-check the logs for unusual sign-ins or token use after 17 November 2026, and keep the notes so you can answer questions from your security team.
If you ship software that includes this package, tell your customers which versions you checked and when. They cannot judge their own exposure without that information, and a plain statement is more useful than a general assurance.



