# Microsoft's agent-framework Hijacked on PyPI: Check for 1.26.1 and 1.26.2, Then Rotate

URL: https://www.devopsness.com/blog/microsoft-agent-framework-pypi-hijack-1-26-1-credential-stealer
Author: Kiril Urbonas
Published: 2026-11-18
Updated: 2026-12-05
Categories: DevOps
Tags: Supply Chain, Python, Security, Azure, GitHub Actions

Summary: Two malicious agent-framework releases were live on PyPI for under an hour on November 17, 2026, and a .pth hook ran the stealer on every Python start. How to check without making it worse, what to rotate, and the cooldown that would have skipped it.

---
# Microsoft's agent-framework Hijacked on PyPI: Check for 1.26.1 and 1.26.2, Then Rotate

If any machine or CI runner installed `agent-framework` 1.26.1 or 1.26.2 on November 17, 2026, treat it as compromised. Both releases carried a credential stealer that runs every time Python starts, whether or not your code imports the package. Pin 1.26.0, rebuild the host, and rotate everything it could read, starting with CI and cloud credentials.

> [!VERIFIED]
> Basis: case-study
> Built on the JFrog, StepSecurity, SafeDep and Wiz analyses of November 17 and 18, GitHub advisory GHSA-764m-3ppc-5m73, and the uv and Dependabot docs. Detection commands are from the SafeDep write-up. Checked November 2026.

## What happened on November 17

`agent-framework` is the PyPI meta-package for Microsoft Agent Framework, which replaces Semantic Kernel and the archived AutoGen for new Microsoft work, with roughly 40,000 downloads a week. The last clean release, 1.26.0, shipped on November 12. Then, in UTC:

| Time (Nov 17) | Event | Reported by |
|---|---|---|
| 20:35 | 1.26.1 uploaded | StepSecurity, JFrog |
| ~20:41 | Renovate opens upgrade PRs in downstream repos | JFrog |
| 21:06 | PyPI quarantines 1.26.1 | StepSecurity |
| 21:08 | 1.26.2 uploaded, after the quarantine | StepSecurity, Wiz |
| 21:16 | PyPI quarantines 1.26.2 | StepSecurity |

The second upload is the alarming part: quarantining one version did not take away the attacker's ability to publish. How they got that ability is not settled. StepSecurity and SafeDep say the access vector is unknown. Wiz says the attacker "appears to have compromised" a client certificate for Microsoft's ESRP signing and release service, while JFrog found the wheels were repacked by a local script outside Microsoft's normal pipeline. Neither release had a provenance attestation. GitHub published advisory GHSA-764m-3ppc-5m73 on November 18 marking exactly those two versions as malicious; 1.26.0 and earlier are not affected.

## Why uninstalling does not fix it

Both releases kept a dependency on the genuine `agent-framework-core` 1.26.0, so applications kept working. The payload rode in on a `.pth` file: `agent_framework_meta.pth` in 1.26.1, `af_runtime_diag.pth` in 1.26.2. Python processes every `.pth` file in `site-packages` at interpreter startup and executes any line that begins with `import`. That means `pip`, `pytest`, IDE language servers and every unrelated script in the environment ran the stealer.

Per Chainguard, Orca and Wiz, it collected environment variables matching names like `TOKEN`, `SECRET`, `KEY`, `AZURE`, `AWS` and `GITHUB`, read the environment of up to 300 other processes through `/proc`, and swept credential files: Azure CLI profiles, `pip.conf`, `.npmrc`, `.netrc`, Git credential stores, Docker `config.json` and `.env` files. It also requested Azure managed identity tokens from the instance metadata endpoint, the Azure DevOps `SYSTEM_ACCESSTOKEN`, and, in 1.26.2, GitHub Actions OIDC tokens. Everything went out as compressed JSON to a `webhook.site` URL. Wiz's look at that endpoint found three distinct victims whose data was accepted; the true number of installs is unknown.

Uninstalling removes the hook but not what it already sent. And running `pip uninstall` on an infected environment starts Python, which runs the stealer once more.

## Check every environment, without starting Python

Search lockfiles and installed environments with shell tools only:

```bash
# lockfiles and requirements pinned to a bad version
$ grep -rnE 'agent[-_]framework.{0,20}1\.26\.[12]\b' --include='*.txt' --include='*.lock' --include='*.toml' --include='*.cfg' .

# the startup hooks on disk (virtualenvs, containers, runner images)
$ find / -path '*site-packages/*' \( -name 'agent_framework_meta.pth' -o -name 'af_runtime_diag.pth' \) -type f 2>/dev/null
```

Then check egress: proxy or DNS logs with requests to `webhook.site` since 20:35 UTC on November 17, or the user agents `af-runtime-diagnostics/1` and `runtime-diagnostics/1`. Block the exact webhook path from the advisories rather than all of `webhook.site` if other teams use the service legitimately. For CI, list every pipeline run between 20:35 and about 21:30 UTC that resolved dependencies without a lockfile; ephemeral runners are gone, but the secrets they held were not.

If you find the file, delete the `.pth` and its `.py` payload with `rm` before anything starts Python, then rebuild from a clean image rather than repairing in place.

## Rotate in this order

1. **CI credentials.** Azure DevOps service connections and PATs, GitHub Actions secrets, and any OIDC federated credential the runner could use. Review what the federated identities were allowed to do on November 17.
2. **Cloud keys.** Static AWS, Azure and GCP keys found in environment variables or files. Review role assignments for any managed identity on an affected VM, since its tokens were requested.
3. **Package registry tokens.** PyPI, npm and NuGet tokens from `pip.conf`, `.npmrc` and `.netrc`, because a stolen publish token is how the next hijack starts.
4. **Everything in `.env` files.** Database URLs, LLM provider keys (`OPENAI` was on the list) and webhook secrets.

Then audit Entra ID sign-ins, Azure DevOps audit logs and GitHub Actions runs from November 17 onward for anything you cannot attribute.

## The six-minute problem

JFrog saw Renovate open upgrade PRs within about six minutes of 1.26.1 landing. A bot doing its job turned a 31-minute window into merge candidates in downstream repos. The fix is a release cooldown: refuse versions younger than a few days, which this attack, and most like it, never survives.

```toml
# pyproject.toml
[project]
dependencies = ["agent-framework==1.26.0"]

[tool.uv]
# ignore anything uploaded in the last 7 days
exclude-newer = "7 days"
```

Dependabot applies a 3-day cooldown to version updates by default; security updates skip it. Renovate needs `minimumReleaseAge` set explicitly, for example `"3 days"` in a package rule. The same layered defenses we cover in [npm supply chain CI hardening](/blog/npm-supply-chain-ci-hardening) apply to PyPI: lockfiles with hashes, an internal mirror, and egress allowlists on runners. If you are choosing between agent SDKs after this, the [AI agent frameworks comparison](/blog/best-ai-agent-frameworks) still holds; the package was hijacked, not the framework. This was one of nine stories that month; the [November 2026 DevOps roundup](/blog/devops-news-november-2026-what-you-missed) puts it next to the Rackspace Spot breach and the 7.86-second key thefts, which share the same lesson.

## Questions people ask

### Is agent-framework 1.26.0 safe?

Yes. GHSA-764m-3ppc-5m73 lists only 1.26.1 and 1.26.2 as malicious and states that 1.26.0 and earlier are not affected. Pin `agent-framework==1.26.0` with hash checking, and wait for a newer release that analysts confirm clean, ideally one with a provenance attestation, before moving off it.

### I only imported agent-framework-core. Am I affected?

Not through `agent-framework-core` itself: Orca checked it and 22 sibling packages and found them clean. You are affected only if the `agent-framework` meta-package at 1.26.1 or 1.26.2 was installed into the environment, for example as a transitive dependency or through an unpinned `pip install`.

## The decision, concretely

- Lockfile pins 1.26.0 or earlier and no `.pth` hits? You are clear; add a cooldown anyway.
- A hook found on a developer laptop? Rebuild or wipe the environment, rotate every credential that user holds.
- A hook found on a CI runner or build image? Rotate all pipeline secrets and federated credentials first, then rebuild the image.
- Unpinned installs ran during the window but logs are gone? Assume exposure and rotate.

## The call we'd make

Run the two `find` and `grep` checks across every runner image and virtualenv today, and rotate CI credentials wherever the hook turns up. Then add a 3-to-7-day cooldown to every Python and npm dependency path. The caveat: a cooldown delays good fixes too, so let security updates through, as Dependabot does by default.

## Sources

- [GitHub Advisory GHSA-764m-3ppc-5m73: Malicious code in agent-framework](https://github.com/advisories/GHSA-764m-3ppc-5m73)
- [JFrog: agent-framework hijacked on PyPI via silent .pth startup hook](https://research.jfrog.com/post/agent-framework-hijack/)
- [StepSecurity: Microsoft agent-framework PyPI package compromised](https://www.stepsecurity.io/blog/microsoft-agent-framework-pypi-package-compromised)
- [Wiz: Malicious version of Microsoft's agent-framework published to PyPI](https://www.wiz.io/blog/malicious-version-of-microsofts-agent-framework-published-to-pypi)

