Security Digest · Nov 17, 2026 · Supply-chain compromise · AI agent tooling

Microsoft agent-framework PyPI Hijack Steals CI Credentials

Two hijacked agent-framework releases on PyPI ran a .pth hook that stole cloud and CI credentials on any Python start. Pin 1.26.0 and check Nov 17 installs.

Our verdict

Check exposure

The bad versions were live for about 40 minutes and are now quarantined, so most teams only need to confirm they never resolved them, but any host or CI job that installed 1.26.1 or 1.26.2 must be treated as fully compromised.

Who must act: Anyone whose lockfiles, CI logs, caches, internal mirrors or container images show agent-framework 1.26.1 or 1.26.2, including CI runs on Renovate or Dependabot upgrade pull requests opened on November 17, 2026.

Who can relax: Projects pinned to 1.26.0 or earlier, and anything that did not resolve a fresh agent-framework version between 20:35 and 21:16 UTC on November 17, 2026.

Affected
agent-framework 1.26.1 (PyPI)
agent-framework 1.26.2 (PyPI)
Fixed in
Both versions quarantined by PyPI on November 17, 2026; 1.26.0 is the last clean release
CVSS
Not scored
EPSS
n/a
CISA KEV
Not listed
Exploitation
Exploited in the wild
Severity
Critical

What to do

  1. Search lockfiles, CI logs, dependency caches, internal mirrors and container images for agent-framework 1.26.1 or 1.26.2.
  2. If either was installed, isolate the host or runner before starting Python or pip there again, because every interpreter start re-runs the hook.
  3. Rebuild affected machines, runners and images from a clean base and pin agent-framework==1.26.0 with hashes.
  4. From a clean machine, rotate every secret the environment could read: cloud keys, LLM API keys, Azure CLI sessions, Azure DevOps tokens, npm, PyPI, NuGet, Docker, Git and Hugging Face credentials.
  5. Review Azure managed-identity and federated-credential sign-ins, and GitHub Actions jobs with id-token: write, for token use from the exposure window.
  6. Close any open upgrade pull requests to 1.26.1 or 1.26.2 and block both versions in your package proxy.

How to check if you are affected or compromised

  • Without starting Python, look for the hook files: find / \( -name 'af_runtime_diag*' -o -name 'agent_framework_meta.pth' \) 2>/dev/null.
  • Find installed metadata for the bad versions: find / -type d -name 'agent_framework-1.26.[12].dist-info' 2>/dev/null.
  • Search proxy and DNS logs for webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb and the user agents af-runtime-diagnostics/1 or runtime-diagnostics/1.
  • On Linux, find surviving collector processes: grep -l '_AF_TEL=1' /proc/[0-9]*/environ 2>/dev/null.

What happened#

On November 17, 2026, someone published two unauthorized releases of agent-framework, Microsoft's official Python package for building AI agents, to PyPI. StepSecurity's timeline records version 1.26.1 uploaded at 20:35:20 UTC and quarantined at 21:06:16 UTC. Version 1.26.2 followed at 21:08:39 UTC, two minutes after the first quarantine, and was quarantined at 21:16:44 UTC. The attacker clearly still had publishing access after the first release was pulled. The PyPI project page now lists 1.26.0, released November 12, as the latest version.

Both wheels add a .pth file to site-packages: agent_framework_meta.pth in 1.26.1 and af_runtime_diag.pth in 1.26.2. Python processes these files every time the interpreter starts. The stealer therefore runs on any Python launch in that environment, including pytest, linters and pip itself, even if nothing imports the framework. The wheels kept the real dependency on agent-framework-core 1.26.0, so applications kept working normally.

The payload forks into a detached process and collects any environment variable whose name contains strings such as TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI or HF_. It also scrapes the environments of up to 300 other processes. It copies credential files for Azure CLI, pip, npm, netrc, Git, Docker, Hugging Face and Azure DevOps agents, plus .env files under /app and /workspace. It then requests fresh Azure managed-identity tokens for twelve services, and 1.26.2 adds GitHub Actions OIDC tokens for Azure audiences. Everything goes out in one HTTPS POST to a webhook.site URL. Socket found no second-stage download. JFrog notes that the broad KEY match also catches third-party LLM keys such as ANTHROPIC_API_KEY.

Who is affected#

Only installs of 1.26.1 or 1.26.2. The package is widely used: Wiz puts it at about 41,000 downloads a week, and OX Security counts 192,534 a month. The realistic exposure is narrower than those numbers suggest. You were at risk if an unpinned install, a fresh lockfile resolution or a dependency bot picked up a new version during a window of about 40 minutes. JFrog saw Renovate open upgrade pull requests within six minutes of 1.26.1 appearing, and CI that installed dependencies on those pull requests may have run the hook. Mirrors or caches that saved a copy can still serve it today. The file paths target Linux, but JFrog says macOS hosts still leak environment variables and Azure CLI token caches.

Do you really need to act?#

Check first. Most teams will find nothing. Wiz says the attacker used a free-tier webhook that captured at most 50 requests. Of those, four came from the attacker's own testing, 29 came from sandboxes, scanners and tests, and the rest came from three distinct victim environments. Free-tier URLs stop storing requests at their limit and answer later ones with HTTP 410 or 429. Even so, a payload that sent nothing still ran, and it may have requested tokens. If you find either version anywhere, treat that host as fully compromised.

How the attacker got publishing access is not confirmed. Wiz says the attacker appears to have used a stolen client certificate and key for ESRP, Microsoft's internal release pipeline. We found no Microsoft advisory as of November 20, and the GitHub repository linked from PyPI returned "Not Found" when we checked.

What to do now#

  1. Search lockfiles, CI logs, caches, mirrors and images: grep -rnE 'agent[-_]framework(==|-)1\.26\.[12]' . In uv.lock or poetry.lock, check the version under name = "agent-framework".
  2. If you find a hit, isolate the machine or runner first. Do not run pip show or pip uninstall there, because starting Python re-runs the hook.
  3. Rebuild from a clean base and pin agent-framework==1.26.0 in a hash-locked file. Block 1.26.1 and 1.26.2 in your proxy, and purge cached wheels.
  4. From a clean machine, rotate every secret the environment could reach, including LLM API keys and Azure CLI sessions. Rotating secrets does not revoke tokens already issued: Wiz says managed-identity and OIDC-exchanged tokens stay valid for up to 24 hours.
  5. Review Entra ID sign-ins for the affected managed identities and federated credentials. Restrict id-token: write to the GitHub Actions jobs that need it.

How to tell if you were hit#

Without starting Python, run find / \( -name 'af_runtime_diag*' -o -name 'agent_framework_meta.pth' \) 2>/dev/null. Then look for agent_framework-1.26.1.dist-info or agent_framework-1.26.2.dist-info directories. On Linux, grep -l '_AF_TEL=1' /proc/[0-9]*/environ finds collector processes still running. In proxy and DNS logs, search for webhook.site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb and the user agents af-runtime-diagnostics/1 and runtime-diagnostics/1. Wiz says an HTTP 200 response means the webhook stored that host's data. StepSecurity and Socket publish wheel and payload SHA-256 hashes.

Timeline#

  • — Legitimate agent-framework 1.26.0 published with wheel and source distribution.
  • — 1.26.1 uploaded at 20:35 UTC and quarantined at 21:06. 1.26.2 uploaded at 21:08 and quarantined at 21:16. Wiz reports its findings to Microsoft the same day.
  • — Wiz updates its post with its root-cause assessment and its analysis of the exfiltrated requests.

Sources

Original sources first: vendor and project advisories, CVE and government records, the discoverers’ write-ups. Every claim above links to one of these. See how the Security Desk works.

Original and primary sources

  1. StepSecurity — Microsoft agent-framework PyPI Package Compromised stepsecurity.io
  2. Wiz — Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines wiz.io
  3. Socket — Microsoft's agent-framework PyPI package Compromised with Credential Stealer socket.dev
  4. JFrog Security Research — Microsoft's agent-framework Hijacked on PyPI via Silent .pth Startup Hook research.jfrog.com
  5. OX Security — Hijacked releases of Microsoft's official agent-framework steal Azure and CI credentials ox.security
  6. PyPI — agent-framework project page pypi.org

Coverage and analysis

  1. Help Net Security — Credential stealer slipped into Microsoft's official Python agent framework helpnetsecurity.com