JupiteX Get the app
Science & Technology18 Nov 2026 · about 7 min

Attackers Compromise Microsoft's Agent Framework PyPI Package to Steal Cloud Credentials

The brief

The most surprising effect was that installing the package made the stealer run at every Python start. The compromised releases, 1.26.1 and 1.26.2, placed startup files in the environment. This mattered because code could run without an application deliberately using agent-framework. For example, version 1.26.1 added agent framework meta.pth. That file referenced a module that launched the stealer. Python executes import lines in .pth files on interpreter startup, so the code could also run when starting tools such as pip. The malware gathered credentials, environment data, and cloud identity tokens, then sent collected information to a hard-coded endpoint. The article reports that PyPI quarantined both releases. It advises users to isolate affected hosts and runners, restore from a clean environment, and check whether they were exposed during the stated window on November 17, 2026. Exposed credentials should be rotated from a clean system, and Azure identities and logs should be reviewed. The article does not establish how many systems were affected.

01

What did the compromised versions of agent-framework do after they were installed?

The most surprising effect was that installing the package made the stealer run at every Python start. The compromised releases, 1.26.1 and 1.26.2, placed startup files in the environment. This mattered because code could run without an application deliberately using agent-framework.

For example, version 1.26.1 added agent_framework_meta.pth. That file referenced a module that launched the stealer. Python executes import lines in .pth files on interpreter startup, so the code could also run when starting tools such as pip. The malware gathered credentials, environment data, and cloud identity tokens, then sent collected information to a hard-coded endpoint.

The article reports that PyPI quarantined both releases. It advises users to isolate affected hosts and runners, restore from a clean environment, and check whether they were exposed during the stated window on November 17, 2026. Exposed credentials should be rotated from a clean system, and Azure identities and logs should be reviewed. The article does not establish how many systems were affected.

02

What is PyPI, and what does installing a Python package from it involve?

PyPI, the Python Package Index, is an online repository for Python packages. The article identifies it as the repository where agent-framework versions 1.26.1 and 1.26.2 were published and then quarantined. Developers use package-management tools to find and install packages from repositories such as PyPI.

In general, installing a Python package means downloading its distribution and placing its files in a Python environment, often along with required dependencies. In this case, each malicious release added a .pth file to the environment’s site-packages directory. That file mattered because Python ran its import line at interpreter startup, allowing the stealer to launch without an application importing agent-framework.

The article says the attacker’s method of obtaining publishing access is unclear. Both malicious releases were published 33 minutes apart on November 17, 2026, and PyPI had quarantined them as of writing. The incident shows why package identity and version matter: installing a specific release can place code in an environment, so users were advised to pin a safe version and restore from a clean environment.

03

How widely used is agent-framework, and why does its monthly download count matter?

The article says agent-framework attracts about 190,000 downloads a month. It is the meta-package for Microsoft Agent Framework, an open-source framework for building and orchestrating AI agents with Python. That makes its download count a measure of how widely developers obtain the package, not a count of unique users or affected systems.

The malicious versions, 1.26.1 and 1.26.2, were published 33 minutes apart. Each added a Python startup hook that could run the stealer whenever Python started. A package with substantial download traffic can be an attractive target because a compromised release may reach many development environments or build runners. The article does not say how many downloads were for those two releases.

The monthly figure therefore signals potential exposure, not confirmed infections. The releases have been quarantined on PyPI, and users were advised to check whether their environments received them during the exposure window. Organizations should investigate package versions and relevant logs rather than assume every monthly download involved a malicious release.

04

What credentials and cloud identity tokens did the malware seek, and what could an attacker gain from them?

The stealer searched environment variables and credential files, including Azure CLI data, .npmrc, pip.conf, .netrc, Git credentials, Docker configuration, Hugging Face files, and .env and JSON files. It also sought Azure DevOps OIDC tokens, Azure managed-identity tokens, Azure instance metadata, and, in version 1.26.2, GitHub Actions OIDC tokens. These could expose access credentials or information about the cloud environment.

The malware could also ask platforms to issue new tokens. In an Azure DevOps pipeline, the article says SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI could be used to request a federated token. On Azure compute, the code queried managed-identity endpoints for access tokens. It compressed and encoded the collected data before sending it to a hard-coded endpoint.

An attacker holding usable credentials or tokens could potentially act with the access those credentials grant, including reaching cloud resources or connected services. The actual access would depend on each identity’s permissions; the article does not report specific misuse. It advises rotating exposed credentials from a clean system and auditing Azure identities, sign-in and activity logs, and GitHub Actions workflows that deploy to Azure.

05

What is a Python .pth file, and how did it make the stealer run even when agent-framework was not imported?

A Python .pth file is a text file placed in a site-packages directory. As general Python behavior, startup processing reads these files, and import lines in them are executed when Python starts. The article highlights that mechanism as the way the compromised package made its payload run automatically.

Version 1.26.1 added agent_framework_meta.pth, which contained an import statement referring to agent_framework_meta; that module launched the stealer. Version 1.26.2 instead added af_runtime_diag.pth and imported a new top-level module called af_runtime_diag.py. Because the hook ran at interpreter startup, the stealer could run even when an application never imported agent-framework. The article notes it could run when starting pip, too.

This behavior made the malicious code broader than a feature triggered only by using the package. The releases were quarantined on PyPI, but affected environments still needed investigation. The article recommends isolating affected hosts and runners, restoring from a clean environment, checking exposure during the stated window, and rotating any exposed credentials.

06

Why can cloud identity tokens give code running in a build pipeline access to cloud resources?

Cloud identity tokens are credentials that let software act as an identified user or service. As general background, a cloud platform can use a valid token to decide which resources that identity may access. A token does not automatically grant unlimited access; the available actions depend on the identity’s permissions and the platform’s rules.

The article gives a concrete Azure DevOps example: SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI can be enough to request a federated token for api://AzureADTokenExchange. On Azure compute, the malware asked managed-identity endpoints for access tokens, using the configured endpoint or the local metadata address. It also sought GitHub Actions OIDC tokens in version 1.26.2.

If malicious code running in a build pipeline obtains a usable token, it may be able to access cloud resources available to that pipeline identity. That is why token theft can matter even when secrets are not stored in files. The article advises auditing Azure identities, reviewing sign-in and activity logs, and checking GitHub Actions workflows that deploy to Azure. It does not specify what permissions any exposed token had.

07

How does trusting third-party packages create a software supply-chain risk for the people and systems that install them?

A software supply chain includes the external packages and tools that people rely on to build and run software. As general background, trusting a third-party package means accepting that its published code may execute in the environment where it is installed. If a package release is compromised, that trust can carry malicious code into developers’ machines, automated build runners, or cloud-connected systems.

In this incident, attackers published malicious agent-framework versions 1.26.1 and 1.26.2. The releases added .pth startup hooks that ran a credential stealer whenever Python started, even without an explicit package import. The malware sought files, environment variables, and cloud identity tokens, then sent collected data to an endpoint. The article says how the attacker obtained publishing access is unclear.

Agent-framework attracts about 190,000 downloads a month, although that does not mean all downloads were of malicious versions or that all users were affected. Both releases were quarantined on PyPI. The article recommends checking exposure, restoring from a clean environment, rotating exposed credentials, and auditing cloud identities and deployment workflows. It also notes a separate compromise of Microsoft’s durabletask package in May 2026.

This brief was written by AI from the original reporting and checked by other models. Names, figures and quotes come from the source; read it for full context.

Read more in the JupiteX app

Pulse is free. New stories every 4 hours, each one broken into the questions that explain it.

Or read more news on the web