{
  "type": "NewsArticle",
  "url": "https://sonomos.ai/newsroom/microsoft-agent-framework-pypi-credential-stealer-33-minutes/",
  "slug": "microsoft-agent-framework-pypi-credential-stealer-33-minutes",
  "title": "Two malicious releases of Microsoft's Agent Framework hit PyPI with a credential stealer",
  "summary": "Versions 1.26.1 and 1.26.2 of Microsoft's agent-framework package on PyPI carried code that ran on every Python start and sent cloud and CI/CD secrets to an outside address. Both were removed within about 45 minutes.",
  "section": "Cybersecurity",
  "category": "cybersecurity",
  "format": "analysis",
  "tags": [
    "AI agents",
    "Supply chain attack",
    "Credential theft",
    "DevSecOps"
  ],
  "published_at": "2026-11-21T14:12:00.000Z",
  "updated_at": "2026-11-21T14:12:00.000Z",
  "word_count": 661,
  "publisher": {
    "name": "Sonomos Newsroom",
    "url": "https://sonomos.ai/newsroom/",
    "standards": "https://sonomos.ai/newsroom/standards/",
    "organization": {
      "name": "Sonomos",
      "url": "https://sonomos.ai/"
    }
  },
  "follows_up": null,
  "followed_by": [],
  "sources": [
    {
      "number": 1,
      "title": "Microsoft's agent-framework PyPI package compromised with credential stealer",
      "publisher": "Socket",
      "url": "https://socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer",
      "published": "2026-11-17",
      "accessed": "2026-11-21"
    },
    {
      "number": 2,
      "title": "Two malicious Agent Framework releases hit PyPI in 33 minutes",
      "publisher": "Aikido Security",
      "url": "https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes",
      "published": null,
      "accessed": "2026-11-21"
    }
  ],
  "verification": {
    "method": "automated-source-check",
    "checked_at": "2026-11-21T14:12:00.000Z",
    "description": "https://sonomos.ai/newsroom/standards/",
    "claims": [
      {
        "claim": "Versions 1.26.1 and 1.26.2 of the agent-framework package on PyPI contained .pth startup hooks that ran a credential collector.",
        "source": 1,
        "source_url": "https://socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer"
      },
      {
        "claim": "Aikido's timeline puts 1.26.1 on PyPI at 20:35 UTC on November 17, 1.26.2 33 minutes later, and both removed by 21:20 UTC.",
        "source": 2,
        "source_url": "https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes"
      },
      {
        "claim": "The package gets about 190,000 downloads a month, and Aikido says the attacker used valid publishing credentials whose origin is unknown.",
        "source": 2,
        "source_url": "https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes"
      },
      {
        "claim": "Version 1.26.2 restored the original __init__.py, so checking only that file misses it, and added GitHub Actions OIDC token requests.",
        "source": 1,
        "source_url": "https://socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer"
      }
    ]
  },
  "corrections": [],
  "body_markdown": "Two malicious versions of agent-framework, Microsoft's Python package for building AI agents, were published to PyPI on November 17 and carried code that collected cloud, source-control and CI/CD secrets and sent them to an outside web address. According to [Aikido Security's timeline](https://www.aikido.dev/blog/two-malicious-agent-framework-releases-hit-pypi-in-33-minutes), version 1.26.1 appeared at 20:35 UTC, 1.26.2 followed 33 minutes later, and both were gone by 21:20 UTC.\n\nThe compromise was analysed by [Socket's research team](https://socket.dev/blog/agent-framework-pypi-package-compromised-with-credential-stealer), which lists the two affected versions as 1.26.1 and 1.26.2.\n\n## What did the malicious versions do?\n\nBoth versions used Python `.pth` files, which the interpreter processes at startup, to launch a credential collector. Aikido says that means the code ran whenever Python started, whether or not the package was ever imported. On Linux and macOS the payload forks into a detached background process; on Windows it runs as a daemon thread.\n\nSocket and Aikido describe the collection in similar terms:\n\n- environment variables whose names look secret-like, and, per Aikido, values from up to 300 other processes read through `/proc`;\n- credential and configuration files for Azure, Azure DevOps agents, pip, npm, Git, Docker, Hugging Face and application `.env` files;\n- fresh tokens requested rather than only copied: Azure managed-identity tokens (Aikido says for 12 Azure resources) and Azure DevOps OIDC tokens.\n\nThe data was compressed, Base64-encoded and sent by HTTPS POST to a webhook.site address. Socket notes that this encoding adds no confidentiality beyond HTTPS.\n\n## How do the two versions differ?\n\n| | 1.26.1 | 1.26.2 |\n|---|---|---|\n| Startup hook | `agent_framework_meta.pth`, which loads a modified `agent_framework_meta/__init__.py` | `af_runtime_diag.pth`, which loads `af_runtime_diag.py` |\n| Original `__init__.py` | Modified | Restored unchanged, so checking only that file misses this version |\n| Added targeting | One extra Azure DevOps agent credentials path | GitHub Actions OIDC tokens and wider GitHub-related targeting |\n| Credential file limit (Aikido) | 60 | 80 |\n\n## How did the attacker publish them?\n\nAikido says the 1.26.1 wheel appears to have been unpacked, edited by hand and re-uploaded, and that the attacker used valid publishing credentials. It says how the attacker obtained them is not known. Neither source quotes a statement from Microsoft; Socket's write-up gives no removal timeline, and Aikido's page contains no maintainer statement.\n\n## What does it mean for people who installed it?\n\nAikido sets out what its analysis implies. Because the payload targets build and deployment identities, any secret reachable from a machine that installed either version, including CI runners and container images built since November 17, is treated as exposed. Removing the package stops future execution but does not undo data already sent. It recommends pinning `agent-framework==1.26.0`, checking `site-packages` for either `.pth` file, reviewing Entra ID sign-in logs for the service principals and federated credentials pipelines use, and searching proxy and DNS logs for connections to `webhook[.]site`. Socket's recommendations match: avoid both versions, remove them and rotate possibly exposed credentials.\n\nThese are the vendors' recommendations; neither source cites a legal notification duty. Whether a given organisation has one depends on what data its exposed credentials could reach.\n\n## Why does it matter that this is an AI framework?\n\nAgent frameworks tend to run where credentials are plentiful: developer machines and pipelines that hold cloud identities, model-provider keys and Hugging Face tokens. The package gets about 190,000 downloads a month, according to Aikido. The incident is a software supply-chain compromise rather than a flaw in a model, but it shows how the tooling around AI agents becomes a path to the secrets those agents use. For how agents interact with private data, see [AI agents and data privacy](https://sonomos.ai/blog/ai-agents-data-privacy-2026/); for the model-side version of the problem, see the glossary entry on [prompt injection](https://sonomos.ai/glossary/prompt-injection/).\n\nEarlier this month the newsroom covered a related pattern in [the Fireworks AI breach](https://sonomos.ai/newsroom/fireworks-ai-breach-notion-ai-chat-transcripts-llmjacking/), where credentials and datasets held by an AI infrastructure provider were taken.\n\n## What is unresolved?\n\nThe sources do not establish how the publishing credentials were obtained, how many machines installed the versions in the roughly 45-minute window, or whether any stolen secrets were used. Microsoft's own advisory is not cited here because the sources opened for this story did not link one.",
  "links": {
    "html": "https://sonomos.ai/newsroom/microsoft-agent-framework-pypi-credential-stealer-33-minutes/",
    "markdown": "https://sonomos.ai/newsroom/microsoft-agent-framework-pypi-credential-stealer-33-minutes/index.md",
    "json": "https://sonomos.ai/newsroom/microsoft-agent-framework-pypi-credential-stealer-33-minutes/index.json",
    "image": "https://sonomos.ai/og/newsroom/microsoft-agent-framework-pypi-credential-stealer-33-minutes.png"
  }
}
