Dev & code

Microsoft Agent Framework: two tampered PyPI releases stole credentials, Microsoft takes its repository offline

Versions 1.26.1 and 1.26.2 of the agent-framework Python package, Microsoft's kit for building AI agents, contained a credential stealer that ran as soon as Python started. Microsoft has confirmed the incident, taken its GitHub repository offline, and is telling anyone affected to treat the machine as compromised. According to Wiz, the attacker's tooling identified itself as Cairn, an AI-driven intrusion framework.

Abstract generated illustration for the Dev & code section

A pip install agent-framework with no version number, a container image rebuilt on the wrong evening, an automatic update accepted a little too quickly: that was all it took. On November 17, 2026, two tampered versions of the agent-framework Python package, Microsoft’s kit for building AI agents, were published to PyPI. On November 25, Microsoft confirmed the incident in an official blog post and said it had taken its GitHub repository offline as a “necessary precaution,” with no date for its return.

What happened

According to the GitHub security advisory, version 1.26.1 appeared on PyPI at 8:35 p.m. UTC and 1.26.2 at 9:08 p.m. UTC on November 17. Both added a credential stealer that was absent from the last clean version, 1.26.0. They have since been removed, and 1.26.0 is once again the latest version listed on PyPI. Only the agent-framework metapackage is affected: the framework’s other Python packages, the .NET packages, and Semantic Kernel are not, and the malicious code was not in the repository itself.

The method explains the severity. The tampered package dropped a small .pth file into the site-packages folder, and Python runs these files every time it starts. So there was no need to actually use the framework: any Python interpreter starting in the environment (a script, a test suite, a code editor) was enough to launch the program in the background. It then swept up environment variables with telltale names (TOKEN, SECRET, KEY, OPENAI, HF_, AWS, AZURE, GITHUB…), credential files (Azure CLI, Git, Docker, npm, Hugging Face, .env files), and Azure tokens. Version 1.26.2 added GitHub Actions OIDC tokens. According to Wiz, the program requested them for Azure services, and they can be exchanged for Azure access when an Entra ID identity trusts the workflow.

What to do

Microsoft distinguishes two cases. If you installed 1.26.1 or 1.26.2, treat the machine, container, or continuous integration job as compromised: rotate every accessible credential (cloud, CI/CD, package registries, API keys, Git), rebuild from a clean image rather than downgrading in place, and review logs going back to November 17. Otherwise, pin agent-framework==1.26.0 until further guidance.

To find out whether you are affected, Microsoft recommends checking lock files, pip freeze output, CI logs, container images, internal mirrors, and pip caches, then looking for these files in site-packages:

Version Indicator files (according to Microsoft)
1.26.1 agent_framework_meta.pth, agent_framework_meta/_telemetry.py
1.26.2 af_runtime_diag.pth, af_runtime_diag.py

Security firm JFrog flags a trap: in an infected environment, running pip to uninstall the package launches the stealer one last time, since pip is itself a Python program. JFrog recommends first setting the environment variable _AF_TEL=1, which blocks the stealer from running in both versions. All the more reason to follow Microsoft’s advice: throw the environment away rather than repair it.

What remains unclear

Microsoft has not explained how unauthorized versions could be published under its name. Security firm Wiz, which says it reported the incident to Microsoft on November 17, offers a lead: the attacker appears to have obtained a certificate and private key for the internal service that signs and publishes the package. Wiz also says the attacker’s tooling identified itself as Cairn, the AI-driven intrusion framework already cited by Amazon in the discovery of a previously unknown flaw by autonomous agents, and that a configuration that appears to belong to a coding agent was spotted on the attacker’s machine. Microsoft has confirmed none of these points. As for the scale, Wiz could only analyze the 50 requests retained by the free tier of the collection service the attacker used, which included only three unique cases of successful theft from victims. This count is limited to what that service kept: it is a floor, not a full tally.

Our take

The incident checks every box of the risk specific to AI agent tooling. These environments by nature concentrate high-value secrets (OpenAI or Hugging Face keys, cloud access, CI tokens) and update quickly, often without pinned versions: exactly what the stealer was after. The case recalls the breach at Railway, where stolen AI API keys turned into hundreds of thousands of dollars in fraudulent usage. The fact that an official package from a vendor of this size could be published by a third party shows that trusting the name is not enough: pinning versions with a lock file, delaying automatic updates by a few days, and limiting the secrets exposed to CI jobs remain the most effective protections. If the attribution to Cairn is confirmed, the tool, so far cited for intrusions and vulnerability research, would also turn up in the compromise of a major vendor’s software supply chain.

Sources

  1. Microsoft — Microsoft Agent Framework repository update (November 25, 2026) Primary source
  2. GitHub Advisory Database — GHSA-764m-3ppc-5m73, Malicious code in agent-framework (PyPI) Primary source
  3. PyPI — agent-framework package page Primary source
  4. Wiz Research — Microsoft agent-framework Compromised (November 17-18, 2026) Secondary source
  5. JFrog Security Research — Microsoft's agent-framework Hijacked on PyPI Secondary source

A primary source comes directly from the company, lab or organization concerned. A secondary source reports the information without being its author: we flag it as such. Spotted an error? See our corrections policy.

How we work: editorial charter and methodology · our verification process · corrections log. Spotted an error? Write to contact@neuralbrew.ai.