· via dev.to (home feed)
Malicious PyPI releases of Microsoft Agent Framework targeted developer credentials
Two versions of Microsoft's Agent Framework Python package on PyPI carried code that harvested cloud and developer credentials via Python startup hooks. Both releases were removed, but installed environments may remain exposed.

What happened
Two releases of Microsoft's Agent Framework Python package were published to PyPI on November 17 with malicious code designed to harvest credentials, according to a report on dev.to. The affected versions, agent-framework 1.26.1 and 1.26.2, landed on the registry roughly half an hour apart, at 20:35 UTC and 21:08 UTC. Both have since been removed. The security advisory referenced in the write-up listed 1.26.0 as the last known clean release.
A trusted name, a hostile update
Microsoft Agent Framework is a genuine Microsoft project for building AI agents and applications. The package name was real, the project was real, and PyPI is the registry Python developers rely on worldwide, yet hostile code was delivered anyway. According to the dev.to report, the incident does not indicate that Microsoft's AI products at large were breached, and ordinary Windows, Outlook or Microsoft 365 users were not directly affected.
Code that ran on interpreter startup
The most troubling detail is how the payload executed. The attacker abused Python's .pth startup-hook mechanism, a mechanism the report says can trigger code execution the moment the interpreter launches. The malware therefore never needed an application to import the compromised package; simply starting Python inside an affected environment, routine activity during development, could be enough to set it off.
What the malware collected
According to the dev.to write-up, the code attempted to gather sensitive material reachable from the compromised environment:
- Azure authentication data and cloud identity tokens
- GitHub credentials and secrets tied to workflows
- API keys exposed through environment variables
- Credentials used by package registries and development tooling
- Configuration files that could hold sensitive values
Collected data was intended for exfiltration to an endpoint under the attacker's control. The report notes that the number of successful thefts has not been established publicly. It also points out that the blast radius can extend well beyond a single application, because a modern AI development environment often holds credentials for a model provider, a GitHub repository, a database and a cloud platform at the same time.
What affected developers should do
For teams using the framework, the report recommends checking dependency lockfiles, build logs and package inventories for versions 1.26.1 and 1.26.2, and not beginning the investigation by running Python or pip inside a suspect environment, since the startup hook could fire. If an affected version is present, the environment should be isolated and rebuilt from a trusted source, with any suspicious startup-hook files examined. Credentials the environment could reach, including cloud credentials, GitHub tokens, API keys and automated build secrets, should be rotated or revoked, and authentication logs and network activity should be reviewed for signs of unauthorized access. Removing the package alone does not reverse a possible credential leak.
Why it matters
Most AI security debate centres on the model: whether it leaks private data, whether its instructions can be manipulated, whether it takes actions beyond what the user intended. This incident sits a layer below that. Before any model runs, developers install the software that makes the application possible, and that software can hold access to powerful credentials long before an agent performs its first task. Here the name was legitimate, the project was genuine and the distribution channel was widely used, and malicious code still shipped. The question the dev.to report leaves open is worth taking seriously: if increasingly autonomous AI systems are being built on this stack, the software underneath them should face at least as much scrutiny as the models themselves.
- #python
- #pypi
- #supply-chain
- #security
- #microsoft