PARAS MADAN
All writing

Latest in AI

Microsoft Agent Framework PyPI Compromise: Check Versions 1.26.1 and 1.26.2

The malicious releases can run at Python startup without an import. Check build history and exposed identities before treating a package downgrade as recovery.

Security researchers identified credential-stealing code in versions 1.26.1 and 1.26.2 of Microsoft's agent-framework Python package, published on November 17. The important response detail is that the payload can execute when Python starts. Not importing Agent Framework does not establish that an affected environment was safe.

This guide summarizes the published analyses and a defensive response sequence. I have not downloaded or executed the malicious packages. It does not establish whether any particular reader's system was affected.

Check the resolved version, not just today's installation

Wiz's analysis dates the uploads to approximately 20:35 UTC for 1.26.1 and 21:08 UTC for 1.26.2. Both were subsequently removed from PyPI. Wiz identifies 1.26.0 as the preceding clean release, while saying the compromise's root cause had not been confirmed.

Search retained lockfiles, dependency-resolution logs, build records and image inventories for the two affected versions. Include failed jobs and short-lived runners. A clean current environment does not show what a discarded CI job installed last night.

Write down the affected environment, installation time, subsequent jobs and identities available there. This gives the response team a concrete scope instead of a single yes/no answer about whether the package exists today.

Avoid starting Python to inspect a suspect environment

The attack uses executable startup hooks in site-packages. Python's site-module documentation explains that executable startup lines can run regardless of whether an application uses the corresponding module.

That makes familiar diagnostic commands a poor first move on a suspect host. python -m pip starts Python too. Stop affected jobs and have your security team inspect a preserved filesystem or image from a clean analysis environment rather than importing the package to check its version.

The published indicators include these file pairs:

ReleaseStartup hookPayload file
1.26.1agent_framework_meta.pthagent_framework_meta/_telemetry.py
1.26.2af_runtime_diag.pthaf_runtime_diag.py

Use the full hashes and indicators in the linked research for exact matching. Finding neither filename after cleanup does not erase earlier execution, and finding a similarly named file alone should lead to inspection rather than an unsupported conclusion.

Scope credentials beyond stored API keys

OpenSourceMalware's artifact analysis describes collection from environment variables, credential files and other processes' environments. It also describes requests for fresh cloud and CI identity tokens, including GitHub Actions, Azure DevOps and Azure managed identities.

For an affected runner, review both stored secrets and the permissions attached to its workload identity. A job can have useful cloud access without a long-lived secret in its configuration. Inventory what it could reach, not only the values visible in a settings page.

Treat confirmed installation as an incident requiring containment and credential review. Coordinate revocation or rotation from a clean system, preserve relevant access logs, and investigate use of exposed identities. Merely deleting a virtual environment cannot revoke a token that has already left it.

A top-level pin is not a complete recovery plan

SafeDep's November 18 update raises a separate concern about publishing access across related packages. Its analysis notes that the 1.26.0 metapackage depends on a core extra that accepts ranges for several companion packages. It does not establish that every related package is malicious.

The practical implication is to review the complete resolved dependency set, not treat one top-level version pin as a guarantee about a fresh installation. Rebuild affected environments from reviewed artifacts and a known dependency record after addressing identity exposure. Do not simply substitute an unfamiliar fork or trust a newly published version without checking the incident guidance.

Keep three recovery outcomes separate: the malicious artifact is no longer present, exposed access has been addressed, and the rebuilt application passes its checks. A successful build proves only the last of those. Closing the incident requires evidence for all three.

I'm Paras. I work at the intersection of AI, engineering and distribution.

I help developer-tool teams turn security incidents and technical changes into clear, actionable guidance.

Book a 30-minute call.