Malicious Code Hit Microsoft's agent-framework on PyPI: How to Check Your Machines Now (December 2026)


Microsoft's AI agent toolkit had a supply-chain scare, and if your project touches it, you have homework today. On November 17, two unauthorized versions of the agent-framework package — 1.26.1 and 1.26.2 — appeared on PyPI carrying a credential stealer. Microsoft explained the incident in an official blog post on November 25, and The Register reported on November 30 that the GitHub repository remains offline with no restoration timetable. Here is what happened and exactly what to check.

What Microsoft has confirmed

Per Microsoft's post, the malicious code lived in the published packages, not in the repository's source. The blast radius:

  • Affected: agent-framework 1.26.1 and 1.26.2 (both since removed from PyPI).
  • Not affected: 1.26.0 and earlier, the .NET packages, Semantic Kernel, and the other Agent Framework Python packages.
  • Microsoft also states the framework has not been discontinued.

What the malware does

JFrog Security Research published the technical teardown: the payload installs a .pth startup hook, which Python executes at interpreter start. That means you never need to import agent_framework — running python, pip, or pytest is enough to trigger it. It harvests hostname and username, environment variables matching dozens of patterns (Azure, AWS, GitHub, OpenAI, Anthropic, Hugging Face keys and more), ~/.azure token caches, .netrc, .git-credentials, and Docker configs, then posts everything unencrypted to a webhook.site address. The silver lining: per JFrog's timeline, 1.26.1 was live for roughly 31 minutes before PyPI quarantined it, and 1.26.2 for about 8 minutes.

How to check whether you're affected

  • Check pip freeze and your lockfiles for agent-framework 1.26.1 or 1.26.2.
  • Look for the indicator files JFrog names: agent_framework_meta.pth (1.26.1) or af_runtime_diag.pth (1.26.2) in site-packages.
  • Sweep CI logs, container images, internal mirrors, and pip caches from November 17 onward. JFrog notes dependency bots were opening upgrade PRs within six minutes of the bad release landing — automation can pull in a short-lived package faster than any human.

If you installed it: Microsoft's instructions

Treat the machine, container, or CI job as compromised. Rotate every credential the environment could reach — cloud identities, CI/CD and package registry tokens, API keys, Git credentials — rebuild from a clean image rather than downgrading in place, and review cloud and CI audit logs from November 17 onward. JFrog adds a practical wrinkle: a bare pip uninstall actually triggers the hook, so set the environment variable _AF_TEL=1 before cleanup, and remember that Entra ID refresh tokens need session revocation, while managed-identity tokens cannot be revoked at all (they stay valid up to 24 hours — recycle the compute).

If you didn't: pin and wait

Microsoft's guidance for everyone else is simple: pin agent-framework==1.26.0 (or the specific sub-packages you use) and hold until further notice. The broader lessons are familiar ones — don't let dependency bots auto-merge into production, keep CI environment variables minimal, and treat package registries as part of your attack surface.

FAQ

Q1. The exposure was under an hour. Why does it matter?

Because the ecosystem is automated. JFrog observed dependency-update bots opening PRs within six minutes. The package also sees roughly 40,000 weekly downloads, per JFrog.

Q2. Is changing passwords enough?

No. Rotating a password or client secret does not revoke cached refresh tokens, so JFrog recommends revoking Entra ID sessions if ~/.azure caches existed, and recycling any compute that used managed identities.

Q3. Is it safe to keep using Agent Framework?

Microsoft says 1.26.0 and earlier are unaffected and the project is not discontinued, but the repository was still offline as of November 30. Pinning 1.26.0 until Microsoft's all-clear is the conservative play.

Related on AI Learning Lab: What Is Prompt Injection? · Switzerland Confirms Its First AI-Agent Cyberattacks


Comments

Popular posts from this blog

AI Search vs Traditional Search: How to Use Each in 2026

What Is a Vector Database? How AI Finds Similar Things, Explained Simply

What Is a Small Language Model (SLM)? On-Device AI Explained