Microsoft’s Agent Framework Package Was Poisoned on PyPI: How to Check Your Builds and Rotate Credentials
Two booby-trapped versions of a Microsoft software package were published to a public code library on 17 November 2026, and any computer that installed them may have handed over passwords and access tokens. Most readers never touch this software directly, but the apps they use are built with it.
In this article, we will explore what happened, how the attack worked, how to check your builds, which credentials to replace first, and what is still unknown.
The Two Bad Releases and the Timeline
On 17 November 2026, attackers published two malicious versions of Microsoft’s Agent Framework package for Python, a toolkit developers use to build software agents that carry out tasks with AI models. The package is named agent-framework and lives on PyPI, the Python Package Index, which is the main public library where Python developers download ready-made code. The bad versions were numbered 1.26.1 and 1.26.2. According to BleepingComputer, the package sees roughly 200,000 downloads a month, and CSO Online cites a more exact figure of 192,534 monthly downloads from researchers at OX Security.
Security people call this a software supply chain attack. Instead of breaking into a company directly, the attacker poisons something the company trusts and installs automatically, such as a library, a build tool, or an update. The victim does the work of letting the attacker in. That is general background, not a claim from the reporting, but it explains why the incident matters even though the poisoned files were online for a short time.
The Clock on 17 November
CSO Online gives a specific timeline in Coordinated Universal Time, the standard clock that engineers use to compare events across time zones. The first malicious upload appeared at 20:35 UTC and the second at 21:08 UTC. Both were gone by about 21:20 UTC. For US readers, 20:35 UTC was 3:35 p.m. Eastern time that day, which is a simple conversion from the standard offset.
The table below shows the sequence as CSO Online reported it, followed by the subtraction we did ourselves. Treat the last two rows as a simple illustration of the gaps, not as extra reporting.
| Event | Time (UTC) | Gap from previous event |
| Version 1.26.1 uploaded | 20:35 | Starting point |
| Version 1.26.2 uploaded | 21:08 | 33 minutes (21:08 minus 20:35) |
| Both versions gone | About 21:20 | About 12 minutes after the second upload |
| First upload to removal | About 45 minutes in total | 20:35 to about 21:20 |
On that reading, both versions were live for less than an hour. That sounds reassuring, yet automated systems that rebuild software every few minutes can pull a fresh copy of a package within seconds, so a short window is not the same as a harmless one.
Where the Two Accounts Differ
BleepingComputer describes the timing differently. It says PyPI quarantined the first version about two and a half minutes before the second one appeared, and quarantined the second about eight minutes after that. It does not say how long either version was publicly available. The two descriptions have not been reconciled in anything we reviewed, and we are not going to pretend they agree. Quarantining, in PyPI’s vocabulary, means a package is flagged and hidden from normal installs, which may not be the same moment as deleting it.
The practical takeaway is that nobody outside the investigation can draw a precise line around the danger window. If your systems installed or updated this package at any point on 17 November, treat that as in scope rather than trying to shave minutes off the window.
How the Malware Ran Without Being Imported
The most unsettling detail in the reports is that the malicious code ran whenever Python started, even if a program never loaded the framework. Normally, a developer has to write an import line before a library does anything. Here, simply having the package installed in an environment was enough for the code to wake up the next time any Python program began running in that environment.
The Startup File Trick
Version 1.26.1 used a file with the extension .pth to launch the stealer. As general knowledge about Python, files of that type sit in the folder where Python keeps installed packages, and Python reads them at startup to learn about extra folders to include. Certain lines inside them are treated as code and executed. It is a legitimate feature meant for packaging convenience, which is why attackers favor it. Details of this mechanism can change between Python versions, so check the official Python documentation if you need specifics.
CSO Online lists the file names it saw. In version 1.26.1 they were agent_framework_meta.pth and a script called agent_framework_meta/_telemetry.py. Version 1.26.2 moved the code to different names, af_runtime_diag.pth and af_runtime_diag.py. The changed names matter for anyone searching a disk or an image, because a search for only one set of names would miss the other version.
Why the Framework Still Appeared to Work
Both malicious versions depended on the legitimate agent-framework-core release 1.26.0. That means the real framework code was still installed underneath, so applications kept running normally. A broken app prompts a developer to investigate. A working app does not. This design choice, reported by both outlets, is a big reason why a short exposure can still lead to a long cleanup.
Wheels Without Source
Endor Labs noted that both malicious versions were uploaded only as wheel files, without the matching source package. A wheel is a prebuilt package format that installs quickly because nothing has to be compiled. Normal releases of a project usually include both the wheel and the source archive. A release with a wheel alone is a small clue that something unusual happened in the publishing process, though it is not proof of how.
What the Stealer Went After
The code was a credential stealer, a program designed to find secrets and send them to the attacker. The sources we reviewed describe a wide net. Knowing the list helps you decide what to rotate, because anything on the list that existed on an affected machine should be treated as exposed.
Environment Variables
The malware looked for environment variables, which are named settings that programs read from the surrounding system. Developers and automated pipelines often keep passwords and tokens there so they do not have to be written into code. According to CSO Online, the stealer searched for variable names containing terms such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, and OPENAI. A variable called anything similar to those words was fair game.
Files and Other Processes
The reports say the malware collected up to 60 credential files. These included Azure command-line settings, Git and Docker credentials, npm and pip configuration, Hugging Face tokens, Azure DevOps build agent credentials, and .env files, which are plain text files that developers use to store settings for a project. It also reached for secrets held by up to 300 other running processes on the same machine, and for Azure DevOps pipeline identity tokens and managed identity tokens, per CSO Online.
Identity tokens are short-lived proofs that a machine or pipeline is who it says it is, so it can reach cloud resources without a password. BleepingComputer reports that version 1.26.2 added GitHub Actions identity tokens to the list. GitHub Actions is GitHub’s built-in automation service that builds and tests code.
Where the Data Went
According to the reporting, stolen data was packed as compressed, encoded JSON and sent to a webhook.site address. Webhook.site is a public service that gives anyone a temporary web address for receiving data, so it is useful to defenders and attackers alike. This matters because a build server rarely has a good reason to contact it, which makes it a reasonable thing to block.
Who Was Most at Risk
Endor Labs, quoted by CSO Online, said the payload was aimed mainly at continuous integration runners and Azure workloads, although developer laptops were also in scope. A runner is a machine or container that builds and tests code automatically whenever a developer saves changes. These systems are attractive because they hold powerful credentials and few people watch them.
Checking Your Builds Step by Step
This section is general information, not individualized advice. If your team uses Python and the Microsoft Agent Framework, the sources agree on a broad list of checks. The sequence below turns that list into an order of work. Hobbyists and small teams can follow the same steps at a smaller scale.
Step 1. Find out whether you use the package at all. Search your code repositories, requirements files, and lockfiles for the name agent-framework. A lockfile is a record of the exact versions a project installed, so it is the best evidence of what your builds pulled. If the name appears nowhere, you are very likely unaffected, though you should still check the next steps for shared build images.
Step 2. Look for the two bad version numbers. Search for 1.26.1 and 1.26.2 next to the package name in every environment, including developer machines, test servers, production servers, and automated build runners. The sources recommend checking all environments, CI images, and lockfiles, not just the one you think is in use.
Step 3. Search for the file names. On any machine that ran Python with the package installed, look for the names CSO Online listed: agent_framework_meta.pth, agent_framework_meta/_telemetry.py, af_runtime_diag.pth and af_runtime_diag.py. Finding one of them is strong evidence that the malicious version was installed there.
Step 4. Remove the bad versions and return to 1.26.0. Both outlets say the clean fallback is the 1.26.0 release. Uninstalling alone may not be enough if a container image or cache still holds the poisoned files, so rebuild from a clean base rather than patching the old one.
Step 5. Check container images and caches built during the window. A Docker image built between roughly 20:35 and 21:20 UTC on 17 November could contain the package, and so could any shared package cache. Because the timing accounts differ, widen the window rather than narrowing it.
Step 6. Record what you found. Write down which machines, images, and pipelines were exposed. That list drives the next section, because it tells you which secrets to replace.
A Quick Decision Table
The table below is our own organizing tool, built from the recommended actions. Use it to decide how urgent your situation is.
| What you found | Urgency | What to do |
| Bad version installed on a machine that also held secrets | Highest | Remove it, then rotate every secret reachable from that machine |
| Bad version only in an old cache or image | High | Delete or rebuild, then check whether any build used it |
| Package present at version 1.26.0 | Low | No action beyond pinning, since this is the clean release |
| Package never used | Very low | Nothing, but consider blocking webhook.site from build servers |
What Small Teams and Solo Developers Should Do
A solo developer or a three-person startup does not need an enterprise toolkit to respond. Open each project folder, read the requirements file, and run the package listing command in each virtual environment you created. A virtual environment is a private folder of installed packages for one project, and people often forget how many they have. Delete any you no longer need, because an old forgotten environment is exactly the kind of place a bad version can linger.
Then sit down with the password manager or settings pages for the services you use for code, such as your repository host, your package registry accounts and your cloud console. Creating new tokens takes a few minutes each, and the cost of doing it needlessly is small compared with the cost of leaving a stolen token alive. This is general information, not advice tailored to your situation.
Rotating Credentials in a Sensible Order
Rotating a credential means replacing it with a new one and making the old one stop working. Both sources say to treat every secret reachable from a host where the malicious code ran as compromised. Reachable is the key word. If a secret lived in an environment variable, a configuration file, or even another running program on that machine, assume the stealer could have seen it.
Start with the Credentials That Open Cloud Doors
The sources name these items for rotation: Azure service principal secrets, personal access tokens, and tokens for GitHub, npm, PyPI, NuGet, Docker, Hugging Face and OpenAI. A service principal is an identity that a program uses to sign in to Azure instead of a human. A personal access token is a long password-like string that lets a tool act as you on a service.
A reasonable order, based on general security practice, is to begin with anything that can publish software or change cloud infrastructure, since those can spread a problem. That means package registry tokens, repository tokens and cloud secrets come before lower-risk items like a read-only key. This ordering is general knowledge and reflects common practice, not something the reporting prescribes.
Rotate in the Right Order Within Each Account
The safe pattern is to create the new credential, update the systems that need it, confirm those systems work, and only then revoke the old one. Reversing that order can cause an outage. Revoking first can feel faster, though, and when you know a secret was stolen, speed may matter more than comfort. Weigh that tradeoff based on how sensitive the account is.
The table below shows an illustration of how a team might sort its list. It is a planning aid we built, not a ranking from the sources.
| Credential type | Why it can be risky | Suggested handling |
| Package registry tokens (PyPI, npm, NuGet) | Could let an attacker publish poisoned releases | Rotate first, then review recent publishes |
| GitHub and Azure DevOps tokens | Could expose or alter source code and pipelines | Rotate, then review audit logs |
| Azure service principal secrets | Could open cloud resources | Rotate, then review Azure sign-in logs |
| Docker and Hugging Face tokens | Could expose private images and models | Rotate and check access history |
| OpenAI keys | Could run up charges and expose usage | Rotate and watch billing |
Review the Logs
Both sources recommend reviewing Azure sign-in logs. A sign-in log is the record a cloud service keeps of who or what logged in, from where and when. Look for sign-ins from unfamiliar places, unusual times, or service identities acting in ways they normally do not. An absence of strange activity is encouraging, but it does not prove nothing happened, so rotation should not wait for the logs.
Hardening Your Pipeline Against the Next One
The sources recommend a few lasting changes beyond cleanup. They apply to any dependency, not just this package, and they are worth doing even if you were never affected.
Pin Versions and Check Hashes
Pinning means telling your build to use one exact version instead of whatever is newest. The sources recommend pinning to a verified release with hash checking. A hash is a fingerprint calculated from a file’s contents. If you record the expected fingerprint and your tools refuse any file that does not match, a swapped or tampered package fails to install. As general knowledge, pip supports this through a requirements file with hashes, but check the official pip documentation for current syntax.
Pinning has a cost. You stop receiving updates automatically, so someone must review and approve new versions. For most teams, that tradeoff is worth it, because an update you chose is safer than an update that arrives uninvited.
Block Traffic Your Builds Do Not Need
Both outlets recommended blocking outbound traffic to webhook.site from build infrastructure. More broadly, build servers can be limited to a short list of approved destinations. This is called an egress rule, and it can stop a stealer even after it runs, because it has nowhere to send what it collects. It is not a complete defense, since attackers can pick another destination, but it raises the effort required.
Keep Secrets out of Reach
Short-lived credentials, such as the identity tokens mentioned earlier, limit the damage because they expire. Storing long-lived secrets in environment variables on a shared runner is convenient and also risky, as this incident shows. Where possible, give each pipeline only the permissions it needs and nothing more. That general principle is called least privilege.
Plan for the Next Incident Before It Happens
Incidents like this one tend to reveal how much a team did not know about its own systems. Few organizations can answer, within an hour, which of their machines installed a given package on a given day. Keeping a current inventory of dependencies, which security teams sometimes call a software bill of materials, turns a frantic search into a quick lookup. This is general practice and not something the reporting requires.
It also helps to write down in advance who owns each credential and how to replace it. When a notice arrives on a busy afternoon, a short written checklist beats improvisation. Run a practice rotation once, so the first time you try it is not during an emergency.
Final Thoughts: Open Questions and Claims to Treat Carefully
An honest account of this incident has to include a long list of things nobody has said publicly yet. We reviewed two outlets, BleepingComputer and CSO Online, which in turn describe work by researchers at Socket, StepSecurity, OX Security and Endor Labs.
How the Attackers Got In
How the attackers obtained the ability to publish under Microsoft’s package name is unknown.
Microsoft has not explained it and did not respond to requests for comment, according to the reporting. OX Security believes the attackers hijacked the process that builds the wheel files. Endor Labs observed that the malicious versions were uploaded as wheels only, without the source package. Those two observations are consistent with each other, but neither is a confirmed cause. Anyone who tells you exactly how it happened is guessing.
How Many Were Affected
Nobody has reported how many installs pulled the bad versions, and nobody has reported whether stolen credentials were used. The monthly download figures describe normal traffic, not the number of victims. The two outlets give slightly different download figures, roughly 200,000 and 192,534, and that is a difference in rounding and attribution, not a conflict about the facts of the attack.
Any Link to an Earlier Incident
In May 2026, there was a compromise of a different Microsoft software kit called durabletask. No researcher has linked it to this one, so we are not suggesting a connection. We mention it only because readers may see the two discussed together and wonder.
What We Could Not Find
We did not find an official Microsoft statement, a count of victims, or the exact release that fixes the problem. The recommended fallback is the clean 1.26.0 release, and the sources do not name a later safe version. If you need to move forward, wait for an official announcement from Microsoft and check the package’s page on PyPI.
What You Can Safely Ignore
Alarmist claims that all of PyPI is unsafe are not supported by what we read. This was one package, two versions and a short window. Rumors about specific victims are also unsupported. The sensible response is a measured check of your own systems, not panic.
How to Read Early Reports
Early security coverage is built from fast-moving research notes, and details get revised. The two outlets we reviewed agree on the core story, which is that two malicious versions appeared, ran at startup and went after credentials. They differ on small points, such as the timing description and which identity tokens were added in the second version.
When you see a new claim, ask who made it, whether a second source repeats it, and whether it changes what you should do. Most of the time, the answer to the last question is no, and the checklist above still stands.
Frequently Asked Questions
How Do I Know if My Computer Installed the Bad Agent Framework Version?
Run a command that lists installed Python packages in each environment you use and look for agent-framework with version 1.26.1 or 1.26.2. You can also search for the four file names that CSO Online listed. If the package is absent or shows 1.26.0, the malicious versions were not installed in that environment.
Do I Need to Worry if I Never Use Python?
Probably not directly. This incident affects people who install Python packages, mainly developers and automated build systems. If you use a service whose developers were affected, the company would normally need to notify you, so watch for official messages and be wary of unexpected emails asking you to click or sign in.
Is It Enough to Uninstall the Package?
No. Removing the package stops future runs of the malicious code, but any secrets already sent out remain exposed. The sources say to treat every secret reachable from an affected host as compromised and rotate it. Also check container images and caches that may still hold the files.
Why Would a Malicious Package Keep the Real Framework Working?
Because it hides the attack. Both versions depended on the legitimate agent-framework-core 1.26.0 release, so applications kept running normally and nothing looked broken. A developer who sees no errors has little reason to investigate.
Can Pinning Versions and Hash Checking Prevent This Kind of Attack?
It can help a great deal, though it is not a cure. If you pin to a verified release and require matching hashes, a newly published bad version will not install by accident. It does not protect you if you pin to a version that was already poisoned, which is why the sources also stress checking and verifying releases.
