Rapid alert3 min read

Microsoft agent-framework 1.26.1 and 1.26.2 on PyPI stole Azure and CI credentials on every Python start

Two malicious releases of Microsoft's agent-framework meta-package landed on PyPI on 17 Nov within 33 minutes. A .pth startup hook ran a credential stealer on every Python launch, targeting Azure, Azure DevOps and GitHub Actions secrets. Pin 1.26.0 and rotate.

agent-framework rapid alert: Built AI agents with Azure creds? Any Python start leaked your tokens.
The rapid alert card: save it and share it with your team

What happened

On 17 November 2026, two malicious versions of Microsoft's agent-framework PyPI package were published: 1.26.1 and 1.26.2. Both carried a credential stealer. The package is the meta-package for Microsoft's Agent Framework for Python, so the machines most likely to install it are the ones holding Azure credentials worth stealing.

The malware installs as a Python .pth startup hook in site-packages. Python's site module reads .pth files on every interpreter start and runs any line beginning with import. That means the stealer fires whenever Python starts in that environment, even if nothing ever imports agent_framework. Running pytest, a build script, or pip itself is enough.

The releases were uploaded through the project's legitimate Microsoft publisher credentials, as a wheel only, with no trusted-publishing provenance and the user-agent RestSharp/106.13.0.0. There is no matching python-1.26.1 tag or malicious code in the GitHub repository. How the credentials were obtained is not confirmed.

Timeline

  • 12 Nov 18:25 UTC: clean 1.26.0 published (wheel plus sdist).
  • 17 Nov 20:35:20 UTC: malicious 1.26.1 uploaded.
  • 17 Nov 21:06:16 UTC: 1.26.1 quarantined by PyPI.
  • 17 Nov 21:08:39 UTC: malicious 1.26.2 uploaded, about 2 minutes 23 seconds after the first quarantine.
  • 17 Nov 21:16:44 UTC: 1.26.2 quarantined.

The attacker's publishing access survived the first quarantine. That does not confirm the access remains available now.

Am I affected?

You are exposed if you installed agent-framework 1.26.1 or 1.26.2 between about 20:35 and 21:20 UTC on 17 Nov, directly or through a loose requirement like agent-framework>=1.26.

CI is where this hurts most. A pipeline or container build that resolved a fresh install during the window ran the stealer with whatever the job could reach. On Azure DevOps that means SYSTEM_ACCESSTOKEN and service connections. On GitHub Actions, 1.26.2 targets the OIDC token any workflow with id-token: write can request. Developer laptops and Azure VMs with a managed identity attached are exposed too.

The two versions leave different files behind. Checking only for 1.26.1's filenames will miss 1.26.2, which restored the legitimate initializer byte-for-byte and moved its code to a top-level af_runtime_diag.py.

What to do now

  1. Isolate any host or runner that installed either version before starting Python or pip on it.
  2. Search lockfiles, CI logs, virtualenvs, container images and package caches built since 17 Nov for 1.26.1 or 1.26.2.
  3. Look in site-packages for agent_framework_meta.pth and agent_framework_meta/_telemetry.py (1.26.1), or af_runtime_diag.pth and af_runtime_diag.py (1.26.2). Any Python process started there ran the payload.
  4. Rebuild from a clean base image or dependency set and pin agent-framework==1.26.0, the last clean release.
  5. From a clean system, rotate every secret the environment could reach: Azure CLI sessions, Azure DevOps PATs and service connections, Azure service principal credentials, GitHub, npm, PyPI, NuGet, Docker and Hugging Face tokens, and git credentials.
  6. Audit Azure sign-in and activity logs for managed identities and federated credentials reachable from affected VMs, App Services, AKS nodes or ADO pipelines. Stolen managed-identity and OIDC-exchanged tokens are valid for up to 24 hours.
  7. For GitHub Actions jobs that installed 1.26.2 with id-token: write, check Entra ID trust settings and sign-ins for the linked application.

How to hunt

Search proxy and DNS logs for webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb (path ?t=telemetry). A 200 response means that host's data was accepted. A 410 or 429 suggests it was rejected: the free-tier endpoint caps at 100 requests. A domain connection alone does not confirm exfiltration.

Look for exfil user-agents af-runtime-diagnostics/1 (1.26.1) and runtime-diagnostics/1 (1.26.2), and for the run-once marker _AF_TEL=1. There is no persistent on-disk execution marker, so a fresh process tree can trigger collection again.

What does not help

Removing the package stops future runs but does not undo anything already sent. PyPI quarantine does not remove copies already installed or cached. Searching only for 1.26.1's filenames misses 1.26.2.

Sources

Drafted with the help of AI, then checked, edited and approved by Marcus Lenngren, who takes editorial responsibility for it.

More from us