On 17 November, someone published two malicious releases of Microsoft's official agent-framework package to PyPI. They contained a credential stealer that ran at Python startup — before any of your code imported anything — and harvested Azure identities, CI tokens and developer secrets. Both are gone now. If you installed either, the clean-up is not optional.

What happened, in order

The attacker had a valid publishing credential for an official Microsoft package. Version 1.26.1 went up at 20:35 UTC. PyPI quarantined it roughly 31 minutes later.

Then the part that matters: quarantining the release did not revoke the publishing credential. About two minutes after the takedown, the attacker published 1.26.2 with the same payload, moved from agent_framework_meta.pth to af_runtime_diag.pth.

That sequence is the lesson. The platform's response removed the artefact and left the access in place, which is the equivalent of cleaning up the broken window while the key is still in the attacker's pocket.

Why a .pth file is worse than it sounds

Python processes .pth files in site-packages automatically at interpreter startup. A line in one can execute code.

So this did not require your application to import agent-framework. Once the package was installed, the stealer ran on any Python process on that machine or runner — a linter, a test run, an unrelated script. The usual mental model of "we installed it but never called it, so we are fine" does not apply here.

What it collected: Azure identities, CI/CD tokens and AI developer secrets, with reporting also citing GitHub credentials and OIDC tokens from Azure DevOps and GitHub Actions. OIDC tokens are the worrying item, because they are the mechanism by which a build is trusted to deploy.

What to do

  1. Find it. Search lockfiles, requirements files, container layers and CI caches for agent-framework==1.26.1 or 1.26.2. The 1.26.1 wheel hash begins d27fa344 and 1.26.2 begins 3d20a8bc.
  2. Pin to 1.26.0 or a later clean release, and block the two bad versions in your proxy or index if you run one.
  3. Rotate everything that host could reach. Cloud credentials, registry tokens, signing keys, environment API keys. Not just what you think the process used — what it could see.
  4. Rebuild, do not upgrade in place. A compromised runner image stays compromised after a version bump.
  5. Review deployments made from affected runners in the window. Stolen OIDC tokens are for pushing changes, not just reading secrets.

Three supply-chain incidents in one week

This lands in the same week as the Optimizely compromise that served malware from 178 major websites and the FBI advisory on an AI tool breaking into networks in under three hours, which succeeded partly through an unrevoked credential from an ended vendor relationship.

The common thread is not sophistication. In each case the attacker used legitimate access to something trusted: a publishing credential, a hosted script, a stale vendor token. Perimeter security is irrelevant to all three, because nothing crossed a perimeter.

The defensive questions that follow are unglamorous and worth asking this week: which credentials can publish to your package registry, when were they last rotated, and would you notice if one of them were used at 20:35 on a Tuesday?

Written by the WritePures newsroom. Spotted something that needs updating? Tell our editors.