Publisher Trust Is Not Provenance: What the Microsoft agent-framework PyPI Compromise Says About Software Supply Chain Security

For about 55 minutes on the evening of 17 November 2026, the safest-looking package in your AI stack was a credential stealer. Two releases of agent-framework — Microsoft’s official Python framework for building AI agents, a package with tens of thousands of downloads a week — were published to PyPI carrying a payload built to harvest Azure managed-identity tokens, Azure DevOps and GitHub Actions OIDC tokens, and every cloud CLI credential it could find. Nothing about the package name, the project page or the maintainer list looked wrong. That is the point, and it is why software supply chain security has to move from trusting who published a package to verifying how it was built.

What happened

According to Wiz Research, version 1.26.1 appeared on PyPI at 20:35 UTC on 17 November, followed by 1.26.2 at about 21:08 UTC. Both were gone by 21:30 UTC. The last clean release is 1.26.0 (12 November). SafeDep flagged 1.26.1 within 22 minutes and 1.26.2 within four — and made the sharpest observation of the week: “Removing one version did not stop an attacker who could still publish.”

The payload did not wait to be imported. Each release dropped a .pth file (agent_framework_meta.pth in 1.26.1, af_runtime_diag.pth in 1.26.2) into site-packages. Python executes .pth import lines at every interpreter start, so any Python process in that environment ran the stealer, whether or not it touched the agent framework. Wiz documents what it collected:

  • secret-looking environment variables, including values read from up to 300 /proc/*/environ files;
  • 60–80 credential files — Azure CLI profiles, .npmrc, pip.conf, .netrc, .git-credentials, Docker config, Hugging Face tokens, Azure DevOps agent credentials, .env files under /app and /workspace;
  • managed-identity tokens for 12 Azure resources (ARM, Microsoft Graph, Key Vault, Storage, Container Registry and more) via the instance metadata service;
  • Azure DevOps OIDC tokens and, in 1.26.2, GitHub Actions OIDC tokens from any workflow granted id-token: write.

Everything went out in a single HTTPS POST to a webhook.site URL. Wiz counted three confirmed victim exfiltrations in the requests it could see; the true number is unknown.

How it got published — and why the uncertainty matters

The researchers do not yet agree on the root cause, and no Microsoft statement had been published at the time of writing. Wiz assesses that the attacker “appears to have compromised a client certificate and private key” for Microsoft’s ESRP (Engineering System Release Pipeline), the internal service that signs and publishes the package. Its notable detail: a first publish attempt from AWS was rejected by ESRP’s IP filtering; a second, from Microsoft-owned IP space, succeeded. SafeDep instead points to a PyPI maintainer account created on 17 November with publish rights on agent-framework and five related projects, and notes that “how the account got maintainer access is not known.” The Hacker News summarises the state of play simply: “It’s unclear how the attacker managed to obtain publishing access.”

Both explanations lead to the same uncomfortable conclusion. Whether the attacker held a signing credential or a maintainer seat, they held the publisher’s identity — and every downstream control that keys on publisher identity said yes.

The analysis: we have been verifying the wrong thing

Most organisations’ package policy is, in practice, a reputation check. Allow-list the big vendors, block typosquats, pin major versions, maybe scan for known-malicious hashes. That model assumes the dangerous package comes from someone you do not trust. This incident — like Microsoft’s durabletask compromise in May, which SafeDep says was pushed with a stolen API token and which Wiz explicitly does not link to this one — shows the opposite failure mode: a trusted name, a trusted channel, and a malicious artefact.

Three lessons stand out for engineering and security leaders.

1. Reputation is an attribute of a publisher. Provenance is an attribute of an artefact. The question “is this from Microsoft?” was answered correctly — yes. The question nobody’s tooling asked was “was this wheel built from a reviewed commit in Microsoft’s repository by Microsoft’s CI?” Build attestations (Sigstore-backed PyPI attestations, SLSA provenance) exist precisely to answer that second question. Very few consumers enforce them at install time.

2. Network allow-listing protects the publish path only as well as its weakest allowed network. ESRP’s IP filtering worked — it blocked the AWS attempt. It simply could not distinguish a legitimate Microsoft network from an attacker operating inside one. Location-based trust is a speed bump, not a boundary; the same is true of the “only our CIDR can reach this” rules guarding many internal registries.

3. The blast radius is defined by your identities, not by the package. The stealer was only as dangerous as the credentials sitting in the environment that installed it. A developer laptop with an expired Azure CLI session lost little. A CI runner with a managed identity holding Contributor on a production subscription, or a GitHub workflow federated to an Entra ID app with broad rights, lost a great deal — Wiz notes the stolen tokens are valid for up to 24 hours, ample time to mint durable access. We wrote about this pattern last week in our round-up on the wfx-loot GitHub Actions stealer and in our guide to finding stale third-party cloud access keys: the package is the delivery vehicle; the standing identity is the prize.

Impact assessment

  • Who is exposed: anyone whose environment resolved agent-framework 1.26.1 or 1.26.2 between 20:35 and ~21:30 UTC on 17 November — most likely CI pipelines, container image builds and AI-agent sandboxes using unpinned or loosely pinned dependencies.
  • What is at risk: Azure subscriptions reachable through managed identities and OIDC federation, Azure DevOps service connections, package-registry publish tokens (npm, PyPI, NuGet, Hugging Face) and source-control credentials. Stolen registry tokens are the seed of the next supply-chain compromise.
  • Risk rating: High for organisations building AI agents on Azure with automated dependency updates; Low for those pinned to 1.26.0 or earlier with hash-checked lockfiles.

The CloudShieldSecure perspective

At CloudKonsult we built CloudShieldSecure around a simple premise: you cannot prevent every poisoned dependency, but you can know — before an incident — exactly what any given workload is able to reach. When a package like this lands, the useful question is not “did we install it?” but “if we did, which managed identities, federated credentials and keys could that runner mint, and which of them touch production?” CloudShieldSecure maps those identity paths across your cloud accounts and flags the over-privileged CI and workload identities that turn a 55-minute window into a full-scale breach. Shrinking that blast radius is work you can do today, independent of any single vendor’s publishing pipeline.

  1. Check exposure now. Search lockfiles, CI logs, virtualenvs and container images for agent-framework==1.26.1 or 1.26.2; look in site-packages for agent_framework_meta.pth or af_runtime_diag.pth; search proxy/DNS logs for webhook.site traffic. Pin to 1.26.0.
  2. If exposed, rotate everything the environment could read — Azure CLI sessions, Azure DevOps PATs and service connections, registry tokens, git credentials — and review Entra ID sign-in and activity logs for the managed identities and federated credentials reachable from affected hosts.
  3. Pin by hash, not by version range. pip install --require-hashes with a reviewed lockfile would have refused both releases.
  4. Add a cooling-off period. Delay adoption of brand-new releases by 24–72 hours in automated builds; most malicious releases are pulled within hours.
  5. Start enforcing provenance. Inventory which of your critical dependencies publish build attestations, and plan to require them for those packages.
  6. Scope CI identities. Grant id-token: write only to jobs that need it, constrain OIDC federated-credential subject claims to specific repos and branches, and keep production-capable identities out of build runners.

Sources & references

Assess your security posture today

CloudShield Secure scans, validates, and prioritises threats across your entire attack surface.

Explore CloudShield Secure →
← Java4Shell Exposure Check: How to Tell in 10 … vCenter Post-Patch Checklist for CVE-2026-123890: … →