TKWIT editorial team · Updated

Microsoft Agent Framework PyPI Attack: Malicious Python Releases Targeted Cloud Credentials

Package registryBuild / dev.pth startup hookAttacker endpoint
Illustrative diagram, not incident data. A video explainer is an illustrative reconstruction in preparation and will appear here and in TKWIT Unfiltered only once publicly available.

Two malicious releases of Microsoft’s agent-framework Python package briefly appeared on PyPI on 17 November 2026 and tried to steal cloud and developer secrets. This was a malicious package release, not a confirmed mass breach of Microsoft or its customers.

If your developers or build pipelines use Python AI tooling, this is worth a calm, careful check today. According to the GitHub Security Advisory and independent research from Wiz and Chainguard, attackers published agent-framework version 1.26.1 at 20:35 UTC and version 1.26.2 at 21:08 UTC on 17 November 2026. Both were removed or quarantined by about 21:30 UTC. The most recent clean release is 1.26.0.

The window was short, but automated builds install packages quickly. Any environment that resolved an unpinned or loosely pinned agent-framework dependency during that hour should be reviewed. Nothing reviewed by TKWIT establishes how many systems installed the malicious versions, whether data was actually stolen, or how the attacker obtained publishing access.

17 November 2026 timeline — UTC

  1. · 1.26.1 published

    The first malicious release appeared on PyPI.

  2. · 1.26.2 published

    A second malicious release followed.

  3. · Removed or quarantined

    Both versions were taken out of normal installation.

How a .pth file runs code without an import

Python processes .pth files in its site-packages directory every time the interpreter starts. Lines beginning with import are executed. The malicious releases embedded such a startup hook, so the information-stealing code could run whenever Python started in that environment — during a test run, a build step or an unrelated script — even if nobody imported the framework.

That is why simply not using the library in code is not reassurance. If a malicious version was installed in an environment, treat that environment as potentially exposed until reviewed.

What the payload sought

The researchers report that the payload searched for cloud and developer or CI secrets, including Azure identity tokens, and attempted to send them to an attacker-controlled endpoint. Attempted exfiltration is not proof of successful theft in any particular environment; network egress controls, token lifetimes and where the code ran all matter.

There is no evidence in the cited sources that Microsoft’s wider ecosystem was hacked or that its customers are broadly affected. The concern is narrower and practical: organisations whose machines or pipelines installed 1.26.1 or 1.26.2.

How to check for 1.26.1 or 1.26.2

  • Search lockfiles and dependency manifests (requirements*.txt, poetry.lock, uv.lock, Pipfile.lock, pyproject.toml) for agent-framework==1.26.1 or 1.26.2.
  • Review CI/CD logs and build caches for installs between 20:35 and about 21:30 UTC on 17 November 2026, including container images built in that window.
  • On developer machines and virtual environments, run pip show agent-framework (or pip list) and inspect site-packages for unexpected .pth files.
  • Check artifact mirrors or internal package proxies that may have cached the malicious versions after PyPI removed them.

If a malicious version was installed

  1. Isolate affected machines, runners or images and rebuild them from a trusted baseline, pinning agent-framework to 1.26.0 or a later verified clean release.
  2. Rotate every secret that was reachable from those environments — cloud credentials, Azure identity tokens and service principals, GitHub and Azure DevOps tokens, API keys and CI variables.
  3. Review GitHub, Azure / Entra ID and Azure DevOps sign-in and audit logs for unusual activity, and reduce token scopes and lifetimes where permissions were broader than needed.
  4. Preserve relevant logs before cleanup and involve your cloud, application and incident-response specialists for forensic review.

Reducing future risk — and the limits

  1. Vetted, pinned dependencies

    Keep a dependency inventory, pin versions with hashes in lockfiles, and delay or review new releases before they reach production builds. This reduces exposure windows; it cannot guarantee a trusted publisher will never ship a bad release.

  2. Least-privilege identities

    Give build runners and developers short-lived, narrowly scoped tokens and separate production credentials from build environments, so a stolen secret reaches less.

  3. Egress control and monitoring

    Restrict outbound traffic from build networks to required destinations and alert on unusual connections. Firewalls, switches and segmentation can limit and reveal exfiltration attempts, but they do not prevent a package compromise on their own.

What is still unknown

The number of installations, which organisations were affected, whether any secrets were successfully stolen and used, and how the attacker gained publishing access have not been established in the cited sources. We will update this page only from official or attributed findings.

Sources

Checked 18 November 2026.

How TKWIT can help

TKWIT is an infrastructure, network, identity and access-control integrator. We can help design segmented build and office networks, egress filtering and logging, and phishing-resistant sign-in for administrator accounts, and coordinate with your application, cloud and incident-response specialists, who own package review and forensics. We scope work before quoting and promise no absolute protection.

Discuss a scoped review with TKWIT

Discuss technology, security and IT infrastructure for your site

Call or WhatsApp our Colombo team with your Sri Lanka site location, the system you need and whether this is a new installation or an existing fault. We confirm the scope before quoting; support depends on the equipment, access and agreed work.

Explore technology, security and IT infrastructure services