Short answer: on the evening of 17 November 2026, two unauthorised releases of agent-framework, the Python package for Microsoft Agent Framework, were published to PyPI. Versions 1.26.1 and 1.26.2 carried a credential stealer that ran every time Python started on an affected machine, whether or not anyone imported the package. It went after Azure, Azure DevOps and GitHub Actions tokens, cloud and developer credential files, and the environment variables of running processes. The releases were removed within the hour. The lesson lasts much longer: the frameworks we use to build AI agents now sit right next to our cloud keys, and attackers know it.
This article sets out what was reported, why organisations building AI in their own environment should care, and the nine checks I would run this week.
What happened
According to the GitHub advisory GHSA-764m-3ppc-5m73, published on 18 November 2026, version 1.26.1 was published at 20:35 UTC on 17 November as a wheel only, and 1.26.2 followed at 21:08 UTC. The Python Packaging Authority's advisory PYSEC-2026-4388 says both were uploaded to PyPI "without authorization" and have been removed. The last clean release is 1.26.0, published on 12 November. The key points from the public research:
- It ran without being imported. Each malicious wheel added a
.pthstartup file. Python's own documentation explains that lines in.pthfiles that start withimportare executed when the interpreter starts. So any Python process in that environment, a test run, a notebook or an unrelated script, triggered the stealer. - It targeted cloud and build identities. The advisory lists environment variables with names containing TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB, HF_ and OPENAI, the environments of other running processes, credential files for Azure, npm, git, Docker and Hugging Face,
.envfiles, Azure DevOps OIDC tokens and Azure managed identity tokens from the instance metadata service. Version 1.26.2 added GitHub Actions OIDC tokens. - It minted fresh tokens, not just old ones. Elastic Security Labs notes that the stealer called the Azure DevOps and GitHub Actions OIDC endpoints and the Azure Instance Metadata Service to mint new cloud tokens, which is how a compromised build can reach the Azure subscription behind it.
- It was popular and fast. Elastic says the package averages 196,000 downloads a month and that its monitor flagged 1.26.1 six minutes after it was published. StepSecurity reports that 1.26.1 was quarantined at 21:06 UTC and that 1.26.2 was uploaded just over two minutes later, which shows the attacker still had publishing access after the first quarantine.
- The publishing route was trusted. The Register, citing OX Security, reported that 1.26.2 was uploaded through Microsoft's official PyPI publisher account. Microsoft told The Register it had "made some repositories private while we investigate malicious content". How the publishing access was obtained has not been publicly confirmed by Microsoft.
If either version was installed on a laptop, build agent or server, the advisory says to treat the environment as exposed and rotate the credentials reachable from it, and Elastic recommends pinning back to 1.26.0.
My view: AI builders are now a supply chain target in their own right
This was not an isolated event. A day earlier, StepSecurity described malicious releases of the WPPConnect npm packages that copied environment variables, .env files and WhatsApp session tokens. And on 23 November 2026, Databricks published an analysis of about 5,400 malicious npm packages released between December 2025 and October 2026. Three of its findings matter for anyone building with AI:
- Compromised legitimate packages were only 7% of the malicious set but accounted for over 99% of downloads. The risk is not mainly typo-squats; it is trusted packages turning bad.
- Only 54% declared an install script. The rest ran on import or when invoked, so blocking install scripts addresses roughly half of what was seen. The agent-framework
.pthhook is a Python example of the same problem. - Databricks identifies a distinct class of activity aimed at AI development tooling: malicious MCP server packages that harvest credentials from the agent host, packages that change AI assistant configuration and instruction files, and stealers built for AI service keys.
Here is why I think this matters most for organisations adopting AI in their own environment. More teams are choosing to build agents in their own cloud accounts, on their own build agents and servers, so that they keep control of their data. That is the right instinct, and it is where secure sovereign AI adoption is heading. But an agent framework is unusual. It is installed on exactly the machines that hold the most powerful identities: developer laptops with cached cloud logins, CI runners that can deploy, and servers with a managed identity attached. A poisoned AI dependency does not need a clever exploit. It just needs to run once in the right place.
So the question to ask is not "do we use agent-framework?" It is "if any package in our AI stack turned malicious tonight, what could it reach?"
Nine checks I would run this week
1. Find out whether the bad versions ever ran
Search lockfiles, requirements files, container images and CI logs for agent-framework 1.26.1 or 1.26.2, and look for the startup files the malicious wheels dropped. Because the releases were live for only a short window, check build and install logs from the evening of 17 November specifically.
# Read-only: which version is installed in this environment?
pip show agent-framework 2>/dev/null | grep -i "^version"
# Read-only: look for the startup hooks named in the advisory
python -c "import site; print('\n'.join(site.getsitepackages()))" | while read d; do
ls "$d" 2>/dev/null | grep -E "agent_framework_meta.pth|af_runtime_diag.pth"
done
# Read-only: search the repo for pinned malicious versions
grep -rnE "agent-framework[^0-9]*1\.26\.(1|2)" . --include="*.txt" --include="*.lock" --include="*.toml"
Elastic also suggests searching proxy, DNS and firewall logs for traffic to webhook.site with the User-Agents af-runtime-diagnostics/1 or runtime-diagnostics/1.
2. If you find it, rotate everything that host could reach
Not just the obvious key. Rotate cloud credentials, CI and GitHub Actions secrets, package registry tokens, Docker credentials, Hugging Face and AI service keys, and anything in .env files. Short-lived tokens minted from OIDC or the metadata service expire on their own, so review what those identities did during their lifetime rather than assuming expiry is the end of it.
3. Pin exact versions and check hashes
Lock every dependency to an exact version and verify hashes, so a new upload cannot slip into a build unnoticed. pip's --require-hashes option, documented here, makes the install fail if a file does not match the hash you recorded. Update dependencies deliberately, in a reviewed change, not as a side effect of a rebuild.
4. Add a cooling-off period for new releases
Both malicious versions were gone from PyPI within the hour, and Elastic recommends considering a delay before adopting newly published packages. Current pip supports --uploaded-prior-to, which accepts a duration such as P3D, and uv has an exclude-newer setting that accepts durations such as 7 days. A few days' delay would have kept these releases out of most builds without slowing anyone down.
# Only consider packages uploaded more than three days ago
pip install --uploaded-prior-to P3D -r requirements.txt
# pyproject.toml (uv)
[tool.uv]
exclude-newer = "7 days"
Keep a documented exception path for urgent security fixes, so the delay never becomes a reason to stay on a vulnerable version.
5. Do not treat provenance as proof of good code
Signed, attested releases are a real improvement, but they prove where a package came from, not that the code was reviewed. StepSecurity found that one malicious WPPConnect release was published by a GitHub Actions trusted publisher and carried valid provenance, built from a commit that had no review. In the agent-framework case, The Register reports the upload went through the official publisher account. Provenance tells you which pipeline to investigate. It does not replace your own controls.
6. Keep long-lived secrets off developer machines and build agents
The stealer harvested whatever was lying around: environment variables, credential files and token caches. Prefer short-lived, federated credentials. GitHub's OpenID Connect documentation explains how workflows can exchange short-lived tokens with your cloud provider instead of storing cloud secrets. Then go one step further: limit which repositories, branches and environments can request those tokens through the trust conditions on the cloud side, and give only the jobs that deploy the right to ask for one.
7. Shrink what managed identities can do
Microsoft's managed identity best practice guidance is blunt: if someone can install or run code on a resource, they have access to all the identities assigned to it, so grant the least permissions needed. A build agent or AI agent host with a subscription-wide role turns one poisoned package into a cloud-wide incident. Give build, test and runtime separate identities, scope each to the resources it actually touches, and remove roles nobody can explain.
8. Control outbound traffic from build agents and agent hosts
The stolen data went to webhook.site, a legitimate request-capture service. Databricks found that 38% of the malicious npm packages it analysed communicated with legitimate third-party services, so domain reputation alone will not catch this. Where you can, allow build agents and AI agent servers to reach only the package indexes, model endpoints and APIs they need, and log the rest.
9. Treat your AI stack as a supplier, and keep the evidence
The NCSC's supply chain security guidance sets out 12 principles for understanding risks, establishing control and checking your arrangements, and its guidelines for secure AI system development include supply chain security in the development stage. Apply both to AI frameworks, model SDKs and MCP servers: keep an inventory of what each project pulls in, who owns it and which identities it runs under. Then keep dated records of those identities, their roles and their OIDC trust settings, so that when the next advisory lands you can answer "what could it reach?" in minutes rather than days.
The same checklist in one place
- ☐ Lockfiles, images and CI logs searched for agent-framework 1.26.1 and 1.26.2 and the two
.pthfiles - ☐ Any affected host treated as exposed: secrets rotated, token activity reviewed
- ☐ Exact versions pinned and hashes required
- ☐ A cooling-off delay for new releases, with an exception path for security fixes
- ☐ Provenance used as a starting point, not as proof of reviewed code
- ☐ Short-lived federated credentials, with OIDC trust limited to named repositories and branches
- ☐ Managed identities split by role and scoped to least privilege
- ☐ Outbound traffic from build agents and agent hosts restricted and logged
- ☐ AI dependencies inventoried like any other supplier; dated identity evidence kept
If you run agent servers as well as build them, our earlier piece on exposed AI agent servers covers the other side of the same problem, and Sovereign AI Means You Own the Bill shows what attackers do with stolen cloud and AI credentials once they have them.
Checks 6 to 9 are really about cloud identity and configuration. PyraLink™ Prove uses read-only access to AWS, Azure and Google Cloud to collect configuration evidence mapped to ISO 27001, SOC 2 and Cyber Essentials controls, and produces digitally signed, dated evidence records that you can verify independently. You can read more about PyraLink™ Prove here.
What to tell your board
Keep it to three sentences. A widely used AI agent framework was briefly published with code that stole cloud and build credentials from any machine that ran it, and similar attacks are hitting other popular packages. We have checked whether we were exposed, and we now pin and delay new releases, keep long-lived secrets off build machines and limit what each identity can reach. If a package we rely on turns malicious, the damage is contained to what that one machine was allowed to do.
Building AI in your own environment remains the right call. The organisations that do it well will be the ones that treat the AI toolchain with the same care as the data it is meant to protect.
Frequently asked questions
Which agent-framework versions were malicious?
Versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI, both published on 17 November 2026 and since removed. The GitHub and PyPA advisories say 1.26.0 and earlier are not affected.
We installed it but never imported it. Are we safe?
No. The malicious versions added a .pth startup file, which Python runs whenever the interpreter starts in that environment. Importing the package was never required, so treat the environment as exposed.
Does blocking install scripts protect us?
Only partly. The agent-framework stealer ran at Python start-up, and the WPPConnect payload ran on import, so npm install --ignore-scripts did not stop it. Databricks found that only 54% of the malicious npm packages it analysed declared an install script.
Are short-lived OIDC tokens enough on their own?
They are much better than stored secrets, but the agent-framework stealer requested fresh OIDC and managed identity tokens from the machines it ran on. Limit which workflows can request tokens and what each identity is allowed to do, so a stolen token is worth as little as possible.
Was Microsoft Agent Framework itself vulnerable?
The advisories describe malicious releases published to PyPI without authorisation, not a flaw in the framework's code. The last clean release, 1.26.0, is not affected.
Sources
- GitHub Advisory Database, GHSA-764m-3ppc-5m73: Malicious code in agent-framework (PyPI), 18 November 2026.
- Python Packaging Authority via OSV, PYSEC-2026-4388.
- Elastic Security Labs, We caught the agent-framework PyPI compromise six minutes after it published, 18 November 2026.
- StepSecurity, Microsoft agent-framework PyPI Package Compromised, 18 November 2026.
- The Register, Microsoft's official Python agent framework hijacked to distribute malware, 18 November 2026.
- StepSecurity, WPPConnect Compromised: Malicious Releases Steal Secrets and WhatsApp Sessions, 16 November 2026.
- Databricks, What 5,400 Malicious npm Packages Reveal about Software Supply Chain Risk in 2026, 23 November 2026.
- Python documentation, site: site-specific configuration hook.
- pip documentation, pip install (
--require-hashes,--uploaded-prior-to); uv documentation, settings reference (exclude-newer). - GitHub Docs, OpenID Connect; Microsoft Learn, Managed identity best practice recommendations.
- NCSC, Supply chain security guidance and Guidelines for secure AI system development.