Microsoft’s Agent Framework Package on PyPI Was Hijacked for 45 Minutes, and Builds From That Evening Still Need Checking
Two poisoned releases of Microsoft's agent-framework package carried a credential stealer aimed at Azure and CI secrets. PyPI has cleaned up, but Microsoft has not said how it happened. What to search for and what to rotate.

On Tuesday 17 November, someone published two poisoned versions of Microsoft’s official agent-framework package to PyPI, the public repository Python developers install software from. The versions, 1.26.1 and 1.26.2, contained a credential stealer, and they were live for roughly 45 minutes, between about 20:35 and 21:20 UTC, according to Aikido Security’s timings as reported by CSO. Five days on, the clean-up looks complete: PyPI’s release history for the package now lists 1.26.0, published on 12 November, as the newest version and shows neither bad release. What has not happened is an explanation. Microsoft has not said publicly how the attacker was able to publish under its name, and the researchers who have taken the code apart say the access route is still unconfirmed.
That gap matters more than the length of the window. Anything that installed an unpinned copy of the package during those 45 minutes needs to be treated as exposed, and the stealer was built to reach the kind of secrets that sit on a build server.
#What was published, and when
agent-framework is the PyPI package for Microsoft Agent Framework, Microsoft’s open-source toolkit for building software agents, meaning programs that send a request to an automated text service and then act on the reply. CSO, citing OX Security, puts the package at 192,534 downloads a month; the Cloud Security Alliance’s research note says reporting ranges from roughly 190,000 to 200,000 a month, with JFrog citing about 40,000 a week.
The timeline, as researchers have reconstructed it, runs like this. Version 1.26.1 appeared at 20:35 UTC. While OX Security was still studying it, 1.26.1 was reverted to the clean 1.26.0, and the attacker then uploaded 1.26.2, with the same payload moved to differently named files. That second upload came at 21:08 UTC. Both were gone by about 21:20 UTC. The Cloud Security Alliance says PyPI quarantined both within about 45 minutes. The fact that a second poisoned release followed the first clean-up is the most important detail in the story: removing a release did not remove the attacker’s ability to publish.
#Why a package nobody imported still ran
This is the part we would ask every engineering lead to understand, because it changes what “we never used that library” is worth. Python reads every .pth file in its site-packages folder when the interpreter starts, and a line in one that begins with import is run as code. The mechanism exists so packages can adjust where Python looks for modules. The malicious wheels added a tiny .pth file, so the stealer ran every time Python launched in that environment: when pip ran, when a test suite started, when an editor’s language server woke up. OX Security says the payload ran even if no code ever imported the framework.
The poisoned releases also kept a pin on the genuine 1.26.0 of the framework’s core, so applications went on working normally. Nothing broke, so nothing drew attention. The Cloud Security Alliance adds a trap for responders: according to JFrog, running pip uninstall in an affected environment starts the interpreter and so fires the hook one more time, which is why the note recommends tooling that does not execute .pth files during removal.
#What it went looking for
CSO, relaying OX Security, says the stealer collected environment variables with names containing words such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI. It read up to 60 credential files, including Azure CLI settings, Git and Docker credentials, npm and pip configuration, Hugging Face tokens, Azure DevOps build agent credentials and application .env files, and it pulled secrets from up to 300 other running processes. The stolen data was sent to a webhook.site address, a free service for receiving test web requests.
It also tried to mint new credentials. Inside Azure DevOps pipelines, OX Security says, it asked for an identity token that can be exchanged for Azure access, and it requested managed identity tokens for Azure services including Resource Manager, Microsoft Graph, Key Vault, Storage, Cognitive Services, AI Foundry and Azure DevOps. A managed identity is the credential Azure gives a workload so that it needs no stored password, which is exactly why code running inside a build job can ask for one. Endor Labs, quoted by CSO, said the payload was written mainly for automated build systems: developer laptops are in scope, but it is aimed at CI runners and Azure workloads.
Two cautions on the evidence. First, attempt is not outcome. The Cloud Security Alliance reports that StepSecurity has not confirmed any token was successfully issued, and that JFrog found the Azure DevOps token request was malformed and would have failed. Even so, JFrog notes that the pipeline’s access token would still have leaked through environment variables wherever it was passed into a build step. Second, the Cloud Security Alliance says JFrog found the webhook inbox returning rate-limit errors when checked, so some victims’ data may not have been captured. We would not take comfort from that. A thief who missed some of the haul did not return it.
#What nobody has explained yet
Microsoft’s only public comment we can find is the statement to The Register, which said the company had “made some repositories private while we investigate malicious content”. The Register reported that the agent-framework repository on GitHub, and Microsoft’s ONNX Runtime repository, were offline when it wrote, and noted that neither Microsoft nor the researchers had linked the ONNX repository to the malware. The Register also floated unauthorised access to an administrator account on Microsoft’s GitHub organisation as the likely cause. That is the outlet’s reading of the situation and nobody else has confirmed it.
The Cloud Security Alliance’s note is more careful, and we think more useful: it says none of the published reports explain how the attacker obtained publishing rights. It records that both bad releases were wheel-only, where 1.26.0 shipped a wheel and a source package, and that they carried no provenance attestation, the signed record that ties a release to the pipeline that built it. JFrog reads the wheel’s file metadata as showing a clean wheel repacked by a local script rather than built by Microsoft’s release pipeline. OX Security describes a hijacked wheel-building process. Those two readings do not obviously fit together, and the Cloud Security Alliance says the OX Security characterisation should be treated as unconfirmed until Microsoft or PyPI publishes a root-cause account. No researcher has linked the activity to a known group.
#Our reading: a short window, a long tail
We think the headline figure of 45 minutes understates the risk for one specific reason: automated dependency tools. JFrog, again via the Cloud Security Alliance, saw bots open upgrade pull requests within about six minutes of the first malicious upload. A team that merges those automatically, or builds container images from open-ended version ranges, could have taken the stealer in well inside the window, and the resulting image, cache or lockfile may still carry it today. Endor Labs made the same point, as CSO reports: container images, CI caches and lockfiles built in the window can still contain it.
The pattern is also worth saying plainly. CSO notes this is not the first official Microsoft Python package compromised this year: in May, Endor Labs detected three trojanized versions of durabletask, Microsoft’s SDK for Azure Durable Functions, though no researcher has linked the two attacks. The Cloud Security Alliance lists earlier credential-stealing attacks on developer and AI packages in March, April and June. Our view is that agent frameworks are now an attractive target for a simple reason: a team building an agent typically has model-provider keys, cloud identities and deployment credentials in one place. We would not conclude that Microsoft’s software is unusually weak. We would conclude that the publishing step, the moment a release goes to the public index, is now where these attacks land, and that few organisations watch it.
#What to check, in order
- Find out whether you were in the window. Search lockfiles,
pip freezeoutput, CI logs, Dependabot or Renovate pull requests and any internal package mirror foragent-framework1.26.1 or 1.26.2. In our reading, a build that suddenly cannot find one of those versions is itself a clue, since PyPI no longer lists them. - Look for the files. OX Security says to look for
agent_framework_meta.pthandagent_framework_meta/_telemetry.py; Aikido says version 1.26.2 usedaf_runtime_diag.pthandaf_runtime_diag.py. - If it ran anywhere, treat everything reachable from that host as compromised. OX Security recommends rotating Azure service principal secrets, personal access tokens, and GitHub, npm, PyPI, NuGet, Docker, Hugging Face and OpenAI tokens. The Cloud Security Alliance’s note advises rebuilding the machine or image from a clean base rather than cleaning it in place.
- Check the identity logs. OX Security advises reviewing Azure sign-in and activity logs for managed identities and federated credentials being used from affected build agents. Rotating a stored secret does nothing about a token that was already issued, so look at where tokens were used, not only at what you rotated. Our pages on wildcard federated credentials, renamed GitHub repositories inheriting Azure trust and managed identities at management-group scope explain how wide a stolen token’s reach can be.
- Change what you can control going forward. OX Security recommends pinning to a verified release with hash checking and blocking outbound traffic to webhook.site from build infrastructure. The Cloud Security Alliance notes that tooling which requires PyPI attestations would have rejected both uploads, since they carried none, but that mainstream pip does not check this by default.
#If you run a small business
Most small firms are not affected. This matters only if someone in or around your business writes Python code, or uses a tool built on Microsoft Agent Framework, and installed or updated it on Tuesday evening. If that sounds possible, ask your developer or IT provider one question in plain words: “Did anything we run install agent-framework version 1.26.1 or 1.26.2 on 17 November, and have you changed the passwords and keys that machine could reach?” If nobody writes software for you, you can stop here. If any of those keys could reach customer records, ask whoever handles your data protection whether the incident needs reporting.
#What we expect, and what would change our mind
We expect Microsoft to publish a root-cause account, because a package with this reach is unlikely to stay unexplained, and we expect it to involve a publishing credential rather than a flaw in the framework’s code. The Cloud Security Alliance’s evidence, that the bad releases were repacked outside the usual pipeline and carried no attestation, points the same way. We would change our mind if Microsoft shows the build pipeline itself was altered, which would make this a bigger story for everyone who consumes Microsoft packages, or if a victim comes forward with evidence that issued tokens were used. Until one of those appears, the sensible position is that the exposure is real for a small number of environments, unquantified, and entirely checkable.
Evidence trail
Sources and verification
Primary documentation and external technical references used in this article.
- 01The Register, Microsoft's official Python agent framework hijacked to distribute malware (18 November 2026)theregister.com
- 02CSO, Attackers hijack Microsoft's agent-framework package to steal Azure and CI credentialscsoonline.com
- 03Cloud Security Alliance AI Safety Initiative, Hijacked agent-framework on PyPI: Startup-Hook Credential Theft Hits Agent Builders (19 November 2026)labs.cloudsecurityalliance.org
- 04PyPI, agent-framework release history (read 22 November 2026)pypi.org
About this page
Credited to
Dates
Published
Corrections
No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.
More news
All newsWas this useful?
Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.
Get new fixes by email.
New runbooks, configuration traps and fixes from KBY Technologies, about twice a week.




Comments
Add a thoughtful note on Microsoft’s Agent Framework Package on PyPI Was Hijacked for 45 Minutes, and Builds From That Evening Still Need Checking. Comments are checked for spam and held for moderation before appearing.