Two malicious versions of Microsoft’s official agent-framework package were uploaded to the Python Package Index (PyPI) on November 17, 2026, exposing developers to a sophisticated credential-stealing campaign. The affected releases, versions 1.26.1 and 1.26.2, were identified by researchers at StepSecurity, OX Security, and Socket. These versions were designed to execute a malicious payload automatically upon the startup of the Python interpreter, regardless of whether the framework itself was explicitly imported by the user.
The malicious code functioned by installing a .pth startup hook, a mechanism that triggers execution during the Python initialization process. In the first compromised release, version 1.26.1, the hook was easily identifiable. By the time this version was quarantined by PyPI, the attacker had already published version 1.26.2, which attempted to evade detection by restoring the original package initializer and moving the malicious hook into a file named af_runtime_diag.pth. Despite these modifications, both versions maintained a dependency on the legitimate agent-framework-core 1.26.0, ensuring the framework functioned normally while the background exfiltration occurred.
The scope of the data theft was extensive. The malware was programmed to harvest environment variables containing sensitive keywords such as AZURE, AWS, GITHUB, TOKEN, and SECRET. Furthermore, the script scanned the environments of up to 300 active processes and exfiltrated .env files, along with credential stores associated with Docker, Git, npm, pip, and the Azure CLI. The stolen data was compressed and encoded before being transmitted to an external webhook.site endpoint.
Beyond static credentials, the malware actively attempted to generate new access tokens. Researchers observed the code requesting fresh Azure managed-identity tokens and CI federation tokens. Version 1.26.2 specifically expanded this capability to include the solicitation of GitHub Actions OIDC tokens. While security analysts confirmed that the code attempted these requests, it remains unverified whether the attacker successfully obtained valid tokens from these cloud services.
The incident highlights a significant vulnerability in the trust model of software supply chains. Because the malicious code executed immediately upon Python startup, the compromise was effective the moment the package was installed, often before a developer even utilized the framework. The ability of the malware to request new tokens from cloud providers effectively turned build environments into a persistent credential, meaning that simply rotating existing passwords may be insufficient for remediation.
Microsoft has not publicly disclosed how the attacker gained the necessary permissions to publish these malicious updates to the official repository. PyPI has since quarantined both compromised versions. Security experts advise that the last known secure release is version 1.26.0, and users are urged to pin their dependencies to this version to avoid the malicious updates.
Organizations that installed either version 1.26.1 or 1.26.2 are advised to treat all secrets reachable from the affected hosts as compromised. Remediation efforts should extend beyond mere password rotation; teams must also audit and revoke OIDC permissions, federated credentials, and managed-identity role assignments that may have been abused during the window of exposure.
To mitigate the risk of similar supply chain attacks, security professionals recommend implementing stricter controls over dependency management. Best practices include pulling packages from internal, curated mirrors rather than directly from public repositories, enforcing short-lived credentials for build jobs, and utilizing ephemeral environments that are destroyed after each task. Additionally, restricting outbound network traffic from build systems to a strictly defined allowlist can prevent exfiltration even if a malicious package is inadvertently installed.





