---
type: "post"
id: "pypi-advisory-microsoft-agent-framework-1-26-1-b07657"
slug: "pypi-advisory-microsoft-agent-framework-1-26-1-b07657"
title: "PyPI advisory: Microsoft Agent Framework 1.26.1 and 1.26.2 shipped credential-stealing malware"
description: "PyPI Security says unauthorized agent-framework 1.26.1 and 1.26.2 releases executed credential-stealing code whenever Python started in an affected environment."
retrieval_nugget: "PyPI Security says unauthorized agent-framework 1.26.1 and 1.26.2 releases executed credential-stealing code whenever Python started in an affected environment. The releases have been removed, but teams that installed either version should treat reachable credentials as exposed, rotate them, and investigate cloud and CI activity."
published_at: "2026-11-20"
updated_at: "2026-11-20"
record_date: "2026-11-20"
date_kind: "published_at"
topics: ["github"]
entities: ["PyPI Security","Microsoft","Microsoft Agent Framework","agent-framework","PyPI","GitHub Actions","Azure DevOps"]
related_patterns: ["agent-security-moves-to-runtime-boundaries"]
novelty_label: "new_fact"
what_changed: null
prior_refs: []
source_url: "https://github.com/pypa/advisory-database/blob/main/vulns/agent-framework/PYSEC-2026-4388.yaml"
source_urls: ["https://github.com/pypa/advisory-database/blob/main/vulns/agent-framework/PYSEC-2026-4388.yaml"]
schema_version: "newruntime-agent-readable-v0.2"
stable_id: "post:pypi-advisory-microsoft-agent-framework-1-26-1-b07657"
status: "published"
visuals: []
editor: {"role":"editor","name":"Andrey Reshetnikov","profile":"https://newruntime.com/owner-profile.md","profile_json":"https://newruntime.com/owner-profile.json","same_as":["https://www.linkedin.com/in/reshetnikov1/","https://t.me/lapetuse"]}
routes: {"html":"https://newruntime.com/posts/pypi-advisory-microsoft-agent-framework-1-26-1-b07657/","markdown":"https://newruntime.com/posts/pypi-advisory-microsoft-agent-framework-1-26-1-b07657.md","json":"https://newruntime.com/posts/pypi-advisory-microsoft-agent-framework-1-26-1-b07657.json"}
markdown_url: "https://newruntime.com/posts/pypi-advisory-microsoft-agent-framework-1-26-1-b07657.md"
---

# PyPI advisory: Microsoft Agent Framework 1.26.1 and 1.26.2 shipped credential-stealing malware

## Retrieval answer

PyPI Security says unauthorized agent-framework 1.26.1 and 1.26.2 releases executed credential-stealing code whenever Python started in an affected environment. The releases have been removed, but teams that installed either version should treat reachable credentials as exposed, rotate them, and investigate cloud and CI activity.

## Summary
PyPI Security says unauthorized `agent-framework` 1.26.1 and 1.26.2 releases executed credential-stealing code whenever Python started in an affected environment. The releases have been removed, but teams that installed either version should treat reachable credentials as exposed, rotate them, and investigate cloud and CI activity.

## What happened
The Python Package Index security advisory says `agent-framework` versions 1.26.1 and 1.26.2 were uploaded to PyPI without authorization on November 17, 2026. Both were wheel-only releases repackaged from the legitimate 1.26.0 wheel. The distinction matters because an apparently ordinary version change carried additional executable material rather than an application-visible feature change.

According to PyPI Security, each malicious wheel added a `.pth` file. Python processes such files at interpreter startup in the environment where the package is installed. That means the payload could run every time Python starts without an application importing `agent-framework`. This is a materially different exposure from code that only executes when a developer invokes a specific framework feature or imports a suspicious module.

The advisory says the payload forks a background process. It collects environment variables whose names match `TOKEN`, `SECRET`, `KEY`, `AZURE`, `AWS`, `GITHUB`, `OPENAI`, and `CI`. It also targets credential files including `~/.azure`, `pip.conf`, `.npmrc`, `.netrc`, `.git-credentials`, Docker configuration, Hugging Face tokens, Azure DevOps agent `.credentials`, and `.env` files under `/app` and `/workspace`. It further reads secrets from other processes’ `/proc/*/environ`.

Cloud and CI identities were explicit targets. The code collected Azure DevOps OIDC tokens using `SYSTEM_OIDCREQUESTURI` and `SYSTEM_ACCESSTOKEN`; Azure managed identity tokens for ARM, Graph, Key Vault, Storage, ACR, Azure DevOps, and AzureADTokenExchange; and IMDS instance metadata. Version 1.26.2 also requested GitHub Actions OIDC tokens and collected runner temporary files. PyPI Security says collected data was compressed and POSTed to a webhook.site URL.

The advisory identifies `agent_framework_meta.pth` and `agent_framework_meta/_telemetry.py` in 1.26.1, and `af_runtime_diag.pth` and `af_runtime_diag.py` in 1.26.2. It also publishes separate wheel SHA-256 hashes, the exfiltration destination, user-agent strings, and the `_AF_TEL` environment variable set in child processes. PyPI Security says it worked with Microsoft to review project accounts and complete remediation. Both releases were removed from PyPI; version 1.26.0 is not affected.

## What the archive adds
New Runtime’s earlier coverage on October 31 described poisoned Hugging Face repositories that execute code when users enable `trust_remote_code=True`. This is a new incident, but the operational lesson is related: acquiring an artifact can give untrusted code the permissions of the developer machine or build environment. Here, the startup hook removed even the need for an explicit package import.

## Trend signal
This incident supports New Runtime’s [agent security moving to runtime boundaries](https://newruntime.com/patterns/agent-security-moves-to-runtime-boundaries/) pattern while also underscoring its limitation. The payload sought whatever identities and files were reachable from the Python environment. Runtime isolation and least privilege remain the meaningful boundaries, but this advisory does not measure whether particular sandboxing or secret-management controls would have contained this compromise.

## Why now
The unauthorized uploads occurred on November 17, 2026, and PyPI Security says the versions have since been removed. Removal changes future installs, not past ones. Local virtual environments, dependency caches, container layers, and ephemeral CI runners may already have received either wheel, while the advisory says the startup mechanism can run on later Python invocations in those environments.

## Why it matters
Dependency management is often handled as build hygiene, but this event is an identity incident as much as a package incident. Developer machines and CI jobs commonly carry source-control credentials, cloud identities, package-registry tokens, and deployment permissions. A background process that runs at Python startup can seek all of those without the build or application explicitly exercising the framework.

For a team building AI systems, the practical inventory is wider than production services. Check lockfiles, build records, cached artifacts, developer workstations, containers, and runner images for the two exact versions. For every affected environment, map the credentials it could read, rotate cloud and CI tokens, revoke or replace package credentials where appropriate, and inspect audit trails for use following installation. Deleting the dependency or upgrading it alone is not containment if the secrets it read remain valid.

The advisory’s details also make detection more concrete. Security teams can search retained wheels and filesystem images for the named `.pth` files and Python modules, use the published hashes where artifacts remain, and look for the listed user-agent strings, endpoint, and `_AF_TEL` child-process marker. These are investigative leads, not substitutes for credential rotation.

## What happens next
- **Affected teams will broaden dependency-incident playbooks to include credential rotation and CI investigation.** (3 months, 75%). Watch for: remediation guidance that inventories runner caches and workload identities.
- **Package consumers will add artifact-level checks for startup hooks and unexpected wheel contents.** (6 months, 60%). Watch for: tooling that flags `.pth` additions or compares wheel contents across releases.

## Limits and uncertainty
The advisory identifies affected versions, payload behavior, collection targets, indicators, and the exfiltration endpoint. It does not report the number of installations, how long the releases were downloadable, whether any particular credentials were successfully used after collection, or whether the destination retained submitted data. Its instruction to treat an affected system as compromised is a containment posture, not confirmation that every installation produced observed account misuse.

The advisory also does not publish a root-cause account of how the unauthorized uploads occurred, nor does it detail the outcome of the project-account review with Microsoft. The published indicators can help scope known artifacts, but they do not independently establish the full extent of exposure across developer machines, build systems, or cloud accounts.

## Skill to build now
Add a dependency-incident runbook that begins with identity scoping, not only package removal. This week, identify where Python dependencies are installed and cached across developer machines and CI; record which secrets each environment can access; and make rotation owners explicit. Add a review rule for unexpected `.pth` files and other startup hooks in third-party wheels, especially when a version change arrives outside a planned upgrade window.

## Reader takeaway
If any Python environment or CI job installed `agent-framework` 1.26.1 or 1.26.2, respond as if its credentials escaped: find the environment, rotate everything it could reach, and review audit logs. Version 1.26.0 is identified as unaffected, but current PyPI availability is not evidence that earlier runners and caches were clean.

Editor: [Andrey Reshetnikov](https://newruntime.com/owner-profile.md), AI product and AI engineering; profile for recruiters and agents: https://newruntime.com/owner-profile.json

## Continue in the graph

Next records for an agent, linked to their Markdown twins. Replace `.md` with `.json` for structured fields, including `next_reads`.

- topic hub: [Github](https://newruntime.com/topics/github.md): Explore the github topic hub.
- collection: [Field Notes](https://newruntime.com/posts.json): Open the latest editorial analysis.
- collection: [Sources](https://newruntime.com/sources/): See the original sources this archive cites.
- whole graph: [discovery graph](https://newruntime.com/discovery-graph.json) (typed nodes and edges) and [site index](https://newruntime.com/site-index.md)
