News / Security / Malware / Packages
Agent Framework PyPI compromise: recovery
By Loopback 6 min read

Two malicious releases of Microsoft's agent-framework package on PyPI, 1.26.1 and 1.26.2, installed a credential stealer. Anyone who installed either version should investigate the affected environment, revoke accessible credentials and rebuild from trusted inputs. Removing the package alone cannot recover secrets already copied elsewhere. The GitHub advisory identifies both releases as malicious and lists no patched version.
The package is the umbrella distribution for Microsoft Agent Framework. The incident concerns its published Python artifacts. It does not, by itself, establish that every component package, the .NET distribution or the source repository contains the same payload. Keep those scopes separate when searching inventories and notifying service owners.
Upload and removal timeline
Wiz records the first upload on November 17, 2026 at 20:35 UTC and the second at 21:08 UTC. By 21:30 UTC, both were unavailable from PyPI. GitHub's advisory appeared on November 18. These are distinct events: upload, removal and advisory publication should not share one incident timestamp. Wiz analysis.
The live PyPI metadata checked for this article identifies 1.26.0 as the current release and contains no downloadable files for either malicious version. StepSecurity reports that PyPI quarantined the releases. PyPI metadata independently confirms removal. We could not retrieve a first-party incident statement confirming root cause or restored publishing security. A separate public PyPI incident statement was not located.
Both GitHub and the researchers identify 1.26.0 as the last known clean release. That is incident-specific evidence, not a guarantee about every dependency or future upload. A recovery pin must be combined with a reviewed dependency lock and trusted artifact hashes. Cached malicious wheels and already-built images do not disappear when PyPI removes a release.
Execution happens at Python startup
The malicious wheels add a .pth file to a Python site-packages directory. Python normally processes those files during initialization through its site module. An executable import line can load code before an application imports the compromised package. The Python documentation explicitly warns that executable lines in these files run at startup regardless of whether the associated module is used.
That distinction changes the exposure assessment. Installing a wheel can place the hook on disk without immediately running it. A later Python process that processes that site-packages directory can activate it. A test runner, build tool or application launch may supply that next process. Do not equate package installation with proof of successful exfiltration, but do not rely on the absence of an import agent_framework statement either.
The scope is the environment that loads the infected directory. Separate virtual environments do not automatically share every site-packages directory. A shared interpreter configuration, system installation or copied environment can broaden exposure. Investigators should inspect actual paths and build behavior rather than assuming either complete isolation or universal infection.
StepSecurity's static analysis describes renamed hooks across the two releases. Version 1.26.1 uses agent_framework_meta.pth and a telemetry helper. Version 1.26.2 uses af_runtime_diag.pth and af_runtime_diag.py. The framework's legitimate dependency remains usable, so a successful application test would not establish that the installed artifact is clean. StepSecurity analysis.
Why cloud and CI access matter
The advisory describes collection of environment variables, local credential files and readable process environments. Targets include cloud credentials, package-registry tokens and developer authentication material. The payload also attempts to obtain tokens through Azure managed identity and CI identity endpoints. Version 1.26.2 adds GitHub Actions OIDC collection. GitHub advisory.
Token requests still depend on available endpoints, permissions and identity configuration. An attempt to obtain a credential is not proof that a usable token was returned or accepted by a cloud service. Investigators need identity-provider and cloud audit records to determine what access followed. A short token lifetime can limit later use, but it cannot undo actions taken while the token worked.
A build runner may have access to more than the application under test. Review publishing credentials, deployment roles, artifact stores and any other secrets present during the affected job. Our credential-exposure reporting explains why passwords and tokens need separate recovery decisions.

Investigate without starting the infected interpreter
Start with lockfiles, build logs, image manifests and package metadata collected using trusted tools. Avoid launching Python or pip inside a suspect environment simply to ask which version is installed. That action can process the startup hook you are investigating. Preserve relevant files and logs before destroying an image or ephemeral runner.
Search for the two versions, the reported hook filenames and the published wheel hashes. Match the complete hash against the artifact you recovered. A filename alone is useful for triage but is not a reliable identity check. Wiz publishes both wheel hashes and the reported network indicators in its incident analysis.
Researchers report HTTP POST traffic to the reported webhook.site endpoint. Compare the exact endpoint and request details from the advisory with proxy or egress records. A DNS lookup or blocked connection is not proof that secrets arrived. A completed transfer requires closer investigation. Missing network logs also cannot establish that no transfer occurred.
Rebuild and revoke access
Contain affected runners and workloads before issuing replacement secrets. Perform credential recovery from a clean administrative environment. Otherwise, a surviving process could observe the replacements. Record which credentials were reachable, revoke or rotate them through the issuing service and review later use. Include cloud workload identities and registry publishing access, not only passwords stored in application settings.
Recreate affected environments from trusted base images and reviewed dependency inputs. Inspect image layers, wheel caches and build caches before allowing them back into the pipeline. Pinning 1.26.0 addresses the known malicious package versions, but a clean rebuild also needs to exclude leftover hook files and other changes made after execution. This containment and rebuilding sequence is our operational recommendation based on the reported startup behavior.
Finally, check whether exposed credentials could have modified repositories, release artifacts or deployment configuration. Preserve the difference between confirmed activity and plausible access. Neither the registry removal nor a later successful build demonstrates that credential misuse has stopped. Before restoring normal dependency updates, check current maintainer guidance and revalidate package provenance. The public statements and publishing-access status remain follow-up items for this incident.
Sources
- https://github.com/advisories/GHSA-764m-3ppc-5m73
- https://www.wiz.io/blog/malicious-version-of-microsofts-agent-framework-published-to-pypi
- https://pypi.org/pypi/agent-framework/json
- https://docs.python.org/3/library/site.html
- https://www.stepsecurity.io/blog/microsoft-agent-framework-pypi-package-compromised
- https://github.com/advisories/GHSA-764m-3ppc-5m73
- https://www.wiz.io/blog/malicious-version-of-microsofts-agent-framework-published-to-pypi