The supply chain strikes again, and this time it's targeting the very tools we use to build AI agents. On November 17, 2026, two malicious releases of Microsoft's agent-framework packageβversions 1.26.1 and 1.26.2βappeared on PyPI within a 33-minute window. These weren't just broken builds; they were sophisticated credential stealers designed to exfiltrate Azure, Azure DevOps, and GitHub Actions secrets every time Python started up. Security firm Aikido detailed the incident, noting that the packages were removed from PyPI by 21:20 UTC, but not before potentially compromising thousands of environments.
The Attack Vector: .pth Hooks and Silent Execution
The attacker leveraged the .pth file mechanism in Python, a feature often overlooked in security audits. By injecting a file named agent_framework_meta.pth (in 1.26.1) or af_runtime_diag.pth (in 1.26.2), the payload executed automatically on every interpreter launch, regardless of whether the agent-framework package was actually imported. The code forked into a background process, ensuring it ran once per process tree without slowing down the main application. This stealthy approach meant that even simple commands like pytest or pip triggered the stealer, capturing environment variables and credential files from up to 300 running processes.
Targeting CI/CD and Cloud Identities
The malware specifically hunted for high-value targets in CI/CD pipelines. It scanned for Azure DevOps system access tokens and GitHub Actions OIDC tokens, attempting to mint new credentials via API calls. For Azure-hosted workloads, it queried the Instance Metadata Service (IMDS) to grab managed identity tokens for resources like Key Vault, Storage, and Azure AI Foundry. The exfiltration endpoint, a base64-encoded webhook.site URL, received compressed JSON data disguised as 'runtime diagnostics,' allowing the attacker to harvest secrets without needing their own infrastructure.
Rapid Iteration and Indicators of Compromise
What makes this incident particularly nasty is the attacker's speed. Version 1.26.1 was pulled and replaced by 1.26.2 just 33 minutes later, with the second version adding GitHub Actions OIDC theft capabilities and renaming payload files to evade simple hash-based detection. Indicators of compromise include the presence of agent_framework_meta.pth or af_runtime_diag.pth in site-packages, the _AF_TEL environment variable being set to 1, and network traffic to webhook.site with the user-agent string 'af-runtime-diagnostics/1' or 'runtime-diagnostics/1'.
Key Takeaways
- Pin agent-framework==1.26.0 immediately and rebuild any affected CI containers or developer environments.
- Rotate all secrets accessible by affected machines, including Azure DevOps PATs, GitHub tokens, and Hugging Face credentials.
- Check for .pth files in site-packages that execute imports, as Python currently has no native switch to disable .pth execution.
- Monitor Entra ID sign-in logs and proxy/DNS logs for connections to webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb.
The Bottom Line
This attack proves that even trusted Microsoft SDKs are not immune to supply chain compromises. The use of .pth hooks to bypass import checks is a brutal reminder that 'install-time' security is an illusion in Python; the real risk often lies in what happens at runtime.