Microsoft's Official Python Agent Framework Compromised, Exposing CI/CD Credentials
On November 17, 2026, versions 1.26.1 and 1.26.2 of Microsoft's official `agent-framework` package on the Python Package Index (PyPI) were found to contain a credential-stealing payload. This malicious code was designed to execute during Python startup, without requiring an explicit import of the framework, making it particularly insidious. The payload targeted environment variables containing sensitive strings like `TOKEN`, `SECRET`, `AZURE`, `AWS`, and `GITHUB`, and also sought out credential files for various tools including Azure CLI, pip, npm, Git, Docker, and Hugging Face. Additionally, it attempted to request fresh Azure managed-identity and CI federation tokens, and in version 1.26.2, GitHub Actions OIDC tokens were added to its target list.
This incident is highly significant for any organization utilizing Microsoft's AI agent development toolkit, as well as the broader CI/CD community. The compromise of an official package with a wide reach (over 192,000 monthly downloads) underscores the vulnerability of even trusted software supply chains. Developers, QA teams, and platform engineers are directly affected, as their cloud and CI/CD credentials could be exfiltrated, leading to unauthorized access to critical infrastructure and sensitive data. The attacker's ability to publish a second malicious version after the first was quarantined further emphasizes the persistent threat and the need for vigilance.
This event fits into a broader, well-established trend of increasing software supply chain attacks. Recent years have seen a surge in malicious packages infiltrating public repositories like npm and PyPI, often exploiting compromised maintainer accounts or cleverly disguised malware. The industry has been grappling with similar attacks, such as the Shai-Hulud campaign, which spread malicious packages via a self-propagating worm. This incident serves as another stark reminder that traditional perimeter security is insufficient; organizations must adopt a 'shift-left' security approach, integrating robust supply chain security practices throughout the entire software development lifecycle.
In practice, organizations should immediately identify and isolate any hosts or CI/CD runners that installed `agent-framework` versions 1.26.1 or 1.26.2. It is crucial to rebuild from a clean base and pin the `agent-framework` version to 1.26.0. Furthermore, every secret reachable from affected hosts should be treated as compromised and rotated. Beyond simple rotation, teams must review OIDC permissions, federated credentials, and managed-identity role assignments, as rotating stored secrets will not revoke already-issued identity tokens. Implementing automated supply chain security tools that scan for malicious packages and verify build provenance is no longer optional but a critical defense mechanism.
Read original source