agent-framework PyPI Attack: Malicious Versions and Recovery
Microsoft agent-framework 1.26.1 and 1.26.2 steal cloud credentials. Find malicious Python startup hooks, isolate CI runners, and rebuild safely.


On this page
On this page7 sections
Microsoft’s agent-framework Python package was poisoned with a credential stealer on 17 November 2026. Malicious versions 1.26.1 and 1.26.2 reached the Python Package Index (PyPI) 33 minutes apart. A .pth startup hook executes the payload during normal Python startup, even when application code never imports Agent Framework.
SafeDep and Wiz confirm malicious releases. Both versions were removed, but registry takedown does not clean developer machines, build runners, or container images.
What to Remember
- Block both releases: 1.26.1 and 1.26.2 are malicious; 1.26.0 is the last identified clean release on 18 November.
- Do not start Python or pip: Installed startup hooks can run again. Inspect files with trusted tooling.
- Audit cloud identities: The payload requests Azure managed-identity and OpenID Connect (OIDC) tokens; 1.26.2 adds GitHub Actions collection.
- Rebuild and rotate: Replace environments, rotate reachable secrets, and lock the entire dependency tree.
Affected agent-framework Versions
| Version | Status | Startup hook |
|---|---|---|
| 1.26.1 | Malicious, uploaded 17 November at 20:35 UTC; removed | agent_framework_meta.pth |
| 1.26.2 | Malicious, uploaded at 21:08 UTC; removed | af_runtime_diag.pth |
| 1.26.0 | Last identified clean metapackage; audit the full dependency tree | Neither malicious hook |
The confirmed scope is the Python metapackage, not every framework distribution. A complete installation or victim count is unavailable.
How the Credential Stealer Works
Python’s site module executes .pth import lines during normal startup. The hook launches a collector disguised as diagnostics, using the same mechanism as the LiteLLM startup-hook compromise. Shared technique does not establish shared attribution.
The collector targets:
- Stored secrets: Environment variables, Azure command-line sessions, registry tokens, Git credentials, and
.envfiles. - Neighbouring processes: Readable
/proc/<pid>/environfiles can expose credentials from other jobs on shared runners. - Fresh platform tokens: Azure DevOps federation, Azure managed identities, and GitHub Actions jobs with
id-token: write.
Wiz reports suspected Engineering System Release Pipeline (ESRP) certificate misuse. Initial access and upload attribution remain unconfirmed.
Check Exposure Without Running Python
Use trusted shell tools on isolated hosts or mounted image filesystems. Inspect matching manifests and installed metadata for 1.26.1 or 1.26.2, including cached build artefacts:
# Locate manifests without executing Python or printing credential values.
grep -rlE 'agent[-_]framework' \
--include='*.txt' --include='*.lock' --include='*.toml' .
# Inspect Linux hosts or mounted filesystems; adapt the scan root as needed.
find / -type f \( -name 'agent_framework_meta.pth' \
-o -name 'af_runtime_diag.pth' \
-o -path '*agent[-_]framework-1.26.[12].dist-info/METADATA' \) \
2>/dev/nullThe indicators below are defanged for display. Search logs for the real hostname webhook.site, the UUID and User-Agent values, not literal hxxps or [.] markers. Do not visit the endpoint.
hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb?t=telemetry
af-runtime-diagnostics/1
runtime-diagnostics/1Matching files establish exposure, not successful exfiltration. Missing egress logs do not clear an affected environment.
Containment and Safe Recovery
- Isolate hosts and stop jobs. Preserve wheels and logs before rebuilding; block the exfiltration endpoint.
- Rotate reachable credentials from a clean system. Include cloud and registry tokens, Git credentials, and secrets from neighbouring jobs.
- Audit issued tokens. Review Entra sign-ins, Azure activity, and federated identities from installation onward. Secret rotation does not invalidate every issued token.
- Rebuild using verified 1.26.0 and approved dependency hashes. Do not run
pip uninstallinside the suspect environment.
Why Pinning 1.26.0 Alone Is Insufficient
agent-framework-core[all]==1.26.0 allows integration dependencies to update independently. SafeDep identified vibiret publishing access to five sibling projects, including agent-framework-openai, agent-framework-purview, agent-framework-redis, and agent-framework-tools. No malicious sibling releases were confirmed in its report.
Freeze the full tree until publishing access is secured. Isolate installation from deployment in Continuous Integration and Continuous Delivery (CI/CD) pipelines: Workload Identity Federation removes stored keys, but malicious authorised code can still request tokens.
Conclusion: Recover the Identity Boundary
Replace compromised environments and investigate credentials before resuming builds. Downgrading a package is not incident remediation.
Apply the secure code review checklist to Open Worldwide Application Security Project (OWASP) A03:2025 Software Supply Chain Failures.
For supply chain and cloud-security architecture support, contact me on LinkedIn or [email protected].
FAQ
Frequently Asked Questions (FAQ)
Which agent-framework versions are malicious?
PyPI versions 1.26.1 and 1.26.2 contain malware and were removed. Version 1.26.0 is the last identified clean release on 18 November 2026.
Does the malware require importing Agent Framework?
No application import is required. Installed .pth hooks execute during normal Python startup, including subsequent pip invocations.
Is downgrading to agent-framework 1.26.0 enough?
No: stolen credentials remain exposed. Rebuild environments, rotate reachable secrets, and lock transitive dependencies with approved hashes.
Can the malware steal keyless cloud credentials?
The payload requests Azure managed-identity and federation tokens where accessible. Version 1.26.2 also targets GitHub Actions jobs with id-token: write.
How can I check an affected environment safely?
Inspect manifests, installed metadata, and both malicious .pth filenames with trusted filesystem tools. Do not start suspect Python or pip.
Resources
- Investigation: SafeDep: Microsoft agent-framework compromised twice
- Indicators: SafeDep’s full hashes and indicators of compromise
- Research update: Wiz: publishing-path evidence and observed exfiltration
- Package metadata: agent-framework 1.26.0 on PyPI
- Runtime behaviour: Python documentation: site and executable .pth lines



