# Microsoft agent-framework PyPI package compromised with credential stealer

> On 17 November 2026, two malicious releases of Microsoft's `agent-framework` PyPI package (1.26.1 and 1.26.2) were published 33 minutes apart, each containing a credential stealer that runs on every Python interpreter start via a .pth file. Both versions have been quarantined on PyPI.

- Published: 2026-11-17
- Last updated: 2026-11-19
- Severity: critical
- Kind: Compromise - A legitimate, already-used package, maintainer account, CI pipeline, or release tag was hijacked and a malicious version was published under a name people already depend on.
- Ecosystems: PyPI
- Scope: 1 package, 2 compromised versions
- Tags: credential-theft, ci-cd-compromise, infostealer
- Also known as: PYSEC-2026-607
- Detected by: StepSecurity, Socket, JFrog, Aikido, Wiz, Orca, OX Security, Endor Labs
- Incident ID: pypi-2026-11-17-agent-framework-compromise

## Affected packages (1)

Only the exact versions listed were named by the source advisories. Other versions are not implicated.

| Package | Ecosystem | Compromised versions |
|---|---|---|
| [agent-framework](https://dependencywatch.io/package/pypi/agent-framework) | PyPI | 1.26.1, 1.26.2 |

## What happened

On 17 November 2026, an attacker published two malicious releases of Microsoft's official `agent-framework` package on PyPI. Version 1.26.1 appeared first, followed by 1.26.2 roughly 33 minutes later. The package receives approximately 190,000 monthly downloads and is part of Microsoft's AI agent tooling ecosystem.

Both releases include a `.pth` startup hook that fires on every Python interpreter launch without any import. The payload forks into a background process and harvests credentials. Version 1.26.1 targets environment variables, credential files, and Azure tokens; 1.26.2 expands coverage to GitHub Actions OIDC tokens. Collected data is compressed and exfiltrated to a webhook.site endpoint.

JFrog's analysis indicates the attacker repacked the legitimate wheel locally rather than compromising Microsoft's build pipeline. The 22 sibling `agent-framework-*` packages (including `agent-framework-core`) were not affected. PyPI quarantined both releases, though 1.26.2 was published after 1.26.1 had already been flagged, suggesting the attacker retained publishing credentials across the first takedown.

Version 1.26.0 remains the last known clean release. A Microsoft Agent Framework maintainer confirmed the incident on GitHub and stated an investigation was underway.

## Impact

- Credential theft: harvests environment variables, .npmrc, .netrc, .git-credentials, and /proc/*/environ from other processes
- Cloud token theft: mints and exfiltrates Azure managed-identity tokens and Azure DevOps OIDC tokens
- CI/CD token theft: version 1.26.2 also targets GitHub Actions OIDC tokens
- Persistence: .pth file executes on every Python start without any import, even if the package is never used
- Stealth: both malicious versions retain a genuine agent-framework-core 1.26.0 dependency so the framework continues to function

## What to do

1. Pin agent-framework to 1.26.0 with hash verification; remove 1.26.1 and 1.26.2 immediately
2. Rotate all environment variables containing TOKEN, SECRET, or PASSWORD from a clean machine
3. Rotate Azure managed-identity and Azure DevOps OIDC credentials
4. Rotate GitHub Actions OIDC tokens if version 1.26.2 was installed
5. Revoke and regenerate .npmrc, .netrc, and .git-credentials
6. Check site-packages for agent_framework_meta.pth or af_runtime_diag.pth and remove them
7. Rebuild CI container images and caches that installed agent-framework after November 17

## Check your own dependencies

- Check a requirements.txt against this incident: https://dependencywatch.io/check/requirements-txt

The scan runs entirely in the browser; lockfile contents are never uploaded.

## References

- [GHSA-764m-3ppc-5m73: Malicious code in agent-framework](https://github.com/advisories/GHSA-764m-3ppc-5m73) - GitHub
- [Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines](https://www.wiz.io/blog/malicious-version-of-microsofts-agent-framework-published-to-pypi) - Wiz
- [Microsoft agent-framework PyPI Package Compromised](https://www.stepsecurity.io/blog/microsoft-agent-framework-pypi-package-compromised) - StepSecurity
- [Microsoft's agent-framework Hijacked on PyPI via Silent .pth Startup Hook](https://research.jfrog.com/post/agent-framework-hijack/) - JFrog
- [agent-framework PyPI package compromised with credential stealer](https://socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer) - Socket
- [Two malicious agent-framework releases hit PyPI in 33 minutes](https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes) - Aikido

---

Canonical page: https://dependencywatch.io/incident/pypi-2026-11-17-agent-framework-compromise
Markdown version: https://dependencywatch.io/incident/pypi-2026-11-17-agent-framework-compromise.md
Site index for agents: https://dependencywatch.io/llms.txt
DependencyWatch.io is operated by Precursor Security (https://precursorsecurity.com).
