When an AI Agent Framework Package Is Compromised: Lessons From the agent-framework PyPI Incident

When an AI agent framework package is compromised: package boxes feeding an agent, with versions 1.26.1 and 1.26.2 highlighted

On November 17, 2026, two versions of the agent-framework Python package, 1.26.1 and 1.26.2, were uploaded to PyPI without authorization. Both contained code that steals credentials. Both versions have been removed, and Microsoft published guidance on November 25. The incident is contained, but it is a clear signal for anyone building AI agents: the frameworks and packages agents are built from are now part of the attack surface, and they sit in places with a lot of credentials, such as developer machines and CI pipelines.

Our recent articles looked at agents once they are running: how Agent 365 inventories and governs them, how it brings in agents from other platforms, and how AI-run attacks like ARTEX move at machine speed. In this article, we go one step earlier, to the code agents are made of.

What happened, according to Microsoft

The unauthorized versions were available “for a short time on November 17.” Only the agent-framework meta-package was affected: other Microsoft Agent Framework Python packages were not affected, and version 1.26.0 and earlier are not affected. The .NET packages and Semantic Kernel were not affected. Microsoft Agent Framework has not been discontinued.

There are two details that drive the best response. First, the malicious code runs when Python starts in that environment, even if your application doesn’t import the package. Second, PyPI removal does not remove copies already downloaded. Anything cached, mirrored, or baked into an image is still there. Microsoft says the malicious code was in the published packages, “not in the repository itself.” The repository is temporarily unavailable while Microsoft confirms it is safe to re-enable, and at the time of this writing, Microsoft has not published a root cause or a restoration timeline.

VersionFiles to look for in site-packages (per Microsoft)
1.26.1agent_framework_meta.pth and agent_framework_meta/_telemetry.py
1.26.2af_runtime_diag.pth and af_runtime_diag.py

Take a look at the PYSEC-2026-4388 page, which includes more indicators to help scope credential rotation and review network logs.

Were you exposed?

Microsoft lists the likely paths: unpinned installs or upgrades of agent-framework, unpinned CI or container builds, or automated dependency updates to 1.26.1 or 1.26.2 that were merged. To determine if you were exposed, teams should check lockfiles, pip freeze output, CI logs, container images, internal package mirrors, artifact proxies, and pip caches.

If you find either version, Microsoft’s guidance, which we follow at Synergy Advisors, is to treat the machine, container, or CI job as compromised and to:

  1. Rotate every credential the environment could reach, including cloud identities, CI/CD and package registry tokens, API keys, and Git credentials.
  2. Rebuild from a clean image. Don’t downgrade in place. Remove affected environments, images, caches, and copies in internal mirrors or proxies.
  3. Review cloud and CI audit logs from November 17 onward for activity you do not recognize involving those credentials.

If you did not install either version, Microsoft recommends pinning to agent-framework 1.26.0, or to the exact sub-packages you need, and holding there until Microsoft provides further guidance.

Where a poisoned package lands: developer laptop, CI job, container image, internal mirror and pip cache, with the response step for each
Where a poisoned package lands, and the response step for each place.

Why the agent supply chain is different

Package compromises are not new. What makes this one worth a closer look is where agent frameworks run and what they touch:

  • They live where the secrets are. An agent under development usually has access to model endpoints, tool APIs, cloud resources, and test data. The build pipeline that packages it often holds deployment credentials.
  • They update fast. Agent frameworks are young and release often, which makes unpinned “latest” installs and automatic updates tempting.
  • Agents have identities of their own. A stolen credential is no longer only a user password: it can be an agent’s secret or a workload identity that acts without a person in the loop. When Microsoft says rotate “every credential the environment could reach,” that includes the identities your agents use.

Lessons for teams that build agents

Beyond Microsoft’s steps for this incident, these are the practices Synergy Advisors recommends for any team that builds or runs agents:

  1. Pin and lock. Pin exact versions of agent frameworks and their sub-packages, use lockfiles, and treat a major framework upgrade as a change with an owner and a review, not as routine.
  2. Put a mirror in the middle. Pull packages through an internal mirror or proxy you control, so you can block a version across the organization in one place and know who downloaded it.
  3. Do not let new releases flow straight into builds. Automated update tools are useful, but updates to core agent dependencies should not merge without review.
  4. Give build jobs short-lived, least-privilege credentials. A CI job that only needs to publish an image should not hold standing access to production.
  5. Know which agents use which framework. An inventory of agents with their owners and dependencies turns “who is affected?” from a week of searching into a query.
  6. Watch where builds talk to. Unexpected outbound connections from developer machines and build agents are often the first sign that a package is doing something it should not.

How our experts help

  • Agent 365 E-xperiences help you build the inventory of the agents in your organization, with an owner, the identity each one uses, and least-privilege access, so an incident like this one has a clear scope.
  • Our Managed Services run a 24x7x365 SOC on Microsoft Defender XDR and Microsoft Sentinel. When a supply chain alert appears, our experts help scope which machines and identities were exposed and follow the rotation and rebuild through to the end.

Frequently asked questions

Which agent-framework versions were affected?

Versions 1.26.1 and 1.26.2 of the agent-framework Python package, uploaded to PyPI without authorization on November 17, 2026. Both were removed. Version 1.26.0 and earlier are not affected.

Are the .NET packages or Semantic Kernel affected?

No. The .NET packages, Semantic Kernel, and the other Microsoft Agent Framework Python packages were not affected.

Is uninstalling the package enough?

No. The malicious code runs when Python starts, so an affected machine, container, or CI job should be treated as compromised: rotate the credentials it could reach, rebuild from a clean image, and review audit logs from November 17 onward.

Was Microsoft Agent Framework discontinued?

No. Microsoft says the framework has not been discontinued. The repository is temporarily unavailable while Microsoft confirms it is safe to re-enable.

What should teams do if they were not affected?

Pin agent-framework to 1.26.0 or to the exact sub-packages they need, as Microsoft recommends, and check caches, mirrors, and images for copies of the affected versions.

Next step

Synergy Advisors experts can help you map which agents you build or run, what they depend on and which identities they use. Talk to our experts or join the Protect the Agentic Enterprise webinar on Tuesday, December 15, at 2:00 p.m. ET.

Sources

Talk to our experts

Ready to take the next step?

A Synergy Advisors expert can help you assess where you are today and plan what comes next in your Microsoft security journey.

Scroll to Top