Two versions of a Microsoft-maintained Python package on PyPI quietly shipped a credential stealer last week, putting developers and automated build systems at risk of having their cloud tokens and secrets siphoned off without ever importing the package.
The affected package is agent-framework, the meta-package for Microsoft’s Agent Framework used to build AI agents in Python. According to reporting from The Hacker News, versions 1.26.1 and 1.26.2 were published to PyPI just 33 minutes apart on November 17, 2026, and both have since been quarantined. Microsoft has not said how the attacker obtained publishing access to the project, and that detail remains unconfirmed. The last known clean release is 1.26.0.
A hook that fires before anyone imports anything
What made this compromise unusually effective is the delivery method. Rather than hiding malicious code inside the package’s normal modules, the attackers used a Python startup hook called a .pth file. According to a technical writeup from Socket, Python’s site module reads every .pth file in the site-packages directory each time the interpreter starts, and a line beginning with import inside one of those files gets executed immediately, before any application code runs.
That meant the stealer could run the moment Python started, whether or not a developer or a build pipeline ever wrote a line of code that touched Agent Framework. Endor Labs, one of several security firms that examined the packages, put it plainly: “Python executes import lines in .pth files on every interpreter start.”
The two malicious versions used slightly different tricks. Version 1.26.1 shipped a file named agent_framework_meta.pth that pointed to a new module, agent_framework_meta/_telemetry.py, wrapped in a try/except block designed to swallow any errors quietly. Version 1.26.2 took a cleverer approach: its .pth file, af_runtime_diag.pth, imported a separate top-level module called af_runtime_diag.py, while leaving the package’s actual __init__.py file untouched, byte for byte identical to the legitimate release. Socket’s researchers noted that anyone who checked only the init file for tampering would have missed the payload entirely. OX Security, another firm that reviewed the incident, described the technique as an effort to “hijack the wheel creation flow to add malicious logic inside.”
On Linux and macOS, the malicious code forked itself into a detached background process using os.setsid() so it would keep running independently of the original Python process. On platforms without fork support, it fell back to a daemon thread instead.
What it was built to steal
The stealer cast a wide net. It scanned environment variables for substrings like TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, and OPENAI, among others, and version 1.26.2 extended that list to cover CI-specific variables such as ACTIONS, OIDC, and RUNNER. It also read credential files directly off disk, including Azure CLI configuration under ~/.azure, .npmrc, pip.conf, .netrc, .git-credentials, Docker’s config.json, Hugging Face tokens, and any .env or JSON files sitting in common application directories.
It went beyond simply reading what was already stored. On systems running in Azure or Azure DevOps, the malware actively requested fresh authentication tokens rather than relying solely on cached ones. It used Azure DevOps’s SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI variables to pull federation tokens, and queried the Azure instance metadata service, reachable at 169.254.169.254 or through the IDENTITY_ENDPOINT variable on App Service and Functions, to obtain managed-identity tokens. Version 1.26.2 added the ability to request GitHub Actions OIDC tokens as well, intended for exchanges with Azure Active Directory. Because these are freshly issued tokens rather than stored secrets, security firm SafeDep cautioned that simply rotating existing credentials “does not cover” this part of the exposure.
Once collected, the data was packaged as JSON, compressed with zlib, encoded in Base64, and sent over HTTPS to a webhook.site address, a free service commonly used for testing webhooks that here served as a convenient, disposable exfiltration point.
Who was exposed, and what to do next
agent-framework receives roughly 190,000 downloads a month, so the pool of potentially affected systems is sizable, spanning individual developer machines as well as CI/CD runners that install dependencies automatically on every build. Organizations should treat any system that installed version 1.26.1 or 1.26.2 between the evening of November 17, 2026, when the packages went live, through the following morning as potentially exposed, and specifically check for activity in the narrower window of roughly 8:35 to 9:20 p.m. UTC that day, when the packages were reachable before being pulled.
Recommended steps include isolating any host or CI runner that installed the affected versions, pinning back to the clean 1.26.0 release, and rebuilding from a known-good environment rather than simply upgrading in place. Because the malware requested live tokens rather than only reading cached ones, rotating credentials from a clean system afterward is important, alongside reviewing Azure sign-in and activity logs and auditing any GitHub Actions workflows that deploy into Azure. Security teams can also check proxy and DNS logs for outbound connections to the webhook.site domain as a sign of compromise.
This is not the first time an official Microsoft Python package has been used this way. In May 2026, a threat group tracked as TeamPCP pushed three malicious versions of durabletask, Microsoft’s client library for its Durable Task workflow framework, in order to spread a worm known as Mini Shai-Hulud. The Hacker News noted that the agent-framework incident marks the second time this year that a Microsoft-associated PyPI package has been compromised in this way, a pattern that points to PyPI’s open publishing model as an ongoing target for supply chain attacks against widely used developer tooling.
Sources: The Hacker News, Socket

