Skip to content
Microsoft agent

Microsoft agent

Safedep • November 18, 2026

Two releases of agent-framework , Microsoft’s official Python metapackage for its Agent Framework, steal credentials from any environment that installs them. Nothing has to import the package. A .pth file runs the stealer each time Python starts, so a pip install in a CI job is enough. It takes environment variables and credential files. It also asks Azure DevOps, Azure managed identity and, in the second release, GitHub Actions for fresh tokens, and sends those out too.

SafeDep flagged version 1.26.1 22 minutes after it reached PyPI on 17 November 2026. By then the attacker was close to publishing again. Once 1.26.1 came off PyPI, 1.26.2 shipped the same stealer under different file names, and SafeDep flagged it 4 minutes after upload. Removing one version did not stop an attacker who could still publish. The last clean release is 1.26.0.

Update (18 November 2026): PyPI shows that vibiret , an account created on the day of the attack, can publish to agent-framework and five related projects. Four of those projects install with agent-framework. See A maintainer account created the same day .

PyPI lists two maintainers for the project, microsoft and vibiret . The project gets 192,000 downloads a month. How many installs the two bad versions got is not known yet.

How the releases differed from real ones

Every release from 1.20.0 through 1.26.0 shipped a wheel and an sdist. Both malicious versions are a single wheel. The 1.26.1 wheel is 10,402 bytes, up from 6,681 in 1.26.0. A metapackage that always shipped both files now ships one.

Missing provenance does not set the bad wheels apart. PyPI has no attestation for 1.26.0 either, so a consumer had no cryptographic way to tell Microsoft’s uploads from the attacker’s.

This is the second Microsoft package on PyPI to get rogue releases in six months. In May, durabletask 1.4.1 to 1.4.3 went up with a stolen API token and had no matching commits or tags. The payloads and infrastructure nothing, so there is no evidence that links the two incidents.

A maintainer account created the same day

PyPI lists a second maintainer on agent-framework, vibiret . The account joined PyPI on 17 November 2026, the day both malicious versions went up. Besides agent-framework, it can publish to the five projects below. It is not listed on agent-framework-core, which holds the framework’s code.

PyPI does not publish who uploaded a file. The join date points to vibiret as the account that uploaded 1.26.1 and 1.26.2. Neither PyPI nor Microsoft has released the upload log that would confirm it. How the account got maintainer access is not known. On 18 November it still had access to all six projects.

None of the five has had a release since 12 November, before the account existed. Four of them install with agent-framework. Version 1.26.0 requires agent-framework-core[all]==1.26.0 , and that extra accepts any release of the four below 2.0. While vibiret keeps its access, every fresh pip install agent-framework==1.26.0 would pull in a new release of any of the four.

Python’s site module executes any line beginning with import in a .pth file under site-packages at interpreter startup. 1.26.1 ships agent_framework_meta.pth , a 28-byte file holding one line. Hashing that line plus a newline reproduces the file’s SHA-256 ( 21f28e85…98eb5e ).

That import runs agent_framework_meta/__init__.py , where 1.26.1 appends a hook to the otherwise clean file.

_start() sets _AF_TEL so child interpreters skip it, then forks and detaches with setsid() . The host process returns at once, so a test run or build shows no delay. Where fork is missing, it uses a daemon thread.

The same shape, a one-line .pth that imports a module which forks a collector, appeared in LiteLLM 1.107.0 in October.

The collector works through four sources.

Environment variables whose names contain any of 31 strings, including TOKEN , SECRET , KEY , AZURE , AWS , GITHUB , HF_ , OPENAI , NPM , PIP , SYSTEM and BUILD . The collector keeps up to 8,000 characters of each value.

Credential files , up to 60 under 256 KB each. These cover Azure CLI JSON under ~/.azure and / /*/.azure , pip.conf , .npmrc , .netrc , .git-credentials , Docker config.json , the Hugging Face token, the Azure AI Foundry configuration, and Azure DevOps self-hosted agent .credentials under _work , vss-agent and /mnt/azure_nvme_temp paths. It also takes /app/.env , /app/*.json , /workspace/.env and ~/.config/*/token*.json .

Other processes’ environments , from up to 300 /proc/ /environ files. On a shared or self-hosted runner, that reaches secrets belonging to other jobs.

New tokens it requests from the platform , covered in the section.

It also records the hostname, user, working directory and sys.argv .

Besides reading credentials already on disk, the code asks the platform to issue new ones. Rotating stored secrets does not cover those.

In an Azure DevOps pipeline, SYSTEM_ACCESSTOKEN and SYSTEM_OIDCREQUESTURI are enough to request a federated token for api://AzureADTokenExchange . That is the token a pipeline uses to sign in to Azure through a workload identity federation service connection.

On Azure compute, it asks the managed identity endpoint for an access token to each of these resources. It uses IDENTITY_ENDPOINT or MSI_ENDPOINT on App Service and Functions, and 169.254.169.254 elsewhere. It also pulls instance metadata.

499b84ac-1321-427f-aa17-267ca6975798 is the Azure DevOps resource ID. A workload with a managed identity hands over tokens for Resource Manager, Key Vault, Storage, Graph and Azure DevOps, scoped to whatever that identity can reach.

The endpoint is base64 in _ENC and decodes to hxxps://webhook[.]site/d381fd80-ec62-42ad-8f5c-d1b15103c9bb . _post() compresses the collected JSON with zlib, base64-encodes it and sends it with a 25-second timeout. It ignores every error.

The data goes to ?t=telemetry . A webhook.site bin is anonymous and needs no infrastructure, which leaves the URL as the only network indicator. Proxy and egress logs that show a POST to it mark the hosts that sent data.

What changed in 1.26.2

1.26.2 restores agent_framework_meta/__init__.py to the clean file. Its SHA-256 ( 5f04333f…49f1 ) matches the one in the 1.26.0 wheel. The stealer moves into a new top-level module that starts itself on import.

As with 1.26.1, hashing the one line plus a newline reproduces the published SHA-256 of the startup file ( 325e7e9f…7f452f93 ).

A check for 1.26.1’s file names or hashes misses 1.26.2. The webhook is the one indicator both .

The new GitHub Actions block requests ID tokens for the two audiences Azure federated credentials accept. Any job with id-token: write that installed 1.26.2 handed both over.

The rest of the collector stays the same. The release went up after PyPI removed 1.26.1, so whoever controls the publishing path still held it at 21:08.

Check your environments

Look for the versions in lockfiles and requirement files.

On machines, images and runners, look for either startup file without starting the environment’s Python. Starting it would run the stealer again.

Treat every secret reachable from an environment that installed either version as exposed. That covers environment secrets, Azure CLI sessions, and Azure DevOps personal access tokens and service connections. It also covers PyPI, npm, NuGet, Docker and Hugging Face tokens, git credentials, and secrets of other jobs on the same self-hosted runner. Rotation does not undo the tokens it had issued. Review sign-in and activity logs for the managed identities and federated credentials that environment could use, from the install time onward.

Lock the whole dependency tree with hashes. A pin on agent-framework alone leaves its four sibling dependencies free to update. pip-compile --generate-hashes or uv lock records the versions you have now. Hold off on any new release of agent-framework or the five sibling projects until Microsoft removes vibiret and confirms the releases are clean.

Indicators of compromise

agent-framework on PyPI ⁠ (opens in new tab)

Microsoft Agent Framework documentation ⁠ (opens in new tab)

Extracted Entities