Microsoft Agent Framework PyPI Compromise Stole Cloud Credentials at Python Startup

Microsoft Agent Framework PyPI Compromise Stole Cloud Credentials at Python Startup
Two malicious releases of Microsoft's agent-framework package turned a trusted AI dependency into a software supply-chain credential-stealing channel.
Versions 1.26.1 and 1.26.2 were published to PyPI on November 17, 2026. They were removed within the hour, but removal does not undo an installation. The last known clean release is 1.26.0.
Why this package compromise matters
The package is a meta-package for Microsoft's Agent Framework, used to build and orchestrate AI agents in Python and Azure environments. Security researchers estimate roughly 196,000 monthly downloads across all versions, making it a high-value dependency even though the package itself mainly pulls in other framework components.
The malicious releases added a Python .pth startup hook. Python processes these files automatically when the interpreter starts, so the stealer ran before an application imported agent_framework. That changes the incident from “a vulnerable application dependency” into “a compromised execution environment.”
Version 1.26.1 used agent_framework_meta.pth and _telemetry.py. Version 1.26.2 changed the names to af_runtime_diag.pth and af_runtime_diag.py, which means a search for only the first set of filenames can miss the second release.
What the stealer targeted
The payload searched environment variables, other processes and credential files for secrets associated with Azure, AWS, GitHub, OpenAI, npm, PyPI, Docker, Hugging Face and CI systems. It also attempted to obtain Azure managed-identity and Azure DevOps OIDC tokens from the host.
The second release expanded collection to GitHub Actions OIDC material. In a workflow with id-token: write, that can turn a poisoned build into a path toward cloud access even when no long-lived cloud secret is stored in the repository.
Researchers observed the data being compressed and sent to an attacker-controlled webhook[.]site endpoint. Wiz reported that 50 requests were captured by the endpoint's free tier; 17 appeared to represent three successful victim exfiltration cases. That is not evidence that only three environments were affected—it is the visibility available from that endpoint.
What defenders should do now
- Find both versions everywhere. Search lockfiles, package caches, virtual environments, container layers, CI logs and internal mirrors for
agent-framework==1.26.1andagent-framework==1.26.2. Pin to 1.26.0 while validating a trusted fixed release. - Inspect Python environments. Look for
agent_framework_meta.pth,agent_framework_meta/_telemetry.py,af_runtime_diag.pthandaf_runtime_diag.pyundersite-packages. Starting Python in an affected environment should be treated as payload execution. - Assume reachable credentials were exposed. Revoke and rotate Azure tokens, Azure DevOps credentials, GitHub and GitHub Actions secrets, package-registry tokens, Git credentials, Docker credentials and any secrets available to the affected process.
- Review workload identity. Check Azure sign-ins, managed-identity activity, federated credentials and GitHub Actions runs from affected hosts. A stolen OIDC token can be more useful than a static secret because it may be exchanged for cloud access within the trust policy.
- Hunt for egress. Search DNS, proxy and firewall telemetry for the reported
webhook[.]siteendpoint and the user agentsaf-runtime-diagnostics/1andruntime-diagnostics/1. - Rebuild sensitive runners. If a production build agent, developer workstation with cloud access or release runner installed either version, isolate it and rebuild from a known-good image after rotation. Do not rely on uninstalling the package alone.
The larger lesson for AI dependency chains
Package removal is useful containment, but it is not remediation. The package ran through Python's startup mechanism, and the stolen material could include secrets belonging to the surrounding build or cloud environment. A privileged access review should therefore include package execution contexts, not only human administrator accounts.
Teams building AI agents should treat dependency resolution as part of the incident response boundary: preserve the lockfile and package hashes, identify every environment that resolved the bad versions, rotate credentials according to blast radius, and verify the trust policy for every workload identity the runner could use.
The immediate fix is to remove the compromised releases. The durable fix is to make a single poisoned package insufficient to reach the organization’s cloud, source-control and release systems.
Sources
- GitHub Advisory Database: malicious code in agent-framework
- Wiz: Microsoft agent-framework compromised
- Elastic Security Labs: agent-framework PyPI compromise analysis
- Microsoft Agent Framework issue tracking the malicious releases
References
FAQ
Two malicious releases of Microsoft's agent-framework package turned a trusted AI dependency into a software supply-chain credential-stealing channel.
The package is a meta-package for Microsoft's Agent Framework, used to build and orchestrate AI agents in Python and Azure environments. Security researchers estimate roughly 196,000 monthly downloads across all versions, making it a high-value dependency even though the package itself mainly pulls in other framework components.
Find both versions everywhere. Search lockfiles, package caches, virtual environments, container layers, CI logs and internal mirrors for agent-framework==1.26.1 and agent-framework==1.26.2. Pin to 1.26.0 while validating a trusted fixed release. Inspect Python environments. Look for agentframeworkmeta.pth, agentframeworkmeta/telemetry.py, afruntimediag.pth and afruntimediag.py under site-packages.