(🇪🇸 Leer la versión en español aquí)
If any CI/CD runner or developer laptop pulled an unpinned build of Microsoft's official agent-framework package from PyPI today, checking whether your codebase explicitly imports the library will not save you. Your credentials can leak the moment Python boots.
On November 17, 2026, security researchers at Wiz, SafeDep, OX Security, and The Hacker News disclosed a supply chain hijack against versions 1.26.1 and 1.26.2 of agent-framework — Microsoft's multi-agent Python SDK averaging roughly 200,000 monthly downloads. PyPI quickly quarantined and removed both releases, yet the attack technique shows exactly why running unpinned pip install inside unrestricted CI runners hands cloud secrets straight to attackers.

How .pth Startup Hooks Hijack Python Before import Ever Runs
Attackers didn't rely on brittle setup.py install hooks that fail on pre-built wheels. According to forensic breakdowns published by The Hacker News and OX Security, each poisoned wheel dropped a startup .pth hook directly into Python's site-packages root:
| Technical Indicator | Malicious 1.26.1 |
Malicious 1.26.2 |
Last Clean Release (1.26.0) |
|---|---|---|---|
Injected site-packages hook |
agent_framework_meta.pth |
af_runtime_diag.pth |
None |
| Trigger condition | Every Python interpreter boot (even pip) |
Every Python interpreter boot (even pip) |
N/A |
| Targeted secrets & tokens | Env vars matching TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI |
Same sweep + Azure & GitHub OIDC token minting | N/A |
| Harvested local config files | ~/.azure/*.json, .npmrc, .netrc, .git-credentials, Docker, Hugging Face |
Same files exfiltrated out to webhook.site |
N/A |
| Current PyPI package status | Quarantined / removed | Quarantined / removed | Safe baseline to pin |
By design, Python's site initialization module executes any line starting with import inside .pth files placed in site-packages. Running python, pytest, or even pip list inside an infected virtual environment fires the stealer immediately — sweeping environment secrets and short-lived OIDC CI tokens before your actual application starts.
Immediate Remediation and Hardening Steps
If any automated build touched agent-framework without strict lockfile hashes on November 17, 2026, assume full secret exposure on that host:
- Nuke infected containers or inspect
site-packagescleanly first: Look for lingeringagent_framework_meta.pthoraf_runtime_diag.pthfiles before invoking Python orpipinside a suspect environment — otherwise runningpip uninstallitself triggers the startup hook one more time. - Rotate every secret visible to that machine or CI job: Following Wiz and SafeDep guidance, immediately rotate Azure CLI tokens (
~/.azure/*.json),.npmrcauth tokens, LLM/API keys, and check GitHub Actions / Azure OIDC audit logs for unauthorized token minting. - Enforce SHA-256 hash pinning (
pip --require-hashes/uv.lock): Rolling floating version ranges in production agents invites the next upstream hijack right into deploy pipelines. Verify local package checksums offline with our Private SHA-256 & HMAC File Verifier and scrub/audit configs via our Private ENV/JSON/YAML Secret Auditor. - Block arbitrary outbound egress on CI/CD runners: Build agents that can freely POST environment dumps to
webhook.siteturn any compromised transitive library into an instant full-tenant breach.
FAQ: Microsoft agent-framework PyPI Compromise
Am I still exposed if my script never imported agent-framework?
Yes, if 1.26.1 or 1.26.2 was installed into your environment. Because the malicious wheels wrote .pth files (agent_framework_meta.pth and af_runtime_diag.pth) into site-packages, Python executes the payload automatically on interpreter startup — even when launching pip or unrelated scripts.
Which version is confirmed clean, and how should teams recover?
Per OX Security and Wiz, version 1.26.0 is the last pre-incident release. Tear down suspect virtual environments or CI caches, rotate all exposed cloud/API credentials, and rebuild with pinned package hashes locked cleanly.
Writing and infographic by Syncroma Studio. Cover photograph: outdoor Microsoft sign closeup in Redmond, public domain via Wikimedia Commons.
Sistemas reales, sin humo corporativo Real systems, zero corporate hype
Recibe los análisis a fondo sobre arquitectura, consumo de recursos y computación de bajo nivel directamente en tu bandeja de entrada. Get deep-dive software architecture, resource consumption metrics, and low-level computing essays delivered straight to your inbox.
Suscribirse a Syncroma Subscribe to Syncroma