Microsoft agent-framework PyPI Attack: OIDC Token Theft Explained

Two malicious PyPI releases of Microsoft's agent-framework stole GitHub Actions OIDC tokens and exchanged them for live Azure access, no stored secret required.

On November 17, 2026, someone published two malicious versions of agent-framework, Microsoft's official Python SDK for building AI agents, to PyPI. The package pulls in roughly 200,000 downloads a month, and the tainted releases were live for well under an hour. Anyone whose CI runners, build images, or dev machines installed agent-framework 1.26.1 or 1.26.2 in that window, especially GitHub Actions jobs with id-token: write, should treat every credential reachable from that process as burned.

What landed on PyPI, and when

At 20:35 UTC on November 17, 2026, a malicious version (1.26.1) of the agent-framework package (Microsoft Agent Framework) was uploaded to PyPI. A second, more capable version followed within the same hour, per Wiz's published timeline.

1 · Last known good release

Legitimate 1.26.0 published (wheel + sdist, alongside agent-framework-core 1.26.0) on November 12 at 18:25 UTC. This is the version to pin to today.

2 · First malicious upload

Version 1.26.1 goes live at 20:35 UTC, dropping a file called agent_framework_meta.pth into site-packages.

3 · Second, wider malicious upload

Version 1.26.2 follows around 21:08 UTC, using a different trigger file, af_runtime_diag.pth, and adding theft of GitHub Actions OIDC tokens on top of what 1.26.1 already collected.

4 · Quarantine

As of 21:30 UTC, both versions were no longer available on PyPI. Total exposure window: under an hour.

Why the malware didn't need anyone to import it

The trick is a Python feature most developers never think about. Python runs .pth files on every interpreter start, so the credential stealer runs whenever Python starts in that environment, even if agent-framework is never imported. A build step that merely installs the package into a virtualenv is enough to trigger it. Checking your dependency tree for an explicit import line won't tell you whether you were exposed; you have to check the installed version.

The theft chain: env vars to a live Azure session

The payload is a credential grep followed by a token mint. It scans environment variables for names containing strings like TOKEN, SECRET, AZURE, GITHUB, and OPENAI, reads the environment of other running processes, and pulls credential files such as Azure CLI sessions, Azure DevOps PATs, and git credentials. That part is ordinary infostealer behavior.

The part worth a teardown is what 1.26.2 added. GitHub Actions runners (1.26.2 only): OIDC tokens for api://AzureADTokenExchange and management.azure.com via ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN in workflows with id-token: write, plus ACTIONS_RUNTIME_TOKEN and files under /home/runner. In plain terms, if a workflow has id-token: write permission, the malware asks GitHub's own token service for a short-lived identity token, the same one the workflow would normally use to authenticate to Azure without a stored secret, then ships that token out.

That token is only useful if something on the Azure side trusts it, which is exactly the point. Where an Entra ID federated credential trusts the workflow, these tokens can be exchanged for Azure access, with no stored secret needed. Workload identity federation was built to remove long-lived secrets from CI, and it does that well against leaked YAML and log scraping. It does nothing to stop a process running inside the trusted runner from requesting the token itself and handing it to someone else.

Why a 55-minute window behaves like a permanent leak

A stolen static secret is bad until rotated. A stolen federated token is bad until the Entra ID app registration's trust is reviewed, because the token itself can't be revoked early. Wiz notes that stolen managed-identity and OIDC-exchanged tokens stay valid for up to 24 hours. A stealer live on PyPI for under an hour can hand an attacker a full day of legitimate Azure access, minted fresh, with no key ever written to disk for a scanner to catch.

This detail matters more than the package name or the download count. Short supply-chain windows used to mean small blast radius, because an attacker had to grab a secret before it got rotated. Federated identity breaks that assumption: the thing worth stealing isn't a secret, it's a brief chance to ask the identity provider for one.

What's confirmed and what isn't

Attribution for how the malicious builds reached PyPI is not settled. The attacker appears to have compromised a client certificate and private key for Microsoft ESRP (Engineering System Release Pipeline), the internal service Microsoft uses to sign and publish this package. That is Wiz's assessment, not a confirmed root cause from Microsoft. Address filtering on the service blocked the attacker's first attempt from Amazon Web Services, according to Wiz, though the attacker was able to publish on a second try from Microsoft-owned address space. Microsoft had not published its own account of how the ESRP credential was obtained as of this writing.

Wiz's visibility into victims comes from the attacker's own exfiltration channel, an anonymous webhook.site URL. Of 50 exfiltration requests Wiz captured, 17 contained victim data, from three unique victims. Three is a small number, but each one is a build environment that handed over working cloud and CI credentials, and it only reflects what reached that one endpoint before it was shut down, not a ceiling on actual exposure.

<1 hr
Both malicious versions were live on PyPI before being pulled, per Wiz's published timeline
200K
Monthly downloads reported for agent-framework around the time of the incident
24 hrs
Maximum validity Wiz cites for the stolen managed-identity and OIDC-exchanged tokens

What to check now

  • Run pip show agent-framework across every image, venv, and lockfile. Anything other than 1.26.0 or earlier needs investigation, not just an upgrade.
  • Pull GitHub Actions run logs for any workflow with id-token: write that installed the package on November 17. Treat its OIDC tokens as exposed for the Entra ID app registrations those workflows can reach.
  • Review Azure DevOps pipelines that set SYSTEM_ACCESSTOKEN, since the same OIDC-exchange trick applies to the Azure DevOps federated token endpoint.
  • Rotate anything the stealer could read directly: Azure CLI sessions, git credentials, npm/PyPI/NuGet/Docker tokens, Hugging Face tokens. These are static secrets, so rotation is straightforward.
  • For federated credentials, review sign-in logs for the app registrations those workflows trust rather than relying on rotation, since a minted token stays usable until the trust relationship itself is changed.

Our security notes treat a dependency that runs code on install, not on import, as reason enough to pin exact versions and diff lockfiles on every CI run.

Where this fits with other agent and CI exposure

This incident shares a shape with other supply-chain cases where CI runners held more standing access than anyone tracked, a theme in our write-up on the Shai-Hulud npm worm, and in our look at how AI agents should hold API access instead of raw bearer material.

KnoxCall is a gateway that sits between an application, agent, or CI runner and a third-party API, so the caller holds a proxy token rather than the live key on its way out. That doesn't touch Azure's workload identity federation or GitHub's OIDC service, which is what this attack abused, but it does mean a leaked environment variable for a KnoxCall-fronted API isn't a usable credential on its own.

Frequently asked questions

What versions of Microsoft's agent-framework are malicious?

Versions 1.26.1 and 1.26.2 of the agent-framework PyPI package were malicious. They were published on November 17, 2026 and removed from PyPI by about 21:30 UTC the same day. Version 1.26.0, published November 12, is the most recent confirmed-clean release.

Is agent-framework 1.26.0 safe to use?

Yes. Wiz Research identifies 1.26.0, published November 12, 2026, as the last known safe version. Anything other than 1.26.0 or earlier in your lockfiles, images, or virtual environments needs investigation rather than a routine upgrade.

How do I check if my GitHub Actions OIDC tokens were exposed?

Pull run logs for any workflow with id-token: write permission that installed agent-framework on November 17, 2026. If that workflow installed version 1.26.2, treat its OIDC tokens for Azure as exposed and review which Entra ID federated credentials trust that repository and workflow.

How did the attacker publish malicious versions of a Microsoft package?

Wiz reported that the attacker appears to have compromised a client certificate and private key for Microsoft's Engineering System Release Pipeline, the internal service used to sign and publish the package. That is Wiz's assessment; Microsoft has not published its own confirmed root cause for how the credential was obtained.

Sources

  1. Microsoft agent-framework Compromised: Credential Stealer Targets Azure and CI Pipelines
  2. Wiz ties Microsoft Agent Framework package compromise to release pipeline certificate
  3. A Stolen Release Credential Just Turned an Official Microsoft Package into Malware
  4. What the Microsoft agent-framework PyPI Breach Means for Your CI Pipeline
  5. Microsoft agent-framework PyPI Hijack: Check and Respond
  6. Microsoft's agent-framework PyPI hijack: 41 minutes, three victims
  7. Microsoft Agent Framework PyPI package carried a credential stealer for under an hour
  8. Microsoft Agent Framework PyPI Malware: Hunt, Contain and Rotate Azure and GitHub Secrets
  9. Microsoft's agent-framework malware: your Azure audit

Federated tokens don't wait for a secret scanner

This attack stole OIDC tokens straight out of the runner process, which is why keeping bearer material off every box your CI touches matters as much as rotating what gets stored.

Start Free →

Or get new posts by email. Double opt-in, unsubscribe anytime.