DEV Community

Cover image for Microsoft's AI Framework Was Real. Its Python Package Update Contained a Credential Stealer.
inclinq_Founder
inclinq_Founder

Posted on

Microsoft's AI Framework Was Real. Its Python Package Update Contained a Credential Stealer.

Two malicious releases on PyPI targeted cloud and development credentials. The dangerous part was that the code could run before developers even used the framework.

November 18, 2026

A Microsoft software package sounds like something you should be able to trust.

Especially when you're installing it to build AI agents.

But on November 17, two versions of the legitimate Microsoft Agent Framework Python package were published with malicious code designed to steal credentials.

The affected versions were agent-framework 1.26.1 and 1.26.2.

They appeared on PyPI, the package registry used by Python developers around the world.

Both have now been removed.

But the attack revealed something more troubling than an infected software update.

The malware didn't need developers to use the AI framework. Starting Python in the affected environment could be enough.

How the Attack Worked

Microsoft Agent Framework is designed to help developers build AI agents and applications.

To use it, developers install a Python package along with other dependencies.

On November 17, version 1.26.1 of the official agent-framework package appeared at 20:35 UTC.

Another release, 1.26.2, followed at 21:08 UTC.

Both contained malicious functionality.

Researchers identified a Python startup-hook mechanism using .pth files in the installed environment.

These files can cause code to run when the Python interpreter starts.

Instead of waiting for an application to import the compromised package, the attacker used Python's initialization process.

That meant a developer could encounter the malicious code during ordinary development activity.

The package itself didn't need to be called by the application.

What Information Was Targeted?

The malware attempted to gather sensitive information available to the affected environment.

That included:

  • Azure authentication material and cloud identity tokens
  • GitHub credentials and workflow-related secrets
  • API keys stored in environment variables
  • Credentials used by package registries and development tools
  • Configuration files containing potentially sensitive information

The purpose was to transmit collected data to an attacker-controlled endpoint.

This is especially significant in modern AI development.

A single development environment may hold credentials for multiple external services.

An AI application might connect to a model provider, a GitHub repository, a database and a cloud platform.

If credentials for those services are accessible to malicious code, the potential impact may reach beyond the original application.

However, the number of successful credential thefts has not been established publicly.

What Was Actually Compromised?

This was a supply-chain incident involving the distribution of a legitimate Python package.

It was not evidence that every Microsoft AI product had been compromised.

Nor does it mean ordinary Windows, Outlook or Microsoft 365 users were directly affected.

The known malicious versions were 1.26.1 and 1.26.2.

Version 1.26.0 was the last known clean release identified in the security advisory.

Both malicious releases have been removed from PyPI.

For developers who installed them, though, removal from the registry does not resolve possible exposure on their machines or build systems.

How to Check Whether You're Affected

If you use Microsoft Agent Framework, check your dependency lockfiles, build logs and package inventories.

Look specifically for versions 1.26.1 and 1.26.2.

Do not begin by running Python or pip commands inside an environment you suspect has the malicious startup hook.

Use a trusted environment or offline inspection methods.

If either affected version was installed, isolate the environment.

Rebuild it from a trusted source and investigate any suspicious startup-hook files.

Rotate or revoke credentials that the compromised environment could access.

This may include cloud credentials, GitHub tokens, API keys and automated build secrets.

Review authentication logs and relevant network activity for signs of unauthorized access.

Simply deleting the malicious package doesn't undo a possible credential leak.

The Trust Problem Behind AI Development

Most conversations about AI security focus on the model.

Can it leak private information?

Can someone manipulate its instructions?

Can it take actions beyond what the user intended?

Those are legitimate questions.

But this incident points to another layer of risk.

Before any AI model runs, developers install software that makes the application possible.

That software may have access to powerful credentials long before the AI agent performs its first task.

In this case, the package name was legitimate. The project was genuine. The distribution channel was widely used.

And malicious code was still delivered.

The interesting question isn't just how these two versions appeared.

It's how much access a routine software dependency can have to the information that keeps an entire development environment running.

If we are building increasingly autonomous AI systems, shouldn't the software beneath them face at least as much scrutiny as the models themselves?


Sources

GitHub Security Advisory — GHSA-764m-3ppc-5m73

https://github.com/advisories/GHSA-764m-3ppc-5m73

Microsoft Agent Framework — GitHub Issue #10411

https://github.com/microsoft/agent-framework/issues/10411

Wiz — Microsoft Agent Framework PyPI Investigation

https://www.wiz.io/blog/malicious-version-of-microsofts-agent-framework-published-to-pypi

StepSecurity — Technical Analysis

https://www.stepsecurity.io/blog/microsoft-agent-framework-pypi-package-compromised

Top comments (0)