Summary
- Malicious versions 1.26.1 and 1.26.2 of Microsoft's agent-framework Python package were published to PyPI on 17 November and subsequently removed.
- The packages used Python startup files to execute credential-stealing code without developers needing to import the framework.
- Researchers recommend rebuilding affected environments, reviewing package caches and rotating potentially exposed Azure, Azure DevOps and GitHub Actions credentials.
Two malicious releases of Microsoft’s Agent Framework Python package have exposed a software supply chain weakness affecting developers building enterprise AI applications, with attackers using the legitimate package distribution channel to deliver code designed to steal cloud and development credentials.
The compromised versions, 1.26.1 and 1.26.2, were published to the Python Package Index on 17 November. They contained additional code that could execute automatically when Python started, even if a developer never imported the affected framework into an application.
Microsoft Agent Framework provides tools for developing applications that use AI agents to coordinate tasks and interact with external services. The malicious releases appeared under its established package name, making them available through ordinary dependency installation processes rather than through a separate, obviously suspicious project.
Both versions have since been removed from PyPI. However, organisations that installed them may still face exposure through credentials accessed during execution or copies of the malicious packages retained in internal repositories, container images and build caches.
A trusted package carried additional code
The attack targeted the distribution of a legitimate software dependency rather than attempting to persuade developers to install a previously unknown library. This distinction is important because businesses routinely retrieve external packages as part of software development and automated deployment.
Python developers can specify package dependencies for an application, while installation tools retrieve suitable versions from repositories such as PyPI. Automated systems may perform the same process when building containers, testing code or preparing software for release.
The malicious packages contained additional files that were absent from the earlier clean release, 1.26.0. Researchers found that the attacker had altered the package contents and republished them using the established project distribution route.
JFrog’s investigation indicates that the attacker repackaged a clean software distribution locally rather than producing the affected releases through Microsoft’s normal build process. The precise means by which the attacker obtained permission to publish them has not been conclusively established.
The first compromised version appeared at approximately 20:35 UTC on 17 November, with a second version following later that evening. Elastic Security Labs reported identifying suspicious activity within minutes of the initial publication, while other researchers subsequently analysed the affected files and their behaviour.
Early detection reduced the time available for further distribution, but the public reporting does not establish how many organisations installed the releases or how many credentials were successfully obtained.
Python startup allowed execution without an import
The attack relied on a feature of Python’s normal startup process. Files with the .pth extension can be processed when the interpreter initialises its environment, and certain entries within them can cause code to execute automatically.
The altered packages used that mechanism to activate a credential collection component. As a result, simply avoiding an explicit import of Agent Framework would not necessarily prevent the malicious code from running once an affected release had been installed in the environment.
This behaviour made the compromise relevant to more than applications actively using the framework’s functionality. An affected development workstation or build environment could execute the startup component during otherwise unrelated Python activity.
The two malicious versions used different file names and implementations. Version 1.26.2 introduced additional credential collection capabilities, including attempts to obtain tokens associated with GitHub Actions workflows.
Researchers identified collection activity involving local configuration files, environment variables and cloud authentication mechanisms. The targeted information included credentials associated with Microsoft Azure, Azure DevOps and software delivery environments.
Such credentials can provide access to services beyond the computer on which they are stored. Depending on their permissions, they may allow applications to retrieve information, modify infrastructure or interact with repositories and deployment systems.
The consequences of exposure therefore depend on which credentials were available and what privileges they carried. A narrowly restricted token may present a different risk from one capable of administering cloud resources or modifying software releases.
The malware’s ability to attempt collection does not prove that every affected installation contained usable secrets or that attackers subsequently gained access to the systems those credentials protected.
Automated development environments add exposure
Cloud and continuous integration systems frequently use temporary credentials to access software repositories, build services and deployment platforms. These arrangements allow automated work to proceed without requiring an employee to authenticate manually each time a task runs.
The convenience also creates a security dependency: software executed inside a build environment may be able to access information that the automation system needs to complete its assigned work.
Version 1.26.2 targeted additional information associated with GitHub Actions, including credentials used in workflows that obtain identity tokens for access to other services.
Whether those attempts succeeded would depend on the configuration of the affected workflow and the availability of the relevant credentials when the malicious component executed.
The attack demonstrates how a software dependency can create exposure beyond the final application it supports. A package installed during development may run inside systems holding permissions used to build, test or publish unrelated software.
Controls applied to a deployed AI agent cannot by themselves prevent credential theft from the infrastructure used to create it. The security of external dependencies, automated build systems and repository access forms a separate part of the software supply chain.
Removing releases does not restore compromised systems
Researchers have identified 1.26.0 as the last clean release preceding the two malicious versions. Both altered releases have been removed from the public package index, preventing normal new installations from retrieving them directly.
Organisations may nevertheless retain downloaded copies through local package caches, private dependency mirrors, previously built containers or stored build artefacts. Those copies could be used again unless they are identified and removed from affected workflows.
Investigators therefore recommend reviewing dependency records and the environments used during the exposure period. Where either malicious version was installed, rebuilding from verified packages may provide greater assurance than simply replacing the files within an existing environment.
Credential handling is another priority. If malicious code ran where secrets were available, those credentials may remain exposed even after the compromised package is removed.
Rotating potentially affected tokens and access keys can prevent their continued use, while reviewing cloud and development activity may help establish whether unauthorised actions occurred during or after the incident.
Security teams must also account for the differences between development workstations and automated build systems. A developer’s local machine may contain long-lived credentials, while a build runner could have received short-lived tokens whose permissions and subsequent use need separate investigation.
The public research does not establish a complete list of organisations affected or a verified count of successful downstream compromises. Remediation decisions must therefore be based on evidence from individual installations, rather than treating the framework’s overall download figures as a measure of victims.
AI development inherits established supply chain risks
Although the affected project is used to develop AI agents, the compromise did not require an attacker to manipulate an AI model or persuade an autonomous application to perform an inappropriate task.
Instead, the attackers exploited a conventional software distribution dependency, adding code that executed within the Python environment supporting development work.
The incident illustrates how established supply chain risks extend into AI engineering. Businesses using newer frameworks still depend on package publishers, build infrastructure and credential management arrangements whose security can affect the integrity of the resulting applications.
Verifying package provenance and controlling dependency updates can reduce exposure, although no single measure can eliminate the possibility of a legitimate distribution channel being compromised.
For organisations using Microsoft Agent Framework, the immediate priority is to identify whether either malicious release entered their systems, determine whether the startup code could have executed and assess the credentials available within those environments.
The public packages have been withdrawn, but the incident cannot be considered resolved for an individual organisation until affected installations, retained artefacts and potentially exposed access credentials have been examined.












