The agent-framework stealer fired from a .pth hook at interpreter startup, so your agent runtime never had to import the package to leak Azure and GitHub Actions credentials. Here is the containment order that actually works.
Last Updated: November 27, 2026
Two unauthorised releases of Microsoft's agent-framework package (1.26.1 and 1.26.2) hit PyPI on 17 November 2026 carrying a credential stealer. The payload ran from a .pth file at Python interpreter startup, which means it executed on pip, pytest, an IDE language server or any script — your code never had to import the framework. There is no patched version: revert to 1.26.0 and pin it. If either version landed in a container, CI job or dev machine, treat that environment as compromised, rotate from a clean host in dependency order, and rebuild the image rather than downgrading in place.
What actually happened between 20:35 and 21:30 UTC
A compromised publishing identity, not a typosquat. Wiz Research traced the root cause to a compromised client certificate and private key for Microsoft ESRP, the internal Engineering System Release Pipeline that signs and publishes the package — and observed that the attacker's first publish attempt, from AWS, was rejected by ESRP's IP filtering before a second attempt from Microsoft-owned IP space succeeded. The releases came through the legitimate publisher. Every trust signal you normally rely on — official namespace, verified org, correct dependency metadata — was intact.
Microsoft confirmed the sequence publicly on 25 November, stating that both versions were uploaded to PyPI without authorisation, that the malicious code was in the published packages rather than the repository, and that 1.26.0 and earlier, the .NET packages and Semantic Kernel are unaffected. The GitHub source repository was taken offline as a precaution while the investigation ran.
Legitimate 1.26.0 published as wheel plus sdist, alongside agent-framework-core 1.26.0. This is still the last clean release.
Malicious 1.26.1 published — wheel only, no source distribution, which is a departure from how legitimate releases ship.
Malicious 1.26.2 published 33 minutes later, after PyPI had already quarantined 1.26.1, with the payload relocated and GitHub Actions OIDC theft added.
GitHub advisory GHSA-764m-3ppc-5m73 published. Affected versions: 1.26.1, 1.26.2. Patched versions: none.
Microsoft publishes its repository update and remediation guidance, eight days after the upload window.
The .pth hook is the part that should change your threat model
Most supply-chain payloads in Python need you to import something. This one did not. Each wheel added an executable .pth startup hook, and because Python runs .pth files at every interpreter start, the code executed as soon as the package was installed, without importing agent_framework. In practice that means the stealer ran on pip, pytest, IDE language servers and every script in the environment — not only on the agent process you were thinking about.
What a .pth file does
A .pth file in site-packages is normally a path-configuration file. But any line starting with import is executed by Python's site module during interpreter initialisation, before your first line of code. It is a legitimate, documented mechanism that editable installs rely on. It is also a persistence primitive that survives your application never touching the package.
The second release was deliberately engineered against the obvious detection. In 1.26.2 the legitimate package initialiser was restored byte-for-byte and the payload moved to a top-level af_runtime_diag.py reached via af_runtime_diag.pth, so inspecting only agent_framework_meta/__init__.py misses it entirely. If your detection sweep only looks for the 1.26.1 filenames, you will come back clean and be wrong.
The collection logic is the part integration teams should read twice. It did not just copy secrets sitting on disk. It requested fresh GitHub Actions OIDC tokens for the api://AzureADTokenExchange and https://management.azure.com/ audiences, Azure DevOps OIDC tokens, and Azure managed identity tokens for Management, AI, ML, Cognitive Services, Storage, Key Vault, Search, Graph and Container Registry, while reading up to 300 /proc/<pid>/environ entries to harvest other processes' secrets. Its file sweep covered ~/.azure JSON, pip.conf, .npmrc, .netrc, .git-credentials, .docker/config.json, Hugging Face tokens, Azure DevOps agent .credentials, and .env and JSON files under /app and /workspace. That last line is the one that matters: /app/.env is where almost every containerised agent service keeps its downstream keys.
The honest scale of the damage
Here is the part the headlines skipped. The exfiltration endpoint was a free-tier webhook.site URL. Wiz found the free tier caps an unattached URL at 100 requests and expires it after seven days, analysed the 50 requests that were stored, and attributed four to the attacker's own machines, twenty-nine to sandboxes, vendor scanning and tests, and the remaining seventeen to just three unique successful victim exfiltrations. The attacker built a competent stealer and then pointed it at a disposable endpoint that throttled their own harvest.
Do not read that as "nothing happened." It caps the number of logged deliveries, not the number of dirty environments. A machine that installed 1.26.1 or 1.26.2 is still running a startup hook that forks a background collector on every Python launch, and the published analysis gives no visibility into requests the free tier rejected without logging. Treat the low confirmed-victim count as a reason to stay calm during containment, not as a reason to skip it.
"We don't use Agent Framework, so we're clear"
The question is not whether your application depends on it. The question is whether any Python environment on any build agent, devcontainer or shared runner resolved it unpinned during a roughly 55-minute window. A single pip install agent-framework in a scratch notebook on a shared GPU box puts the stealer in that interpreter's startup path for every subsequent Python process by the same user.
pip freeze output, CI log and image layer in the estate, and sweep filesystems for the four indicator filenames in both versions.Find out whether it ever touched you
Microsoft's guidance lists the indicator files per version and is explicit that PyPI removal does not remove copies already downloaded, so you must check lockfiles, pip freeze output, CI logs, container images, internal package mirrors, artifact proxies and pip caches. The mirror and cache paths are the ones teams forget. A quarantined wheel that is already sitting in a Nexus or Artifactory remote-repository cache, or in ~/.cache/pip/wheels on a long-lived runner, will reinstall happily long after PyPI pulled it.
One operational detail from the incident responders that is easy to miss: on a host that installed either version, do not start Python — remove the .pth and payload files with shell tools first. Running pip uninstall starts an interpreter, which runs the hook again.
# 1. Indicator files for BOTH versions, without invoking python
find / -xdev \( -name 'agent_framework_meta.pth' \
-o -name 'af_runtime_diag.pth' \
-o -name 'af_runtime_diag.py' \
-o -path '*/agent_framework_meta/_telemetry.py' \) 2>/dev/null
# 2. Pinned references across every repo, lockfile and Dockerfile
rg -n 'agent[-_]framework\s*==\s*1\.26\.[12]'
# 3. Known-bad wheels anywhere on disk or in a mirror
# 1.26.1 d27fa34414e6201d5e03e559ef634f020057554d7b3f4898dd5d7cd3e989e110
# 1.26.2 3d20a8bc91351a9a16b6db243b848ceca0206b7a8623b02d2af553a9c9f7e0a9
find / -name 'agent_framework-1.26.*-py3-none-any.whl' -exec sha256sum {} +
# 4. Egress evidence, if you keep flow logs
grep -iE 'webhook\.site|runtime-diagnostics/1' /var/log/*/*.log
The wheel hashes and the runtime-diagnostics/1 and af-runtime-diagnostics/1 user agents are published in Socket's indicator list and in the GitHub advisory. If you have egress logs covering 17–24 November and see no connection to that webhook host from an affected box, that is meaningful evidence — the payload had a single hardcoded destination and, per Wiz's analysis, no fallback channel and no retry.
Rotate in dependency order, or you re-leak into a dirty runner
The failure mode I see in real incident response is rotation performed from the compromised machine. Someone SSHes into the affected runner, generates a new client secret, writes it into the environment, restarts the service, and declares the incident closed. The startup hook is still in site-packages. The new secret is now in an environment variable whose name contains SECRET, on a host that collects environment variables whose names contain SECRET.
The second failure mode is rotating static secrets while leaving federated trust intact. An attacker holding a token minted through your GitHub Actions OIDC trust relationship does not care that you rolled a client secret, because that path never used one. Where an Entra ID federated credential trusts the workflow, those OIDC tokens can be exchanged for Azure access with no stored secret needed.
Containment order that does not re-leak
Cut outbound network from the affected container or runner before touching credentials. Do not delete it yet — you need the filesystem and process history for scoping. Snapshot, then isolate.
From a clean workstation, revoke Entra ID federated credentials trusting the affected workflow, disable the Azure DevOps service connections, and remove the managed identity role assignments for the affected compute. These mint new tokens on demand; static key rotation does nothing to them.
Microsoft's guidance is explicit on this point: rebuild from a clean image and remove affected environments, images, caches and mirror copies. Purge the wheel from the internal proxy before the rebuild pulls it back.
PyPI and npm tokens, container registry credentials, Git credentials and SSH deploy keys. These are the ones that let an attacker reach your next build, so they come before business-system keys.
Everything the agent runtime could reach: ERP and CRM API keys, payment provider keys, transactional email send credentials, model provider keys, webhook signing secrets. Issue them only into the rebuilt environment.
Entra sign-in and audit logs, Azure activity logs, GitHub audit log, package registry publish events, and outbound email volume. Look for token use from unfamiliar IPs, not just failed logins.
Treat the machine, container, or CI job as compromised.
— Dan Taylor, Principal Product Architect, Microsoft, Microsoft Agent Framework repository update
Agent runtimes concentrate blast radius by design
A web app holds its own database credentials. An agent runtime holds the credentials for everything the agent is allowed to touch, which is the entire point of building one. The same box that runs the planner loop also holds the ERP service account, the CRM OAuth refresh token, the payment provider's secret key and send rights on the company's transactional email domain. Supply-chain compromise of an ordinary service leaks one blast radius. Supply-chain compromise of an agent runtime leaks the union of every integration you connected to it.
That is an architectural property, not a vendor flaw, and it is why we treat credential partitioning as a design constraint in agent integration work rather than an operational afterthought. The rotation cost differs sharply by credential type, and that difference should drive the design.
| Credential type | How this stealer reached it | What rotation actually costs you |
|---|---|---|
Long-lived key in an env var or /app/.env | Direct read — name-substring match on TOKEN, SECRET, KEY, AZURE, AWS, GITHUB, OPENAI | Highest. Manual reissue per provider, coordinated redeploy, and often a vendor support ticket for payment or ERP keys |
| Azure managed identity | Fresh tokens minted from IMDS at 169.254.169.254 for nine-plus resource audiences | No secret to rotate — you remove role assignments and wait out token lifetime, then reassign to the rebuilt compute |
| GitHub Actions / Azure DevOps OIDC | Newly requested tokens via ACTIONS_ID_TOKEN_REQUEST_URL and SYSTEM_OIDCREQUESTURI | Low if scoped per-workflow and short-lived. Revoke the federated credential, fix the subject claim, re-add |
| Credentials in a self-hosted automation platform's encrypted store | Not reached by this Python payload — but reached by the equivalent npm-ecosystem attack, or by anything that can read the process environment holding the decryption key | Very high. Every connected app, re-authorised by hand, usually by the client's own admins |
| Model provider API keys | Env vars matching OPENAI and HF_, plus the Hugging Face token file | Moderate, but billing exposure is immediate and uncapped on most plans |
Does this hit a self-hosted n8n box?
Not directly, and anyone telling you otherwise is selling something. n8n runs on Node.js; a malicious PyPI wheel cannot reach a plain n8n container. The transferable risk is threefold. First, the Python agent sidecar you almost certainly co-located next to it — the custom tool service, the embedding job, the document parser. Second, the CI pipeline that builds both, which holds the registry credentials for both. Third, and most importantly, n8n is where the credential concentration lives: if an attacker gets onto the host and can read the process environment that holds the instance's encryption key, the encrypted credential store stops helping. The npm ecosystem has already produced self-replicating equivalents of this attack class, and Wiz notes that another Microsoft Python package, durabletask, was compromised earlier this year after its PyPI token was stolen. The pattern repeats across ecosystems.
The preventive layer most automation teams skip
Pinning to a version number would have stopped this. Almost nobody does it properly on agent stacks, because the frameworks move fast and teams get used to taking whatever pip install hands them. Microsoft's own remediation ends with the recommendation to pin to agent-framework==1.26.0 or pin the exact sub-packages you need, and hold there.
Version pinning alone is still weaker than it looks, because a yanked-and-republished version or a mirror cache poisoning attack defeats it. Hash pinning does not. pip's hash-checking mode, enabled with --require-hashes, requires hashes for all requirements and all dependencies and forces every requirement to be pinned with ==, a URL or a filesystem path — and the same docs recommend pairing it with --only-binary :all: to disallow source distributions. Note the all-or-nothing rule: a partially hashed requirements file is explicitly treated as an error, because an unhashed line is a free slot for an attacker.
| Control | Would it have stopped this one? | The honest cost |
|---|---|---|
| Exact version pin in a lockfile, no auto-upgrade in CI | Yes — nothing resolved to 1.26.1 or 1.26.2 unless a bot merged the bump | Dependency bot noise and real upgrade lag. Budget maintenance time or it rots |
pip --require-hashes plus --only-binary :all: | Yes, and it also survives mirror cache poisoning | Regenerating hashes on every change; cross-platform wheel sets get tedious |
| Internal mirror with a quarantine delay (e.g. hold new releases 24–72h) | Yes — the bad versions were pulled within roughly an hour | You are deliberately behind on security patches too. Needs an emergency bypass path |
| SBOM gate matched against advisory feeds | No, not during the window. The GitHub advisory was not published until 18 November, a day after the upload | Still worth building — it is how you answer "were we exposed" in minutes instead of days |
| Short-lived OIDC federation instead of long-lived keys | Partly. The payload minted OIDC tokens too, but scoped, short-lived tokens shrink the usable window dramatically | Real identity-platform work. Worth it regardless of this incident |
| Default-deny egress allowlist on the agent container | Yes, completely. One hardcoded destination, no fallback channel, failures silently dropped | You must enumerate every legitimate outbound host, including model APIs and telemetry |
If you only implement one of these, make it the egress allowlist. It is the cheapest control with the highest leverage, because it fails the attacker rather than the defender: a stealer with a single hardcoded exfiltration endpoint and no retry logic is completely neutered by a container that can only reach your model provider, your object store and your message broker. It also happens to be the control that protects you against the attack class nobody has published yet. Our notes on which outbound hosts a multi-provider setup genuinely needs are in the model coverage reference.
Treating the SBOM as the detection layer
SBOM scanners match your component list against advisory databases. During the window that mattered here, there was no advisory to match against — the GitHub entry landed the following day. Teams that equate "SBOM gate green" with "supply chain safe" have bought a lookup table and called it a control.
Who eats the blast radius when it's a client's box
This is the uncomfortable commercial question and it should be answered in writing before an incident, not during one. If you build an agent runtime or a self-hosted automation instance that a client operates, the credentials inside it are the client's, the patching cadence is usually contractually theirs, and the architectural decision to let one container hold ERP, CRM and email send rights was almost certainly yours. In an incident, all three facts arrive at the same meeting.
Three things make that meeting survivable. One: an inventory you can query, meaning build-time SBOMs keyed to image digests, so "which of our deployments contained this wheel" is a five-minute query rather than a week of SSH. Two: a documented rotation runbook per integration, written when you built the integration and while you still remembered which admin console issues that key. Three: a pre-agreed statement of who performs rotation and within what window — because the one thing you cannot do at 23:00 on a Tuesday is work out whether you have authority to revoke the client's payment provider key.
None of that requires exotic tooling. It requires having written it down. If you are standing up agent infrastructure and want the containment design done before the first deployment rather than after the first incident, that is the conversation to start here.
Frequently Asked Questions
Was I exposed if my code never imported agent-framework?
Yes, if the package was installed. The payload shipped as a .pth startup hook, and Python executes .pth files during interpreter initialisation. It therefore ran on pip itself, on pytest, on IDE language servers and on any unrelated script sharing that environment. Installation is the trigger, not import. Microsoft's guidance is to treat any machine, container or CI job that installed 1.26.1 or 1.26.2 as compromised.
How do I check whether the malicious versions ever reached my estate?
Search for the indicator files in site-packages: agent_framework_meta.pth and agent_framework_meta/_telemetry.py for 1.26.1, af_runtime_diag.pth and af_runtime_diag.py for 1.26.2. Then grep lockfiles, pip freeze output, CI logs, container image layers, internal mirrors, artifact proxies and pip caches for the version strings. Removal from PyPI does not remove copies already cached locally or in your proxy.
Is there a patched version to upgrade to?
No. The GitHub advisory lists the patched version as none. The remediation is to revert to 1.26.0, the last clean release, and pin it — or pin the exact sub-packages you need. Microsoft has said 1.26.0 and earlier are unaffected, that the .NET packages and Semantic Kernel are unaffected, and that teams should hold at that pin until further guidance is published.
What should I rotate first?
Identity-minting paths before static secrets: Entra ID federated credentials trusting the affected workflows, Azure DevOps service connections, and managed identity role assignments on the affected compute. Then package registry and Git credentials, since those reach your next build. Then downstream business keys. Perform every rotation from a clean host, never from the affected machine, and rebuild the environment before issuing new credentials into it.
Does this affect my self-hosted n8n instance?
Not directly — n8n is a Node.js application and a malicious PyPI wheel cannot execute inside it. The exposure is indirect: Python agent services co-located on the same host, shared CI pipelines that build both, and shared registry credentials. The structural lesson still applies, because an automation instance concentrates credentials for every connected system, and equivalent compromises have occurred in the npm ecosystem.
Would an SBOM gate have caught this in time?
No. SBOM gates compare components against advisory databases, and the GitHub advisory was published on 18 November — after the upload window on 17 November had closed. SBOMs are a scoping tool, not a prevention tool: their value is answering which images contain a given package within minutes. Prevention here comes from hash-pinned installs, a quarantined internal mirror and runtime egress restrictions.
Should we stop using Microsoft Agent Framework?
On this evidence, no. The repository source was not modified, the compromise was of the publishing path, and Microsoft has stated the framework is not discontinued. Any widely used package with an automated release pipeline carries the same class of risk. The defensible response is to change how you consume dependencies — hash-pinned, mirrored, egress-restricted — rather than to swap one framework for another with the same exposure.
Research digest
AI Research Briefing
Honest insights on AI agents, Small Language Models, and local RAG. No hype. Only when we have something worth sending.
- No hype, just measurable outcomes
- Read by 2,400+ engineers
- Unsubscribe anytime