Skip to content
Shipworthy

Microsoft's agent-framework on PyPI was hijacked: what to check

Two releases of Microsoft's agent-framework on PyPI stole cloud and CI credentials on 17 November. How to tell if you installed one, and what to rotate.

By · · Updated · 21 min read


On Tuesday 17 November 2026, two malicious releases of agent-framework, Microsoft's official Python package for building AI agents, were uploaded to PyPI: 1.26.1 at 20:35 UTC and 1.26.2 at 21:08 UTC. Both contained a credential stealer that ran every time Python started, without the package being imported. PyPI quarantined each one within about half an hour, and both are now gone. Version 1.26.0 is clean.

If anything you run installed agent-framework without a pinned version that evening, check now. If either bad version was installed, treat every secret that machine or CI job could reach as stolen, rebuild the environment, and rotate. Two days later, nobody has confirmed how the attacker was able to publish under Microsoft's project, and Microsoft's GitHub repository for the framework is still offline.

What happened

Times are UTC. The second-level timestamps are StepSecurity's. Wiz, Elastic and the advisories give the same upload times to the minute.

WhenEventSource
12 Nov, 18:251.26.0 published, the last clean releasePyPI
17 Nov, 20:35:20Malicious 1.26.1 uploaded, as a wheel with no source distributionStepSecurity, OpenSSF advisory
17 Nov, 20:41Elastic's supply-chain monitor flags 1.26.1 as maliciousElastic
17 Nov, 21:06:16PyPI quarantines 1.26.1StepSecurity
17 Nov, 21:08:39Malicious 1.26.2 uploadedStepSecurity
17 Nov, 21:16:44PyPI quarantines 1.26.2StepSecurity
17 Nov, about 21:30Both versions no longer available on PyPIWiz
18 Nov, 00:31GitHub publishes malware advisory GHSA-764m-3ppc-5m73, rated criticalGitHub
18 Nov, 18:05The Register adds a comment from Microsoft (time zone not stated)The Register

By those timestamps, 1.26.1 could be installed for about 31 minutes and 1.26.2 for about 8. The second upload came 2 minutes and 23 seconds after the first was quarantined, which is why several researchers concluded that the attacker still had publishing access at that point.

Two of the news reports give different gaps between the uploads, "33 minutes" and "2.5 minutes". Both are right: the first is upload to upload, the second is quarantine to next upload.

The package matters because of where it sits. agent-framework is the name Microsoft's quick start tells you to install, and pypistats showed 194,722 downloads in the last month when I checked. That number is for all versions. Nobody has published a download count for the two bad ones.

Who is exposed

You are exposed if an install resolved agent-framework to 1.26.1 or 1.26.2. In practice that means one of these happened between 20:35 and about 21:30 UTC on 17 November:

  • pip install agent-framework or pip install -U agent-framework with no version, which is the command on the project's PyPI page.
  • An install from a loose constraint such as agent-framework>=1.26 with no lockfile. Orca names this case directly.
  • A lockfile regenerated in that window, which would have recorded the bad version and passed it to every later install.
  • A Docker image built in that window. The image keeps the files after PyPI removes them.

You are not exposed through this package if your lockfile already pinned 1.26.0 or earlier and you installed from it. You are also not exposed if you depend only on agent-framework-core or the individual integration packages. The malicious code was in the small meta package, which kept its normal dependency on agent-framework-core[all]==1.26.0. Orca says it checked agent-framework-core and 22 sibling packages and found them unaffected. When I checked PyPI, the last upload to agent-framework-core and to five of the integration packages was on 12 November.

How the stealer runs

Both releases added a .pth file to site-packages. Python reads these files at startup to extend its import path, and it runs any line in them that starts with import. So the stealer ran, in Wiz's words, "whenever Python starts in that environment, even if agent-framework is never imported."

1.26.11.26.2
Startup hookagent_framework_meta.pthaf_runtime_diag.pth
Stealer moduleagent_framework_meta/_telemetry.pyaf_runtime_diag.py
User-Agent when sendingaf-runtime-diagnostics/1runtime-diagnostics/1
GitHub Actions OIDC tokensNoYes

The names were chosen to look like SDK telemetry. In 1.26.2 the attacker also put agent_framework_meta/__init__.py back to the clean 1.26.0 file and moved the payload to a new module, so anyone looking only for the first version's files would see nothing wrong. Wiz: "Searching only for the 1.26.1 file names will miss this version."

On start, the code forks a detached background process, or uses a background thread where forking is not available, sets an environment variable _AF_TEL=1 so its child processes do not repeat the work, and hides all errors. It installs no service or scheduled task. According to OpenSourceMalware it runs only while the files stay in site-packages, but it runs again on every new Python start there.

For comparison, I downloaded the clean 1.26.0 wheel from PyPI and listed it. It has five files, one of which is agent_framework_meta/__init__.py, and no .pth file. A directory called agent_framework_meta is normal. A file called agent_framework_meta.pth is not.

What it takes

The researchers' lists agree on the main items:

  • Environment variables whose names contain strings such as TOKEN, SECRET, PASSWORD, KEY, AZURE, AWS, GITHUB and OPENAI.
  • Other processes' environments, read from up to 300 /proc/*/environ files on Linux.
  • Credential files: Azure CLI state under ~/.azure, .npmrc, pip.conf, .netrc, .git-credentials, Docker's config.json, Hugging Face tokens, Azure DevOps agent .credentials files, and .env and JSON files under /app and /workspace.
  • Fresh Azure tokens. The code asks the instance metadata service for managed-identity tokens for 12 Azure resources, including Resource Manager, Graph, Key Vault, Storage and Container Registry. It also requests Azure DevOps OIDC tokens when a pipeline exposes SYSTEM_ACCESSTOKEN.
  • GitHub Actions OIDC tokens, in 1.26.2 only, for workflows that have id-token: write.

The fourth and fifth items are the ones that set this apart. The code does not only copy secrets that are lying around. It uses the machine's identity to ask for new tokens. Wiz says the managed-identity and OIDC-exchanged tokens "are valid for up to 24 hours." Elastic adds a caveat on the Azure DevOps requests: "it is unclear whether these requests return a token that matches any federated credential."

Everything collected is compressed, base64-encoded and sent in one HTTPS POST to a single address on webhook.site, a public request-capture service: webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb. The researchers found no second-stage download and no fallback channel.

Check whether you installed it

One warning before any commands. Starting Python in an affected environment runs the stealer again, and pip is a Python program. StepSecurity's advice: "Do not begin with pip uninstall, pip show, or a Python inspection command in the affected environment." The commands below are mine, not the researchers', and they use only grep and find. I tested them against sample files.

Lockfiles and requirements files. Run these at the root of each repository:

# Version written on one line (requirements.txt, pip logs, wheel file names)
grep -rnE 'agent[-_]framework(==|-)1\.26\.[12]([^0-9]|$)' .

# uv.lock and poetry.lock, where name and version sit on separate lines
grep -rn -A1 --include='uv.lock' --include='poetry.lock' \
  -E '^name = "agent-framework"$' . | grep -E 'version = "1\.26\.[12]"'

# Any lockfile that records hashes: the two malicious wheels
grep -rnlE 'd27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110|3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9' .

No output from all three means the repository never recorded a bad version. It does not cover an install that had no lockfile.

Machines, runners and images. Search the disk for the files themselves:

sudo find / \( -path /proc -o -path /sys -o -path /dev \) -prune -o \
  \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' \
     -o -name 'af_runtime_diag.py' \
     -o -name 'agent_framework-1.26.[12].dist-info' \) -print 2>/dev/null

Any result means a bad version is or was installed there. For a container image, run the same find with sh as the entrypoint so that Python never starts.

CI logs. Hosted runners are thrown away after each job, so the log is the evidence. Look at every run that installed Python dependencies between 20:35 and 21:30 UTC on 17 November. On GitHub Actions:

gh run list --repo OWNER/REPO --created 2026-11-17 --limit 200 \
  --json databaseId,createdAt,workflowName

gh run view RUN_ID --repo OWNER/REPO --log \
  | grep -E 'agent[-_]framework(==|-)1\.26\.[12]([^0-9]|$)'

Network logs. Search proxy, DNS and firewall logs for webhook.site and for the two User-Agent strings in the table above. webhook.site is a legitimate shared service, so in StepSecurity's words "a connection alone does not confirm exfiltration". The path with the ID above does. Wiz gives a way to read the response code if your proxy records it: "A 200 means that host's data was accepted. A 410/429 suggests it was rejected."

If you installed it

The PyPI advisory, PYSEC-2026-4388, puts it plainly: "Any system or CI job that installed either version should be treated as compromised."

1. Stop running Python there. Isolate the host or runner and stop the CI jobs that use it. Every Python start repeats the collection and the upload.

2. Rebuild instead of cleaning. Delete the virtual environment, container or runner image and build it again from a known-good base, with pip and uv caches cleared and any internal mirror checked for the two wheel files. Uninstalling in place means starting pip inside the affected environment, which is the thing step 1 tells you not to do.

3. Pin 1.26.0 with hashes. These are the SHA-256 values PyPI lists for 1.26.0. I downloaded the wheel and confirmed its hash matches:

agent-framework==1.26.0 \
    --hash=sha256:14267ec8e6929c139015f8ec918adc638a71c7656901413426bb30ab199b6d71 \
    --hash=sha256:b20870b77f237bcf52b6abbab86364f7fcbb23d41d217fd0d643556d19462167

pip only enforces hashes when every package in the file has one, so generate the full file with pip-compile --generate-hashes or use uv lock.

4. Rotate everything the environment could reach. That means every secret in its environment variables and .env files, Azure service principal credentials, Azure DevOps personal access tokens and service connections, GitHub tokens, npm, PyPI, NuGet, Docker and Hugging Face tokens, and stored git credentials. Include secrets that belonged to other processes on the same machine, because the stealer read those too.

5. Review what the fresh tokens were used for. By Wiz's 24-hour figure, tokens minted on 17 November have expired. That is my inference from Wiz's number, not a statement from Microsoft, and it does not undo anything done with them while they were valid. Review Entra ID sign-in logs and Azure activity logs for the managed identities and federated credentials reachable from the affected machine, Azure DevOps audit logs, and GitHub Actions runs, from 20:35 UTC on 17 November onwards. If a GitHub workflow with id-token: write installed 1.26.2, review every Entra ID federated credential that trusts that repository.

OpenSourceMalware's rule covers the case where a fixed release appears: "Treat any installation of 1.26.1 or 1.26.2 as a credential compromise, even if the publisher is restored or a newer version is released."

How did the attacker publish? Nobody has confirmed it

This is the largest open question, and the accounts do not agree.

Microsoft has said very little. A spokesperson told The Register on 18 November: "We have made some repositories private while we investigate malicious content," and "Our priority is to protect customers and the broader ecosystem." The statement does not say how the releases were published. BleepingComputer says it asked Microsoft what the point of breach was and had no reply when it published. SecurityWeek reports that a maintainer confirmed in a GitHub issue that the releases had been removed and an investigation was under way. I could not read that issue, because the repository is offline.

PyPI's advisory says the two versions were uploaded "without authorization" and that "PyPI Security worked with Microsoft to review the project's accounts and complete remediation steps." It does not say what those steps were.

Wiz, in an update on 18 November, wrote: "The attacker appears to have compromised a client certificate and private key for Microsoft ESRP." Wiz describes ESRP as the release pipeline Microsoft uses to sign and publish packages. It says the first publish attempt "from AWS, was rejected by ESRP's IP filtering" and that "A second attempt from Microsoft-owned IP space succeeded." It adds: "How the credentials were obtained is not yet known."

SafeDep points to a PyPI account named vibiret, which it says joined PyPI on 17 November and is listed as a second maintainer on agent-framework and five related projects. SafeDep is careful about what that shows. Its write-up, as revised on 23 November, reads: "PyPI does not publish who uploaded a file. On 18 November the join date pointed to vibiret as the account that uploaded 1.26.1 and 1.26.2." It now sets Wiz's account beside its own: "ESRP already publishes the package, so a publish through ESRP needs no new maintainer account." It says "what part the account played is not known", and: "Neither PyPI nor Microsoft has released the upload log that would settle it."

StepSecurity says the uploader's client identified itself as RestSharp/106.13.0.0 and concludes: "The available evidence does not establish the initial access vector, the specific account or credential used, or the uploader's identity."

The Register describes "what appears to be unauthorized access to an administrator account on Microsoft's Github organization", and OX Security writes that "it seems that attackers found a way to hijack the wheel creation flow". Neither is confirmed.

These accounts are not mutually exclusive, and I can't tell you which is right. Here is what I could check myself at 14:05 UTC on 19 November:

  • The PyPI project page for agent-framework listed two maintainers, microsoft and vibiret. I could not open the account's profile page, so the join date is SafeDep's.
  • PyPI's API listed 1.26.0 as the latest version, with no files for 1.26.1 or 1.26.2 and a project status of "active".
  • github.com/microsoft/agent-framework returned 404. So did github.com/microsoft/onnxruntime, which The Register and SecurityWeek also reported offline. The Register notes that "neither Microsoft nor security researchers have linked the ONNX repo's pull to the malware campaign."

When I checked again at about 18:05 UTC on 23 November, all three were the same: vibiret was still listed as a maintainer, 1.26.0 was still the latest version, and both repositories still returned 404.

On 25 November nothing had changed. PyPI's API still listed vibiret on the project, 1.26.0 was still the latest version, and both repositories still returned 404. The only other word from Microsoft's side that I found is on the repository for the Go version of the framework. Someone asked there on 19 November whether the Python repository is coming back. A member of the Microsoft organisation replied the next day: "This is being actively investigated, and the repository was taken private while the investigation is ongoing." It gives no cause and no return date.

If vibiret is the attacker's account and still has publish rights, a new malicious release of any of those six projects is possible. That is SafeDep's concern, and it is the reason to pin with hashes now instead of waiting for an all-clear.

What Wiz found in the stolen data

Because the stolen data went to a public capture service, Wiz was able to look at what arrived. It says the attacker's endpoint was on the free tier and that "a maximum of 50 requests were captured". Of those, Wiz says four came from the attacker's own machines, 29 "appear linked to sandbox environments, vendor scanning, and tests," and the remaining 17 represent "only three unique, successful cases of exfiltration of victim data."

Three is a small number, and it is one vendor's count that I can't verify. StepSecurity lists whether exfiltration succeeded among the things it could not establish. Rotating is cheap next to finding out you were one of the three, so I would not treat this as a reason to skip it.

The same data showed something about the attacker's tooling. Wiz says it "identifies itself as Cairn, an open-source AI penetration-testing framework," that the package was staged in a directory named /tmp/cairn_pkg, and that a test run captured an agent configuration that "appears to be the open-source Pi harness backed by a GLM-family model". In other words, Wiz's evidence suggests that at least part of this attack was carried out by an AI agent. A tool's name does not tell you who was operating it, and no source attributes the attack to a known group. The GitHub advisory says: "We have not attributed this to a known campaign."

Not the first time this year

This is at least the third reported compromise of Microsoft's open source packages in 2026. That count is mine, from the reports below, and nobody has linked the earlier two to this one.

Mid-May: durabletask. Microsoft's durabletask Python package on PyPI was poisoned with a credential stealer. Ars Technica reported that the attack was documented by StepSecurity, "has been linked to a threat actor tracked as TeamPCP", and worked by "compromising Microsoft credentials for publishing the package."

Early June: 73 packages. Ars Technica reported on 8 June that 73 Microsoft packages had been compromised with a self-replicating stealer tracked as Miasma, which ran when a developer opened a package in an AI coding agent. Its reporter, Dan Goodin, wrote: "The Microsoft GitHub account compromised in the May attack is the same one used late last week. The explanation for this double compromise isn't currently known."

Two things from June look familiar now. The first is the shape of the attack: in all three cases the attacker did not need a bug in Microsoft's code, only the ability to publish as Microsoft. The second is Microsoft's response. Its statement to Ars Technica in June was: "We have temporarily removed some repositories as we investigate potential malicious content." Its statement to The Register this week, "We have made some repositories private while we investigate malicious content," is nearly the same sentence.

That does not make this the same attacker or the same stolen credential. Wiz, on the May incident: "We have not linked the two incidents." SafeDep also says it found nothing shared between the durabletask compromise and this one. The June malware spread itself, and the researchers who examined this week's payload found no code that downloads or runs anything further. What the history does support is a narrower point: packages published under Microsoft's name have carried a credential stealer three times in seven months. At the time of the June report, Ars Technica wrote, "Microsoft isn't providing details at the moment." I have not checked what Microsoft published about those two incidents afterwards. If you depend on Microsoft's packages, pin and hash-check them as you would anyone else's.

What would have prevented it

The two bad versions were installable for about 39 minutes in total. Three habits would each have kept them out. These are my recommendations, drawn from the researchers' advice.

  • Install from a lockfile with hashes. A lockfile made before 17 November pins 1.26.0, and a hash check rejects a file that does not match even if the version number is the same.
  • Wait before taking new releases. Elastic's suggestion is to add "a delay before adopting newly published packages". uv's --exclude-newer option does this by ignoring anything published after a date you give it. A delay of one day would have been enough here.
  • Give CI jobs the least identity they need. The stealer could only ask for tokens that the machine was allowed to get. A build job with no managed identity and no id-token: write has much less to lose.

What is still unknown

  • How the attacker got publishing access, and whether that access is closed.
  • How many installs the bad versions got. SafeDep says this "is not known yet". Wiz's count of three covers data that reached the endpoint, not installs.
  • When the GitHub repository will return, and whether the ONNX Runtime repository going offline is related.
  • Whether anything other than the Python package was touched. The reports I read cover only agent-framework on PyPI. None mentions the framework's .NET packages.
  • When a new clean release will ship. GitHub's advisory lists patched versions as "None".

None of these had an answer on 23 November, six days after the uploads. I found no statement on PyPI's blog or on Microsoft's security, open source or Agent Framework blogs.

I will update this post when Microsoft or PyPI publishes an account of what happened.

The short version

  • What happened: agent-framework 1.26.1 and 1.26.2 on PyPI, uploaded on 17 November 2026 at 20:35 and 21:08 UTC, contained a credential stealer. PyPI quarantined both within about half an hour each. 1.26.0 is clean.
  • How it ran: a .pth file started it on every Python launch, with no import needed.
  • What it took: secret-looking environment variables, credential files, and freshly requested Azure and GitHub Actions tokens, sent to one webhook.site address.
  • Who is exposed: anyone whose install resolved to either version, mainly unpinned installs and builds during that window, and anything built from them.
  • What to do: search with grep and find, not with Python or pip. If you find it, rebuild the environment, pin 1.26.0 with hashes, rotate everything it could reach, and review cloud and CI logs from 20:35 UTC on 17 November.
  • What is unknown: how the attacker was able to publish. Microsoft has not said, and its repository is still offline.
  • Background: Microsoft packages were also compromised in May (durabletask) and June (73 packages). Nobody has linked those to this attack.

This is the third security story here in three days. The other two: malicious JavaScript served to 178 organisations through Optimizely, and the nginx2root bugs fixed in nginx 1.31.9 and 1.30.7.

Frequently asked questions

Which versions of agent-framework are malicious?

Versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI, both uploaded on 17 November 2026. Version 1.26.0, published on 12 November, is the last clean release, and it was the latest version on PyPI when I checked on 19 November. The advisories list no patched version because nothing newer has been released.

I never imported agent_framework. Was the stealer still able to run?

Yes. Both releases added a .pth file to site-packages. Python runs the import lines in .pth files every time the interpreter starts, so the stealer ran on the next Python start in that environment, whatever script was being run. Installing the package was enough.

Is agent-framework-core affected?

No report says so. The malicious code was only in the agent-framework meta package, which kept its normal dependency on agent-framework-core 1.26.0. Orca says it checked agent-framework-core and 22 sibling packages and found them unaffected. On PyPI, the last upload to agent-framework-core was on 12 November.

How did the attacker publish under Microsoft's PyPI project?

Nobody has confirmed it. Wiz says the attacker appears to have compromised a client certificate and private key for Microsoft's ESRP release pipeline. SafeDep points to a PyPI account called vibiret that was created on the day of the attack and has publish rights. Microsoft has only said it made some repositories private while it investigates.

The bad versions are gone from PyPI. Am I safe now?

Only if you never installed one. Removal from PyPI does not remove the files from a virtual environment, a container image, a CI cache or an internal mirror that already has them, and it does not un-steal anything. If either version was installed, rebuild that environment and rotate every credential it could reach.

Get The Shipping Forecast

One email on Thursdays: what I tested and wrote that week, plus one tool worth your time.

You'll get a confirmation email first. Unsubscribe in one click. Privacy policy.