Two malicious versions of Microsoft's official Agent Framework Python package were published to PyPI and engineered to harvest cloud credentials and sensitive data from developer machines and build pipelines. If you or your CI/CD infrastructure installed or updated agent-framework during the exposure window, assume credential compromise and rotate secrets immediately.
Introduction
Supply-chain attacks against package registries are no longer opportunistic — they are a primary intrusion vector, and this incident is a textbook example of why. Attackers gained the ability to publish malicious versions of agent-framework, Microsoft's official Python package for its Agent Framework, directly to PyPI. Two poisoned releases were pushed before detection. Any developer workstation, build agent, container build, or deployment pipeline that resolved the package during that window executed attacker-controlled code with the full privileges of the installing user or service account.
The payload's objective was credential theft: cloud provider credentials (the high-value targets being AWS access keys, Azure service principal secrets, and GCP service account keys), environment variables, tokens, and other sensitive material resident on the host. In modern environments, that is not a developer inconvenience — it is a direct path to cloud tenant compromise. A single poisoned build runner with a long-lived AWS role credential or an Azure service principal secret in its environment can hand an attacker the keys to production infrastructure.
Defenders need to treat this with incident-response urgency, not patch-Tuesday cadence. The questions that matter right now: Did we install it? When? On which hosts and pipelines? And what credentials were reachable from those contexts? The rest of this post walks through answering those questions and closing the exposure.
Technical Analysis
Affected product: Microsoft Agent Framework Python package (agent-framework) distributed via PyPI. Two malicious versions were published; consult the Microsoft security advisory and the BleepingComputer coverage (source URL below) for the exact poisoned version strings, and treat any install or upgrade performed during the disclosed exposure window as suspect until verified.
Affected platforms: Any platform running Python with PyPI access — developer workstations (Windows, macOS, Linux), CI/CD runners (GitHub Actions, Azure DevOps, GitLab), Docker image builds, and serverless build environments. The blast radius is defined by where pip install agent-framework (or an upgrade) executed, not by OS.
How the attack works: This is a classic registry compromise rather than typosquatting — the legitimate package itself was poisoned, which means allowlists keyed on package name would not have saved you. The malicious versions carried attacker-controlled code that executes at install time (via install hooks) and/or at import time when the package is loaded. From a defender's perspective, the attack chain is:
pip install -U agent-frameworkresolves to a poisoned version on PyPI.- Install/import-time code executes under the installing user or build service account context.
- The payload enumerates high-value credential locations: environment variables (
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY,AZURE_CLIENT_SECRET,GOOGLE_APPLICATION_CREDENTIALS, GitHub tokens), and on-disk credential stores (~/.aws/credentials,~/.azure/,~/.config/gcloud/,~/.kube/config). - Harvested material is staged and exfiltrated over outbound HTTP/HTTPS to attacker-controlled infrastructure — which blends into normal developer egress traffic.
Exploitation status: Confirmed active — this was not a theoretical or proof-of-concept event. Malicious versions were live on PyPI and downloadable by anyone resolving the package during the exposure window. There is no CVE assigned; the identifier that matters operationally is the package name plus the malicious version set from the vendor advisory.
Why CI/CD is the crown jewel: Developer laptops are bad enough, but build agents typically hold broader, longer-lived credentials: cloud deployment roles, registry push tokens, signing keys, and artifact repository secrets. Ephemeral runners limit persistence but do nothing to prevent credential theft at build time — the exfiltration happens in seconds, inside the job.
Detection & Response
This is a technical threat. The detections below target the behaviors that matter: package installation auditing, Python processes accessing credential stores, and install-time process/network anomalies. All rules assume you have Sysmon or equivalent process/file telemetry on endpoints and process logging on build agents.
---
title: Python or Pip Spawning Shell During Package Install
description: Detects pip/python package installation spawning shell or scripting children, consistent with malicious install-time hooks in a compromised PyPI package such as the poisoned Microsoft Agent Framework releases.
references:
- https://www.bleepingcomputer.com/news/security/microsofts-agent-framework-pypi-package-compromised-to-steal-credentials/
- https://attack.mitre.org/techniques/T1195/002/
author: Security Arsenal
date: 2026/02/12
id: 3f7a91c2-8b4d-4e6a-9c21-7d5e0a1b2c3d
status: experimental
tags:
- attack.initial_access
- attack.t1195.002
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\pip.exe'
- '\python.exe'
- '\python3.exe'
- '\uv.exe'
selection_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\curl.exe'
- '\certutil.exe'
condition: selection_parent and selection_child
falsepositives:
- Packages with legitimate native build steps invoking compilers or shell commands
level: high
---
title: Python Process Accessing Cloud Credential Files
description: Detects Python processes accessing AWS, Azure, GCP, or Kubernetes credential stores, consistent with the credential-harvesting behavior of the compromised Agent Framework PyPI package. Legitimate SDK access typically comes from the calling application, not ad-hoc interpreter processes during installs.
references:
- https://www.bleepingcomputer.com/news/security/microsofts-agent-framework-pypi-package-compromised-to-steal-credentials/
- https://attack.mitre.org/techniques/T1552/001/
author: Security Arsenal
date: 2026/02/12
id: 8e2b4d6f-1a3c-4f5e-b7d8-9c0e1a2b3c4d
status: experimental
tags:
- attack.credential_access
- attack.t1552.001
logsource:
category: process_creation
product: windows
detection:
selection_image:
Image|endswith:
- '\python.exe'
- '\python3.exe'
- '\pip.exe'
selection_cli:
CommandLine|contains:
- '.aws\credentials'
- '.azure'
- 'gcloud'
- 'AWS_SECRET_ACCESS_KEY'
- 'AZURE_CLIENT_SECRET'
- 'GOOGLE_APPLICATION_CREDENTIALS'
condition: selection_image and selection_cli
falsepositives:
- Developer scripts and automation that legitimately read cloud credentials
level: high
---
title: Agent Framework Package Install or Upgrade Activity
description: Flags pip activity involving the agent-framework package to scope exposure to the compromised PyPI releases. Use for hunting and scoping, then reconcile versions against the vendor advisory.
references:
- https://www.bleepingcomputer.com/news/security/microsofts-agent-framework-pypi-package-compromised-to-steal-credentials/
author: Security Arsenal
date: 2026/02/12
id: 5c1d9e2a-6f7b-4a8c-9d0e-1f2a3b4c5d6e
status: experimental
tags:
- attack.initial_access
- attack.t1195.002
logsource:
category: process_creation
product: windows
detection:
selection:
CommandLine|contains: 'agent-framework'
CommandLine|contains|all:
- 'install'
falsepositives:
- Legitimate installs of unaffected versions
level: medium
For Sentinel/Defender environments, hunt process telemetry for package installs and Python interpreter behavior touching credential material. Run this across both workstation and build-agent device groups:
// Hunt: pip installs of agent-framework plus Python processes touching cloud credential stores
let Lookback = 30d;
let Installs =
DeviceProcessEvents
| where TimeGenerated > ago(Lookback)
| where ProcessCommandLine has "agent-framework" and ProcessCommandLine has "install"
| project InstallTime=TimeGenerated, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessCommandLine;
let CredAccess =
DeviceProcessEvents
| where TimeGenerated > ago(Lookback)
| where FileName in~ ("python.exe", "python3.exe", "pip.exe")
| where ProcessCommandLine has_any (".aws", ".azure", "gcloud", "AWS_SECRET_ACCESS_KEY", "AZURE_CLIENT_SECRET", "GOOGLE_APPLICATION_CREDENTIALS", "kube\\config")
| project CredAccessTime=TimeGenerated, DeviceName, AccountName, ProcessCommandLine;
union Installs, CredAccess
| sort by DeviceName, InstallTime desc
On Linux-heavy fleets and build runners ingested via Syslog/CEF, pivot to the Syslog and CommonSecurityLog tables with the same strings, and check outbound connections from build agents during install windows in DeviceNetworkEvents filtered on InitiatingProcessFileName =~ "python3".
For endpoint forensics and fleet-wide scoping, Velociraptor can enumerate installed versions and hunt for suspicious child processes of the Python interpreter in one sweep:
-- Scope agent-framework exposure and suspicious Python child processes across the fleet
LET installs = SELECT split(string=Stdout, sep='\n') AS Line
FROM execve(argv=['/bin/sh', '-c', 'pip show agent-framework 2>/dev/null | grep -i version; pip3 show agent-framework 2>/dev/null | grep -i version; ls -d /usr/lib/python3*/site-packages/agent_framework* /home/*/.local/lib/python3*/site-packages/agent_framework* 2>/dev/null'])
LET procs = SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ '(?i)(\.aws|credentials|\.azure|gcloud|SECRET_ACCESS_KEY|CLIENT_SECRET)'
AND (Name =~ '(?i)python|pip' OR Exe =~ '(?i)python')
SELECT * FROM installs
UNION ALL
SELECT * FROM procs
Remediation
Treat confirmed exposure as a security incident, not a software update. Execute in this order:
-
Scope exposure immediately. Inventory every host, container image, and CI/CD pipeline that installed or upgraded
agent-frameworkduring the exposure window. Query artifact registries and lockfiles (requirements.txt,poetry.lock,Pipfile.lock) — poisoned versions may be baked into images even if endpoints are clean. Use the PowerShell script below for Windows endpoints and the equivalentpip show/ lockfile checks on Linux runners. -
Remove the malicious versions. Uninstall the package from affected environments and rebuild any container images created during the window from a known-good base. Do not simply "upgrade past it" — reinstall from a verified clean source and confirm the installed version against the Microsoft advisory.
-
Rotate every reachable credential. This is non-negotiable. Any credential present on an exposed host — AWS keys and session tokens, Azure service principal secrets, GCP service account keys, GitHub/GitLab tokens, kubeconfig credentials, SSH keys, and CI/CD pipeline secrets — must be considered compromised and rotated. Prioritize cloud credentials and pipeline secrets; they carry the broadest blast radius.
-
Audit cloud and SaaS logs for misuse. Review AWS CloudTrail, Azure sign-in and audit logs, and GCP audit logs for anomalous use of the rotated credentials from the install timestamp forward. Look for API calls from unexpected ASNs/geographies, enumeration activity (
List*,Get*,Describe*), and new access key or role creation. -
Harden the software supply chain going forward:
- Pin dependencies by cryptographic hash (
pip install --require-hashes) so only verified artifacts can install. - Route all package resolution through an internal proxy/mirror (Artifactory, Nexus, Azure Artifacts upstream caching) with quarantine and malware scanning on new upstream versions.
- Enforce a cooling-off period (e.g., 7–14 days) before new package versions are promoted to production build pipelines — most registry compromises are caught and pulled within days, and this single control would have prevented most exposure here.
- Run
pip-auditor equivalent in CI to flag known-malicious versions. - Eliminate long-lived cloud credentials from build agents; use OIDC-based short-lived federation (GitHub Actions to AWS/Azure/GCP) so a poisoned build has nothing durable to steal.
- Pin dependencies by cryptographic hash (
-
Monitor advisories. Track the Microsoft security advisory and PyPI's security notices for the authoritative malicious version list and any additional compromised releases. Source coverage: https://www.bleepingcomputer.com/news/security/microsofts-agent-framework-pypi-package-compromised-to-steal-credentials/
The following PowerShell script checks Windows endpoints for the package, captures the installed version, and flags recent installs for incident scoping:
# agent-framework exposure check for Windows endpoints
# Run elevated; reconcile output against the vendor advisory's malicious version list
Write-Host "[*] Checking for agent-framework installations..." -ForegroundColor Cyan
# Check all Python launchers for the package
$pythonCmds = @("python", "py", "python3") | Where-Object { Get-Command $_ -ErrorAction SilentlyContinue }
foreach ($py in $pythonCmds) {
$result = & $py -m pip show agent-framework 2>$null
if ($result) {
Write-Host "[!] FOUND via '$py':" -ForegroundColor Red
$result | Out-String | Write-Host
}
}
# Search user site-packages for remnants after uninstall
$paths = Get-ChildItem -Path "$env:LOCALAPPDATA\Programs\Python", "$env:APPDATA\Python" -Recurse -Filter "agent_framework*" -Directory -ErrorAction SilentlyContinue
if ($paths) {
Write-Host "[!] Residual package directories found (verify clean removal):" -ForegroundColor Yellow
$paths.FullName
}
# Flag recent pip install events from PowerShell history for scoping
Write-Host "[*] Recent pip install commands in user history:" -ForegroundColor Cyan
Get-Content (Get-PSReadLineOption).HistorySavePath -ErrorAction SilentlyContinue |
Select-String -Pattern "agent-framework" -SimpleMatch
Write-Host "[+] If a version matching the vendor advisory's malicious list is present: isolate the host, rotate all reachable credentials, and open an IR ticket." -ForegroundColor Green
Related Resources
Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub
Is your security operations ready?
Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.