
Microsoft‘s official Agent Framework Python package was compromised in a supply-chain attack that exposed developers to Malware designed to steal passwords, API keys, cloud credentials and authentication tokens. Attackers published two malicious versions of the popular open-source package on the Python Package Index (PyPI), potentially putting developer machines, cloud environments and automated build systems at risk.
The compromised releases, versions 1.26.1 and 1.26.2, contained malicious code that could execute automatically when Python started, rather than waiting for developers to import or actively use the Agent Framework. This behaviour allowed the malware to operate in the background while the legitimate framework continued functioning.
The attack was detected and the affected releases were removed from PyPI within minutes. However, developers who downloaded either version may still face security risks because credentials and tokens could have been collected before the malicious packages were taken down.
The incident highlights the growing security challenges associated with software supply-chain attacks, particularly as developers increasingly depend on third-party Python packages to build AI applications and connect services to cloud infrastructure.
What Is Microsoft Agent Framework?
Microsoft Agent Framework is an open-source toolkit designed to help developers build AI agents and multi-agent applications. It provides components for creating AI assistants that can follow instructions, use external tools, interact with other agents and coordinate tasks to solve more complex problems.
These capabilities make the framework useful for developers experimenting with autonomous AI workflows, business automation and applications that require multiple AI agents to work together.
Like many Python development tools, the framework is distributed through PyPI, a widely used repository where developers can discover and install packages. Its growing adoption also makes the integrity of its official distribution channel particularly important.
The package had reportedly been attracting significant interest, with monthly downloads approaching 200,000. That level of adoption means a compromised release could reach developers working across different organisations, cloud platforms and production environments in a relatively short period.
How Attackers Hijacked the Microsoft Agent Framework Package
The incident involved two malicious releases published on November 17, 2026. Both versions were designed to steal sensitive information from systems where the package was installed.
Version 1.26.1 Introduced an Automatic Credential Stealer
The first compromised release, version 1.26.1, included an infostealer designed to execute during Python startup. Researchers reported that the malicious code used a Python .pth file, a mechanism that can cause code to run automatically when the Python interpreter initialises.
This approach made the attack particularly concerning. In a typical software infection, malicious functionality might remain inactive until a developer launches a particular application or imports a compromised module. In this incident, the malware could run even when the Agent Framework itself was not explicitly imported.
The attackers also retained a dependency on the earlier legitimate version, 1.26.0. As a result, the framework could continue operating normally while the malicious components carried out their activities in the background.
This combination of legitimate functionality and hidden malicious behaviour can make software supply-chain attacks harder to recognise. Developers may see their applications working as expected without immediately noticing that sensitive information is being collected.
Version 1.26.2 Expanded the Attack to GitHub Actions
PyPI detected and quarantined version 1.26.1 approximately 31 minutes after its publication. However, the incident did not end with the first removal.
About two minutes later, attackers published a second compromised release, version 1.26.2. This version expanded the malware’s capabilities by adding requests for GitHub Actions OIDC tokens and searches through GitHub runner directories.
The second release also raised questions about how the attackers retained access to Microsoft’s PyPI project after the first malicious version had been removed. The available information does not establish how the original account or publishing credentials were compromised.
PyPI removed the second malicious release approximately eight minutes after it was uploaded. Although both versions had relatively short exposure windows, their removal does not guarantee that every downloaded copy was harmless or that no credentials were stolen.
Which Credentials and Developer Platforms Were Targeted?
The malware was designed to collect a broad range of sensitive information from infected development environments. Rather than focusing on a single service, it targeted credentials and authentication material associated with several widely used developer and cloud platforms.
Reported targets included:
- Microsoft Azure: Credentials and managed identity access tokens that could potentially provide access to cloud resources.
- AWS: Authentication details and secrets associated with Amazon Web Services environments.
- GitHub: Developer credentials, repository-related secrets and GitHub Actions authentication tokens.
- OpenAI: API credentials that could be used to access connected AI services.
- Docker: Authentication information associated with container development and distribution.
- Hugging Face: Credentials connected to AI models, repositories and related developer services.
- Azure DevOps: OIDC tokens and other authentication material associated with development pipelines.
Researchers also reported that the malware searched environment variables, local configuration files and information associated with running processes. These locations are particularly valuable to attackers because developers frequently store API keys, cloud credentials and service tokens in them to support automated workflows.
The targeting of Azure managed identity access tokens and Azure DevOps OIDC tokens is especially significant. These authentication mechanisms are commonly used to allow applications and automated systems to access resources without relying on conventional passwords. If stolen, such tokens could potentially provide access to services within the permissions assigned to them.
However, the actual impact of any stolen credential depends on its validity, permissions, expiration and the security controls protecting the associated account.
How Many Developers Could Have Downloaded the Malicious Versions?
The exact number of affected developers remains unknown. The short period during which the malicious releases were available makes it difficult to establish how many installations occurred before PyPI removed them.
According to the download estimates cited in the original reporting, the package received approximately 6,900 downloads per day, equivalent to roughly 287 downloads per hour. Based on that rate, the two compromised releases may have been downloaded around 150 times during their combined availability.
This figure should be treated as an estimate rather than a confirmed victim count. Download statistics do not establish how many installations were completed, whether the malicious code executed successfully or whether credentials were successfully transmitted to the attackers.
It is also important to distinguish between package downloads and confirmed compromises. A developer who downloaded an affected version may have faced exposure, but further investigation would be necessary to determine whether the malware ran and whether sensitive information was accessed.
Security Researchers Identified the Malware’s Execution Mechanism
The incident was documented by several Cybersecurity companies and researchers, including Wiz, Aikido Security and Socket. Their findings helped identify how the malicious code was embedded in the package and how its execution mechanism changed between the two releases.
According to the technical analysis described by researchers, the first malicious version used a file named agent_framework_meta.pth to trigger the credential-stealing functionality during Python startup. The associated malicious code was located in agent_framework_meta/_telemetry.py.
The second release reportedly changed this arrangement. It restored the original package initializer while moving the malicious functionality into files named af_runtime_diag.pth and af_runtime_diag.py.
Changing the file structure between releases may have helped the attackers maintain or modify their execution method after the first version was detected. The use of Python startup files also meant that simply avoiding the framework’s normal application functions would not necessarily prevent the malicious code from running.
Researchers reported that both releases attempted to send harvested information to the same external server. The destination was identified in their analysis, but its presence alone does not establish which developers were successfully compromised.
What Should Developers Do If They Installed Version 1.26.1 or 1.26.2?
Developers who installed either affected release should treat the associated environment as potentially compromised. Removing the malicious package is an important first step, but it does not reverse credential theft or guarantee that the system has been cleaned.
Security teams should prioritise the following actions.
1. Remove the Affected Package
Check installed Python environments for Microsoft Agent Framework versions 1.26.1 and 1.26.2. Remove the compromised package and ensure that subsequent installations use a verified, unaffected release.
Do not assume that installing an older version automatically resolves the incident. If the malicious code already executed, sensitive information may have been collected before the downgrade.
2. Rotate Passwords, API Keys and Access Tokens
Assume that secrets accessible to the affected environment may have been exposed. This includes passwords, API keys, cloud credentials, personal access tokens, deployment secrets and other authentication material.
Revoke potentially exposed credentials and generate replacements. Where possible, prioritise credentials with access to production systems, cloud infrastructure, source-code repositories and automated deployment pipelines.
Rotating credentials is particularly important because deleting the malware does not invalidate secrets that may already have reached an attacker-controlled server.
3. Inspect Python Environments for Suspicious Files
Investigate the affected Python installation and virtual environments for unexpected files associated with the attack. Particular attention should be given to suspicious .pth files, including the filenames identified in the researchers’ analysis.
Security teams should also examine startup behaviour, unexpected processes, modified package files and unusual network connections. If the environment contains other unexplained changes, rebuilding it may be safer than attempting to clean it manually.
4. Review Azure, AWS and GitHub Activity
Check cloud and developer-platform accounts for suspicious authentication events, unexpected access requests, unfamiliar sessions and unusual resource activity.
For Azure and AWS, review identity activity and access to sensitive cloud resources. GitHub users should investigate repository access, token usage, workflow executions and unexpected changes to automation settings.
Any suspicious activity should be investigated alongside the affected credentials and systems rather than treated as an isolated login event.
5. Rebuild Potentially Compromised Development Environments
For systems where the malicious code executed, rebuilding from a trusted base image or clean environment is a prudent recovery measure. This is particularly important for shared development machines, CI/CD runners and automated build infrastructure.
Teams should also review dependency installation logs and software build records to identify where the affected versions were used. If the package was installed in GitHub Actions or another automated pipeline, investigate the runner and any secrets accessible to that workflow.
Why This PyPI Supply-Chain Attack Matters for AI Developers
The Microsoft Agent Framework incident illustrates a wider security problem facing modern software development. Applications increasingly depend on external libraries, packages and automated services. A compromised dependency can therefore expose more than the application that directly installs it.
AI development environments can be particularly sensitive because they often connect several services through API keys, cloud identities, model platforms and external tools. An AI agent application might rely on credentials for model access, data retrieval, storage, deployment and workflow automation. If a compromised dependency can access those secrets, the consequences may extend beyond a single development project.
The incident also demonstrates why package reputation and publisher identity should not be treated as complete security guarantees. Even an official package associated with a major technology company can become a distribution channel for malicious code if its publishing credentials or release process are compromised.
Organisations can reduce exposure by using dependency pinning, software composition analysis, package integrity checks, restricted build permissions and short-lived authentication tokens. Automated systems should receive only the permissions required for their tasks, while secrets should be kept out of environments that do not need them.
Developers should also monitor package releases and security advisories rather than assuming that an update from an established publisher is automatically safe.
Who Was Behind the Microsoft Agent Framework Attack?
As of the information available in the original reporting, no threat actor had publicly claimed responsibility for the compromise. The method used to gain access to Microsoft’s official PyPI publishing account also remained unknown.
Microsoft had not issued a public statement addressing the incident at the time of that reporting. Consequently, important questions remain unanswered, including how the attackers obtained publishing access, whether any credentials were successfully stolen and how many developers were affected.
The incident was detected quickly, and PyPI removed both malicious versions. Nevertheless, the short exposure period should not be mistaken for proof that the attack caused no damage.
What Developers Should Remember
The compromise of Microsoft’s Agent Framework package is a reminder that software supply-chain security must extend beyond application code to include the libraries, package repositories and authentication systems used throughout development.
Both malicious releases were removed from PyPI, but developers who installed versions 1.26.1 or 1.26.2 should not rely on removal or downgrading alone. They should investigate affected systems, rotate potentially exposed secrets, review cloud and repository activity, and rebuild compromised environments where necessary.
Until the full scope of the incident is established, treating affected installations as potentially compromised remains the safest approach.
For breaking news and live news updates, like us on Facebook or follow us on Twitter and Instagram. Read more on Latest Technology on thefoxdaily.com.

COMMENTS 0