Malicious Agent Framework PyPI Packages Steal Credentials
Malicious agent-framework PyPI versions 1.26.1 and 1.26.2 stole Azure, GitHub Actions, and CI credentials via .pth startup hooks.

Malicious Microsoft Agent Framework Releases Steal Azure and GitHub Credentials
Two malicious releases of Microsoft's Python Agent Framework package were published to PyPI on November 17, adding credential-stealing code that executed during Python startup. The affected versions, 1.26.1 and 1.26.2, were removed from the package index, but installations and cached copies may remain.
The incident is especially dangerous because the payload did not need an application to import Agent Framework. It used Python's .pth startup mechanism, which can execute import statements whenever an interpreter initializes in an environment containing the malicious files.
Microsoft's project maintainers confirmed that both versions had been pulled and said the issue was under investigation. The publishing-access compromise and its entry point have not been publicly established.
Two malicious releases in 33 minutes
PyPI release records and security researchers place the first malicious wheel, agent-framework 1.26.1, at 20:35 UTC on November 17, 2026. A second release, 1.26.2, appeared at 21:08 UTC—roughly 33 minutes later.
Both releases were distributed as wheels, without the source distributions that accompanied earlier releases. Researchers report that the malicious additions were absent from the project's public source repository and that the releases did not match the normal release pattern. Those discrepancies suggest the packages may have been uploaded outside the ordinary build process, but do not establish how the publishing account or credential was compromised.
The second release was published after the first had been removed. It renamed the startup files and expanded the credential collection, illustrating that removing one malicious version did not immediately stop the party with publishing access.
Microsoft's Agent Framework maintainer said in the project's GitHub issue that the compromised versions had been pulled and that the team was actively investigating.
Why importing the package was not required
The payload used .pth files placed in Python's site-packages directory. Python's official documentation explains that executable lines in these path-configuration files are run at interpreter startup. This behavior is intended for limited initialization tasks, but it means a malicious import line can run before a developer's own program begins.
In version 1.26.1, researchers identified agent_framework_meta.pth and a helper module under agent_framework_meta. The second version, 1.26.2, changed the names to af_runtime_diag.pth and af_runtime_diag.py.
As a result, running ordinary Python tooling in an affected environment could trigger the payload. The package did not need to be imported by an application's code. Researchers reported testing this behavior in an isolated sandbox.
What the payload sought
Security analyses describe collection of secrets from environment variables, local credential files and other running processes' environments. The targets included cloud credentials and identity tokens, Azure and Azure DevOps-related credentials, GitHub credentials, and tokens or configuration used in automated build environments.
Researchers say version 1.26.2 added collection related to GitHub Actions OIDC tokens and runner files. The stolen information was compressed and sent to an external webhook endpoint identified in the analyses.
The precise exposure of any individual installation depends on the machine, the secrets available to it, the environment in which Python ran and whether the payload successfully accessed and transmitted them. The number of downloads or confirmed victims has not been established in the sources reviewed.
The versions and current status
| Version | Published | Status | Research findings |
|---|---|---|---|
1.26.1 |
Nov. 17, 20:35 UTC | Quarantined/removed | Malicious startup hook and credential collector |
1.26.2 |
Nov. 17, 21:08 UTC | Quarantined/removed | Revised hook and expanded collection, including GitHub Actions-related targets |
1.26.0 |
Nov. 12 | Last release identified as clean in reviewed analyses | Researchers recommend returning to this version while the incident is investigated |
PyPI's project page showed both malicious releases as quarantined and listed 1.26.0 as the prior release. Microsoft has not yet published a full incident report establishing the compromised publishing credential, the initial access method, or the broader scope.
What users and maintainers should do
Developers and organizations should check lockfiles, build logs, package caches, mirrors and deployment environments for the two affected versions. If either version was installed, security researchers recommend treating that environment as compromised—not simply uninstalling the package and assuming secrets are safe.
Priorities include:
- Rebuild affected environments and runners from known-clean images.
- Remove the malicious startup-hook files before running Python-based package tools in the affected environment.
- Rotate credentials and tokens that were accessible to those environments, using a separate clean system.
- Review cloud identity, Azure DevOps, GitHub Actions and other relevant audit logs for the exposure period.
- Purge cached wheels and mirrored copies so the malicious releases cannot be reinstalled.
- Review package pins and dependency resolution; do not assume an unpinned “latest” installation is safe during an incident.
The last clean release identified by the researchers is 1.26.0, but version rollback alone is not sufficient for an environment where the malicious code may already have executed.
The unanswered question is publishing access
The evidence confirms malicious package artifacts and their credential-stealing behavior. It does not yet establish who uploaded them or which publishing mechanism was abused.
Researchers noted differences between the malicious artifacts and the project's normal release pattern, including the absence of corresponding source releases. That is evidence to investigate—not proof that a specific maintainer account, API token or publishing workflow was compromised.
The incident also demonstrates a limit of source-repository review: a clean repository does not guarantee that a package uploaded to a public registry was built from that source. Package consumers need provenance and artifact-level checks, while maintainers need to investigate publishing credentials and the release pipeline.
Reporting cutoff: November 18, 2026, 13:50 UTC.
AI-assisted content
This story was drafted and/or edited with AI assistance and reviewed before publishing.


