Microsoft's Agent Framework was hijacked on PyPI: what Python teams building AI agents should check
Two unauthorized releases of Microsoft's agent-framework Python package stole passwords and cloud tokens, and Microsoft has now taken the repository offline. Who is affected and what to do.
- Author
Umair Mateen- Published
- Reading time
- 4 min
- Category
- AI
Ideas in this post
Tap one for a 5-second answer. Underlined words in the article work the same way.
0 of 4 understood

Two releases of Microsoft's Agent Framework for Python, versions 1.26.1 and 1.26.2 of the agent-framework package, were uploaded to PyPI without authorization on 17 November 2026 and carried code that steals passwords, tokens and cloud keys. Both were pulled from PyPI the same evening. On 25 November Microsoft added that it has taken the framework's GitHub offline as a precaution, with no confirmed date for bringing it back. If your team builds in Python, check this week whether either version ever reached a laptop, server or build pipeline.
What happened
Agent Framework is Microsoft's toolkit for building AI agents. According to the GitHub security advisory, version 1.26.1 went up at 20:35 UTC on 17 November and 1.26.2 about half an hour later. Security firm Wiz reports both were gone from PyPI by about 21:30 UTC, and the public issue that first flagged the problem confirms the default version is back to 1.26.0.
The short window does not make it harmless. Automated builds that install "the latest version" can pick up a package within minutes, and Wiz says it could confirm three separate cases where victim data was successfully sent to the attacker.
Quick check · Everyday ↔ real
Can you match the archive to the real thing?
Switch between the two and see how each part lines up.
- The project's archive
- A dated copy with a signed note
- The clerk's reference number
- The logbook
- A separate tray for a draft
- Combining the draft into the main copy
The office archive for one project
| Everyday | Real |
|---|---|
| The project's archive | Repository |
| A dated copy with a signed note | Commit with a message |
| The clerk's reference number | Commit ID (SHA or hash) |
| The logbook | Commit history |
| A separate tray for a draft | Branch |
| Combining the draft into the main copy | Merge |
From the explainer What is version control? Explained with an office archive
What the malicious code does
- It runs without being used. Each bad release adds a small startup file that Python executes every time it starts on that machine, even if your code never imports the framework.
- It collects secrets. The advisory lists environment variables with names like TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI; credential files for Azure, npm, Git and Docker;
.envfiles; and short-lived Azure identity tokens. Version 1.26.2 also tries to take GitHub Actions sign-in tokens from build runners. - It sends them out quietly. The data is compressed and posted to a public request-collection website from a background process, with errors hidden.
Microsoft says only the agent-framework Python meta-package was affected. Version 1.26.0 and earlier, the .NET packages and Semantic Kernel are not. How the attacker got publishing access is still being investigated: Wiz reports that a certificate and key for Microsoft's release pipeline appear to have been compromised, while the advisory says the incident has not been tied to a known campaign.
Who should care
- Teams that installed or upgraded
agent-frameworkon or after 17 November, on developer machines, servers, containers or CI. - Anyone whose build pipelines or Docker images install Python packages without pinned versions.
- Companies using Azure managed identities, Azure DevOps or GitHub Actions with cloud sign-in from the same environment, since those are the tokens the code goes after.
- Teams that depend on the framework's GitHub repository for code, issues or releases while it is offline. Microsoft says the project is not discontinued.
Limits and open questions
There are no fixed versions: the advice is to stay on 1.26.0. Microsoft has not said when the repository returns or what caused the breach. Details such as the exact list of targeted variables differ slightly between the advisory, the issue and Wiz's write-up, so use the advisory and Microsoft's post as the reference and the others for extra checks.
What to do this week
- Search for the bad versions. Check lockfiles, requirements files, , virtual environments and CI logs for
agent-framework1.26.1 or 1.26.2. The indicator files Microsoft lists areagent_framework_meta.pthandaf_runtime_diag.pthin the Python site-packages folder. - If you find them, assume compromise. Microsoft's guidance is blunt: "Treat the machine, container, or CI job as compromised." Rotate every credential that environment could reach (cloud identities, API keys, CI and package-registry tokens, Git credentials), rebuild from a clean image rather than downgrading in place, and review cloud and CI audit logs from 17 November.
- If you are not affected, pin. Set
agent-framework==1.26.0(or the exact sub-packages you use) and hold upgrades until Microsoft gives further guidance. - Close the wider gap. Pin versions with hashes in production builds, give build jobs only the cloud permissions they need, and make sure someone watches advisories for the AI libraries your team depends on. Agent toolkits often run with access to company systems, which makes them a valuable target.
The DevDrift helps teams build AI agents with locked-down credentials, pinned dependencies and audit trails, so an incident like this stays contained.
Sources
You’ve read the news. Now understand it.
- Learn · 5 min · Everyday ↔ realWhat is version control? Explained with an office archiveVersion control records every saved change to a project's files, with who, when and why, so a team can compare versions and go back to any of them. Like an office archive with a logbook of every dated copy.Start in 5 seconds →
- Learn · 5 min · Myth or factWhat is an AI agent? Explained with an assistant you send on errandsAn AI agent takes a goal, plans the steps and carries them out with software tools, checking each result as it goes. Explained with an assistant you send on errands.Start in 5 seconds →
- Learn · 5 min · Myth or factWhat is open source? Explained with a community cookbookOpen source software publishes its source code under a licence that lets anyone use, change and share it, under set conditions. Like a recipe in a community cookbook.Start in 5 seconds →
- Learn · 5 min · Everyday ↔ realWhat are containers? Explained with shipping containersA container packs an app with everything it needs into one standard box, so it runs the same on any computer set up for it. Like a shipping container that fits on any ship.Start in 5 seconds →


