On November 17, 2026, Microsoft's official 'agent-framework' package on the Python Package Index (PyPI) was compromised in a sophisticated supply chain attack. Threat actors published two malicious versions, 1.26.1 and 1.26.2, which included a potent credential-stealing malware. The malware was designed to automatically execute upon Python interpreter startup and harvest a wide array of secrets from developer workstations and CI/CD environments, including credentials for Azure, AWS, GitHub, and more. The affected package, which is downloaded around 190,000 times per month, posed a significant risk to cloud and development infrastructure. The malicious versions were quickly removed from PyPI, but any user who installed them is considered compromised and must take immediate remediation steps.
This attack represents a classic example of software supply chain compromise, targeting a trusted, popular open-source package to distribute malware. The attackers managed to gain publishing rights to the official Microsoft 'agent-framework' project on PyPI, a toolkit for building AI applications.
The malicious payload was embedded within versions 1.26.1 and 1.26.2, which were live for only 33 minutes before being quarantined. The malware's activation mechanism was particularly insidious: it used a .pth file, a legitimate Python feature that allows code to be executed at interpreter startup. This means the malware ran automatically in any environment where the compromised package was installed, without needing to be explicitly imported into a project. To further evade detection, the malicious versions included the original, legitimate 'agent-framework' code, ensuring that developer applications would continue to function normally.
The core of the attack was the credential-stealing payload. It was designed to be comprehensive, targeting a wide range of sensitive information commonly found in developer and CI/CD environments.
~/.docker/config.json, ~/.npmrc, and Hugging Face config files for authentication tokens.This broad targeting indicates a clear intent to gain deep and persistent access to cloud infrastructure and software development pipelines. By stealing OIDC tokens, attackers could potentially impersonate CI/CD workflows to access production environments or poison other software artifacts. The method by which the attackers gained publishing access to the PyPI project is currently unknown but could involve compromised developer credentials or a flaw in the PyPI platform's account recovery process.
T1199 - Trusted Relationship (exploiting trust in PyPI and Microsoft) and potentially T1078 - Valid Accounts (compromise of a maintainer's account).T1059.006 - Python. The payload was written in Python.T1547.001 - Registry Run Keys / Startup Folder (the .pth file serves a similar purpose in the Python ecosystem) and T1140 - Deobfuscate/Decode Files or Information if the payload was obfuscated.T1552.001 - Credentials in Files, T1552.004 - Private Keys, and T1528 - Steal Application Access Token.The potential impact of this breach is severe. Developers and CI/CD systems that installed the malicious versions would have had their cloud and service credentials exfiltrated. This could grant attackers widespread access to:
Although the malicious packages were available for a short time, the high download rate of the package means a significant number of systems could have been compromised. The incident critically undermines trust in the security of open-source registries like PyPI.
agent-framework==1.26.1, agent-framework==1.26.2Security teams should hunt for signs of compromise in their development environments:
file_name*.pthsite-packages directories, inspect the contents of .pth files for suspicious code that executes on startup.network_traffic_patternlog_sourcefile_path.../site-packages/agent_framework/agent-framework versions 1.26.1 or 1.26.2 are present in any project's requirements.txt or lock files.~/.aws/credentials.D3-FA: File Analysis to inspect the contents of installed Python packages against a known-good manifest to detect unauthorized modifications.poetry.lock, pipfile.lock) which pin dependencies to specific versions with a hash. This prevents automatic updates to a newly published malicious version.D3-EAL: Executable Allowlisting principles by using a private package repository that vets and approves open-source packages before they are made available to internal developers.pip in its hash-checking mode (pip install --require-hashes -r requirements.txt) to ensure that the downloaded package matches the hash specified in your requirements file.Enforcing MFA on PyPI accounts is a critical step to prevent unauthorized publishing and account takeover.
Using dependency lock files with hashes prevents the automatic installation of new, potentially malicious package versions.
Auditing CI/CD logs and network traffic from build agents can help detect anomalous behavior like credential harvesting.
CI/CD pipelines should use short-lived, scoped credentials rather than static, long-term keys to minimize the impact of a compromise.
Malicious versions 1.26.1 and 1.26.2 of 'agent-framework' are published to PyPI within a 33-minute window.
The malicious packages are quarantined from PyPI, ending the direct distribution.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.
Help others stay informed about cybersecurity threats
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.