Analysis · Software supply chain

The agent-framework hack: why installing a package was enough to lose your cloud secrets

Two releases of Microsoft's agent-framework package on PyPI carried a credential stealer that ran every time Python started, whether or not anyone imported the package. The mechanism is an old, documented Python feature. The target was the place where agent tooling now lives: developer laptops and CI runners full of cloud credentials. Here is what happened, why it worked, and what to change.

AnalysisSumanta Mukhopadhyay8 min read7 sources
#news#security#ai#cloud
ANALYSIS · ANALYSIS · SOFTWARE SUPPLY CHAIN19 Nov 2026 · 21:15 GST

What happened

On 17 November, versions 1.26.1 and 1.26.2 of agent-framework, Microsoft's Python package for building AI agents, were published to PyPI with a credential stealer targeting Azure, Azure DevOps and GitHub Actions secrets1. Both have been removed, and Microsoft has said it is investigating2. Wiz identifies 1.26.0 as the latest safe version3.

Two details matter more than the headline. The releases appeared under the legitimate publisher rather than a lookalike name, and JFrog reports the attacker repacked the clean release rather than compromising Microsoft's build, which points to stolen publishing credentials4. And the two malicious versions went out within about half an hour of each other, the second moving the payload to a new file5. Anyone whose tooling upgraded automatically in that window got it.

Why installing was enough

The payload was delivered through a .pth file. Python's site module processes these path configuration files at start-up, and executes any line that begins with import6. It is a documented feature meant for setting up paths. It also means any installed package can run code every time Python starts, in every script, test run and notebook in that environment, without ever being imported4.

  1. PublishAttacker uploads a repacked release under the real publisher
  2. ResolveAn unpinned or loosely pinned install picks up the new version
  3. DropInstallation writes a .pth file into site-packages
  4. RunAny Python process on that machine executes it at start-up
  5. HarvestCloud, CI and token secrets are read from the environment and files
  6. ExfiltrateSecrets leave before anyone has imported the package
The dangerous step is not using the package. It is having it installed in an environment that holds secrets.

That changes the usual reasoning about risk. Teams often assume a dependency is only dangerous on the code paths that call it. Start-up hooks, install scripts and build plugins break that assumption: the risk is in the environment, not the call graph.

Why agent tooling is the target

Agent frameworks are installed where the valuable credentials are. Developers run them on laptops signed in to cloud consoles; CI pipelines run their tests with deployment credentials loaded; agents themselves are often given broad tokens so they can call tools. A package that sits in those environments is worth more to an attacker than almost any library in production, where secrets are usually narrower and better managed.

They are also young, fast-moving and upgraded eagerly. Teams building with agents want the newest release, so loose version ranges and automatic updates are common. That is exactly the window this attack used.

What to change in CI and developer environments

The CNCF's software supply chain paper treats build infrastructure as needing the same security as the production it builds for, and recommends single-use build workers so a compromise cannot persist or spread across builds7. Most of the fixes here follow from taking that seriously.

Illustration of a secure software factory: source repository, pipeline orchestrator and build workers pulling and linking dependencies, then application build, testing, artefact publishing with SBOM and metadata, signing infrastructure, artefact storage and deployment
The software factory: dependencies enter at build workers, which is where a poisoned package meets your secrets. Source: CNCF TAG Security, Software Supply Chain Best Practices · CC BY 4.0
ControlWhat it stopsCost
Lockfiles with hashes for every installSilently picking up a new releaseLow; needs a routine for updates
A cooling-off period before new releases are allowedInstalling a release in its first hours, when most poisoned versions are caughtLow; small delay on fixes
Separate install and secret-holding steps in CIStart-up hooks reading deployment credentials during testsMedium; pipeline changes
Short-lived, narrowly scoped CI credentialsStolen secrets being useful for long or broadlyMedium; identity federation work
Single-use build workersA compromise persisting across buildsMedium; often already available
Internal package mirror with policyUnreviewed packages reaching any environmentHigher; worth it at scale

The most effective single change is keeping deployment credentials out of any step that installs or runs third-party code. Tests do not need the keys to production.

For developers, the equivalent is not running agent experiments in the same environment, or with the same signed-in cloud session, as production administration. A disposable container or virtual environment with no standing credentials costs little and limits what a poisoned package can find.

If you installed an affected version

  • Find it: search lockfiles, CI logs and package caches for agent-framework 1.26.1 or 1.26.2.
  • Assume every credential reachable from those machines and runners is exposed, not just Azure and GitHub; reports describe the stealer reading environment variables and local configuration more broadly2.
  • Rotate first, then investigate: review cloud audit logs and CI histories for use of those credentials since 17 November.
  • Rebuild affected environments rather than cleaning them, and pin to a verified version.

The CTO's take

This is the same lesson as the recent vendor access incidents, one layer down: trust granted for convenience becomes access for attackers. Package registries are run by the publishers you depend on, and their credentials can be stolen like anyone's. The defence is to assume a dependency will eventually be poisoned and design so that, when it happens, it finds nothing worth taking. Related reading: AI model supply chain security, the runtime inventory case study and the tech news for 19 November.

If you want a review of how your CI and agent tooling handle secrets, or a technical due diligence view of a team's supply chain, I am a fractional CTO and AI architect based in India, the United States and the UAE, working globally. You can analyse your challenge and bring the result to a call.

References
  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
FAQ

Common questions

What is a .pth file?

A path configuration file that Python's site module processes at start-up. Lines that begin with import are executed, which is meant for setting up paths but means any installed package can run code whenever Python starts.

Was Microsoft's build pipeline compromised?

Reports differ in detail. JFrog reports the attacker repacked the clean release locally rather than compromising the build, and the malicious versions appeared under the legitimate publisher, which points to stolen publishing credentials. Microsoft has said it is investigating.

What should we do if we installed 1.26.1 or 1.26.2?

Treat the machine as compromised: rotate every credential it could reach, including cloud, CI, registry and API keys, review cloud and CI logs for use of those credentials, rebuild the environment, and pin agent-framework to 1.26.0 or a later verified release.

Keep reading

Related

Open to advisory, fractional CTO & select builds

Let's talk about what you're building.

The fastest route is a free 30-minute call. Prefer to write? Send a message and I'll reply personally within two business days.

Start a conversation

How would you like to reach me?

Book a 30-min callFastest. Pick any open slot on my calendar.→ Write in GmailOpens a pre-filled draft in your browser.→ Use my email appOutlook, Apple Mail or your default client.→

I reply personally within two business days. Time zones from the Americas and Europe to the Middle East and Asia-Pacific.