threatdeck
Live 13:45 UTC ·

Detection library

KQLHunting query: tune before alertingShadow AI and AI-powered attackers

Endpoint process talking to an AI API that is not on the approved list

Shadow AI on endpoints shows up as scripts, CLIs, IDE extensions and unknown binaries calling model APIs directly with personal keys, bypassing an approved gateway. GTIG also reports malware that calls Gemini and Hugging Face APIs at runtime. This hunt summarises processes that connect to major AI API hosts, Azure OpenAI (*.openai.azure.com) and Bedrock runtime endpoints, excluding an approved-process list you maintain.

Log source
Microsoft Defender for Endpoint: DeviceNetworkEvents
Techniques
LLM02 Sensitive Information Disclosure · AML.T0096 AI Service API
MITRE ATT&CK
T1567Exfiltration Over Web Service
Reviewed
2026-11-10

Query

let ai_api_hosts = dynamic(["api.openai.com", "api.anthropic.com", "generativelanguage.googleapis.com", "api.deepseek.com",
                       "openrouter.ai", "router.huggingface.co"]);
let approved_processes = dynamic(["chrome.exe", "msedge.exe", "firefox.exe", "Google Chrome Helper", "Safari",
                                  "claude", "Claude", "Claude.exe", "Cursor", "Cursor.exe", "Code", "Code.exe"]);
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where ActionType == "ConnectionSuccess" and isnotempty(RemoteUrl)
| extend RemoteHost = tolower(tostring(parse_url(iff(RemoteUrl contains "://", RemoteUrl, strcat("https://", RemoteUrl))).Host))
| where RemoteHost in (ai_api_hosts) or RemoteHost endswith ".openai.azure.com"
     or RemoteHost matches regex @"^bedrock-runtime\.[a-z0-9-]+\.amazonaws\.com$"
| where InitiatingProcessFileName !in~ (approved_processes)
| summarize Connections = count(), Devices = dcount(DeviceName), Hosts = make_set(RemoteHost),
            FirstSeen = min(Timestamp), SampleCommandLine = take_any(InitiatingProcessCommandLine)
    by InitiatingProcessFileName, InitiatingProcessFolderPath, InitiatingProcessVersionInfoCompanyName
| order by Devices asc, Connections desc

Expected false positives

  • Approved internal tools and SDK-based apps not yet in the allowlist
  • Developer workstations testing integrations with company keys

Sources

Reviewed against vendor documentation, not tested in your environment. Defensive use only.

Following

Follow the vendors, products, AI tools, techniques and actors you care about. Matching stories, CVEs and exploited bugs are marked, a Following tab appears in the feed, and returning visits show what changed. Saved only in this browser.

Presets

Get updates

A personal RSS feed of new stories on everything you follow. Paste it into any feed reader, Slack or Teams RSS app.