Your Agent SDK Has Your Keys: Lessons from the Microsoft Agent Framework Compromise

Microsoft Agent Framework compromise: glass software package cube with a crack and keys drifting out
Table of Contents

Last reviewed 26 November 2026. This article reflects the GitHub security advisory and published analysis from Wiz and other researchers. Microsoft has not yet published a full account of how the attacker got publishing access. We’ll update this article as more is confirmed.


Agent security usually focuses on the agent: what it can access and who approves its actions. The tools used to build agents get far less scrutiny. They arrive through pip install, sit inside developer laptops and build pipelines, and usually inherit whatever credentials those environments hold.

On 17 November 2026, that blind spot was exploited. An attacker published two malicious versions, 1.26.1 and 1.26.2, of agent-framework, the official Python package for Microsoft Agent Framework. Both contained a credential stealer aimed at Azure, GitHub and CI/CD secrets.

Key takeaways

  • The affected versions are 1.26.1 and 1.26.2 of the Python package. Version 1.26.0 is the last clean release.
  • Installing was enough. The malware ran at every Python start, whether or not your code imported the framework.
  • The window was short, but automation makes it matter. Both versions were live for under an hour, which is plenty of time for a nightly build with a loose version range.
  • Any affected environment should be treated as compromised. That means rebuilding and rotating every secret it could reach.
  • Agent SDKs belong in your security model. They run with the same privileges as your pipelines, so they need the same controls.

What happened in the Microsoft Agent Framework compromise

The legitimate 1.26.0 was published on 12 November. According to Wiz’s timeline, the malicious 1.26.1 appeared on PyPI at 20:35 UTC on 17 November, followed by 1.26.2 at around 21:08. Both were gone by about 21:30.

Both were published under Microsoft’s own publisher account and copied the real README, so they looked like a routine patch update. Wiz found that the attacker appears to have used a stolen client certificate and private key for Microsoft’s internal release pipeline. How those credentials were obtained has not been disclosed.

The payload added a .pth startup hook, a Python feature that runs code whenever the interpreter starts. It then collected:

  • environment variables with names containing terms such as TOKEN, SECRET, KEY, AZURE, AWS and GITHUB
  • credential files, including Azure CLI configuration, .npmrc, .git-credentials, Docker configuration and .env files
  • Azure DevOps pipeline tokens and Azure managed identity tokens for services including Azure Resource Manager, Key Vault, Microsoft Graph and storage
  • in 1.26.2, GitHub Actions OIDC tokens, which can be exchanged for Azure access through federated credentials

Everything was compressed and sent to an external webhook. Microsoft told The Register it had made some repositories private while it investigated, and the Agent Framework repository was briefly offline.

Wiz’s analysis of the attacker’s captured data identified three confirmed victims, and SiliconANGLE notes the victim count may be small. Treat that as a floor rather than reassurance, because the analysis only covers the data the attacker’s endpoint retained.

Why this matters now

Many organisations are moving agentic AI projects from pilot to production on Microsoft’s stack, which means build pipelines with real permissions to deploy to Azure, read from Key Vault and publish containers.

Three lessons stand out:

  • A trusted publisher is not a guarantee. This release came through a legitimate Microsoft channel. Checks that only confirm “this is the official package” would have passed it.
  • Loose version ranges carry real risk. A requirement such as agent-framework>=1.26 pulls whatever is newest at build time, including a release that was live for about 55 minutes.
  • Build environments are high-value targets. A developer laptop holds one person’s access. A CI runner with a managed identity may hold access to production.

Agent SDKs are privileged components

We often describe agents as privileged insiders that need identity, policy and verifiable oversight. The same thinking applies one layer down. The SDK that builds your agent runs inside the environment that holds the keys, so a compromised SDK gets everything that environment can reach.

Consider a hypothetical example. A European insurer runs a nightly build for its claims agent at 21:00 UTC. The requirements file allows any 1.26.x release, and the build runner uses a managed identity with access to Key Vault and a production storage account. On 17 November, that build installs 1.26.1. Moments later, tokens for Key Vault and storage leave the network. The agent behaves normally and nobody notices. A single pinned version with a hash check would have stopped the install.

What IT and AI leaders should do next

1. Confirm whether you were exposed

Search lockfiles, CI logs, virtual environments and container images for agent-framework 1.26.1 or 1.26.2. Wiz also lists files to look for in site-packages (agent_framework_meta.pth and af_runtime_diag.pth) and suggests checking proxy and DNS logs for requests to webhook.site.

2. If you were exposed, treat it as a credential breach

Rebuild affected systems from 1.26.0 and rotate every secret they could reach: Azure CLI sessions, Azure DevOps personal access tokens, package registry tokens, and repository and organisation secrets. Review Azure sign-in and activity logs for managed identities and federated credentials. Wiz notes that stolen tokens can stay valid for up to 24 hours.

3. Pin and verify every agent dependency

Use exact versions with hash checking, commit your lockfiles and route installs through a controlled internal feed. Treat a new release of a core SDK as a change to review before it reaches production pipelines.

4. Reduce what a build can reach

Give build identities only the permissions each job needs, prefer short-lived tokens, limit OIDC token permissions to the workflows that need them, and restrict outbound traffic from build runners.

5. Add agent tooling to your agent governance

Your agent inventory should list the SDKs, frameworks and MCP servers each agent depends on, alongside its identity and permissions. Apply the same review to plugins and connectors, as we set out in our guide to the Copilot Plugin Catalog, and fold it into your wider AI governance model.

Frequently asked questions

Are Copilot, Copilot Studio, Foundry agents or the .NET version affected? Nothing published suggests so. The advisory covers two versions of one Python package on PyPI, agent-framework. The risk sits with teams that installed those versions into their own environments.

Secure the supply chain behind your agents

This incident was contained within an hour, and the confirmed impact appears limited. Even so, as agents move into production, the code used to build them becomes part of your attack surface, with access to the same credentials as your pipelines.

If you’re building agents on Microsoft’s stack, Stellium can help you review your pipelines, identities and dependency controls so a compromised package cannot reach production. For more on governing agents at scale, read our Microsoft Ignite 2026 takeaways and our blueprint for securing the agentic insider.

Want to see what this looks like in practice? Join our 60-minute webinar From AI Sprawl to Governed AI on 3 December at 10:00 CET, with a real production story from a regulated multinational, a live demo and time for your questions.

Stellium

26 November 2026