Skip to content

Accident reports · November 2026

Microsoft Agent Framework: two fake versions of the Python package steal cloud keys

According to Socket and BleepingComputer, versions 1.26.1 and 1.26.2 sent Azure, AWS, GitHub and OpenAI secrets to the attacker as soon as Python started.

  • Company Microsoft
  • Agent Microsoft Agent Framework
  • Model not published
The agent as a weapon
A small closed kraft cardboard box on a white background
Photo: Christopher Bill on Unsplash
When17 November 2026
WhoAn unidentified attacker, who published two fake versions of Microsoft's official Python package for building AI agents
What the package didVersions 1.26.1 and 1.26.2 of "agent-framework" looked for the machine's keys and tokens (Azure, AWS, GitHub, OpenAI…) and sent them to the attacker, as soon as Python started
ConsequenceNumber of downloads of the booby-trapped versions not published; PyPI quarantined them within minutes

What happened

Microsoft Agent Framework is Microsoft's open-source toolkit for building and coordinating AI agents in Python. According to BleepingComputer, the official package gets about 200,000 downloads a month on PyPI, the Python package index.

On 17 November, two booby-trapped versions were published there, 1.26.1 then 1.26.2. According to Socket, which analysed the code, the framework kept working normally. Alongside it, a small file ran every time Python started, even if nobody used the package. It collected the secrets within reach: environment variables, configuration files, other running programs. It targeted Azure, AWS, GitHub, Docker, Hugging Face and OpenAI, and tried to obtain Azure identity tokens. The second version also went after GitHub Actions pipeline tokens. Everything went to an address controlled by the attacker.

According to BleepingComputer, PyPI quarantined the first version; the attacker published the second about two and a half minutes later, quarantined in turn about eight minutes after that. How the attacker got publishing rights is not known. Microsoft had not answered BleepingComputer at the time of publication.

Why it happened

An agent toolkit runs where the keys are: developer machines, servers, CI pipelines, with access to the cloud and to model APIs. A booby-trapped version published under the official name is installed by automatic updates without anyone looking at it. The malicious code does not even need the package to be used: it starts with Python.

The failure family

In our catalogue, this is the "The agent as a weapon" family: a person uses an agent tool to attack. Here the attacker slipped into the building block used to make the agents themselves.

The safeguard in code

  • Pin dependency versions and refuse a version published a few hours ago, until the scans have run.
  • No long-lived keys in the environment of agents or CI pipelines; short tokens, limited to what is strictly needed.
  • Block outbound traffic to unknown addresses from servers and CI pipelines.

What we test

Our crash tests test the agent's behaviour, not the packages it is built from. A coding agent in charge of updating dependencies that installs, unchecked, a version published a few minutes ago is not yet tested as such; this case joins our list of tests to add. What a company can lock down today: a minimum delay before accepting any new package version.

Sources: Socket · BleepingComputer.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading