The SANS Internet Storm Center highlighted Numbat, an AI agent observability project, in a September diary entry — and while the news item itself is brief, the signal behind it is one of the most important defensive themes of 2025–2026: AI agents are now privileged actors inside enterprise environments, and almost nobody is watching them.
Agentic AI — LLM-driven systems that autonomously execute shell commands, call tools via the Model Context Protocol (MCP), read and write files, browse the web, and chain actions together — has moved from demo to production. Developers run Claude Code, Cursor, Windsurf, and custom LangChain/CrewAI agents on endpoints. Platform teams deploy agents into CI/CD pipelines and cloud workloads. Every one of these agents is, from a defender's perspective, a semi-autonomous process with delegated credentials, tool access, and an attacker-controllable instruction channel: the prompt.
The risk surface is concrete and actively exploited in the wild:
- Prompt injection (direct and indirect) causing agents to exfiltrate data or execute attacker-chosen tool calls — now a standard technique in red team engagements and observed in real incidents involving MCP-connected agents.
- Malicious MCP servers and supply-chain abuse — trojanized tool servers and poisoned package installs (
npx/uvx-fetched MCP servers) delivering persistent code execution under a developer's identity. - Shadow AI — unsanctioned agents transmitting source code, customer records, and credentials to external LLM endpoints, bypassing DLP because the traffic is legitimate HTTPS to legitimate domains.
- Credential and token theft — agent configuration files (
mcp.json,.claude.json, environment files) that store API keys and OAuth tokens in plaintext on disk.
Numbat's premise — tracing, logging, and monitoring what agents actually do (tool calls, prompts, model I/O, execution chains) rather than just what the host does — is exactly the telemetry layer SOCs are missing. This post breaks down the threat model, and gives you deployable detection content for agent abuse whether or not you adopt a dedicated observability tool.
Technical Analysis
What Numbat-style observability provides
AI agent observability platforms (Numbat, LangSmith, Arize, OpenLLMetry/OpenTelemetry GenAI conventions) instrument the agent runtime to capture:
- Traces/spans per agent step: prompt in, model response out, tool selected, tool arguments, tool result.
- Tool-call logs — the single most valuable forensic artifact in an agent compromise, equivalent to process command lines for a host intrusion.
- Token/cost telemetry — sudden cost or token spikes are a leading indicator of prompt-injection-driven loops and data exfiltration via model responses.
- Session lineage — which user, host, and credential set initiated an agent session.
The attack chain defenders must assume
From an IR perspective, a compromised agent looks like this:
- Injection: Attacker plants instructions in content the agent will ingest — a webpage, a GitHub issue, an email, a shared document, a poisoned MCP tool description.
- Hijack: The agent's planner follows attacker instructions; tool calls deviate from the user's task.
- Execution: The agent invokes real capabilities —
bash,python, file writes, HTTP requests, MCP tools — under the user's identity and credentials. On the endpoint this appears as child processes of the agent runtime (node,python,claude,cursor) or as network connections initiated by those processes. - Exfiltration / persistence: Data leaves via the model API itself (embedded in prompts) or via attacker infrastructure; persistence lands via modified agent configs, cron/scheduled tasks created by the agent, or a newly installed malicious MCP server.
Exploitation status
This is not theoretical. Prompt injection against tool-using agents and malicious MCP server packages have been demonstrated publicly and observed in incident response engagements throughout 2025 and into 2026. MCP's default posture — servers fetched and executed on demand via npx/uvx, tool descriptions trusted implicitly, configs storing secrets in plaintext — makes developer workstations a soft initial-access vector. There is no single CVE here; this is an architectural exposure class, which is precisely why behavioral detection and observability matter more than signature patching.
Detection & Response
The detections below target the observable host- and network-level behaviors of agent compromise: agent runtimes spawning unexpected child processes, on-demand MCP package execution, agent config/credential tampering, and unsanctioned LLM API egress.
Sigma Rules
---
title: AI Agent Runtime Spawning Shell or Script Interpreter
id: 3f2a9c41-7b8e-4d12-9a6f-5c1e8b2d4a90
status: experimental
description: Detects AI agent runtimes (Claude Code, Cursor, MCP host processes) spawning shells or script interpreters. Legitimate for coding agents, but high-fidelity when combined with unexpected parent, user context, or off-hours execution. Tune the parent image list to agents sanctioned in your environment.
references:
- https://attack.mitre.org/techniques/T1059/
- https://isc.sans.edu/diary/rss/33312
author: Security Arsenal
date: 2026/01/15
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\claude.exe'
- '\cursor.exe'
- '\windsurf.exe'
- '\node.exe'
- '\Code.exe'
selection_child:
Image|endswith:
- '\powershell.exe'
- '\pwsh.exe'
- '\cmd.exe'
- '\wscript.exe'
- '\cscript.exe'
- '\mshta.exe'
- '\curl.exe'
- '\certutil.exe'
condition: selection_parent and selection_child
falsepositives:
- Developer agents legitimately running build/test commands; baseline per-user and alert on deviation
level: medium
---
title: MCP Server Installed via npx or uvx with Execution Policy Bypass
id: 8c4d1e72-3a56-4f89-b2d7-9e0a6c4f1b35
status: experimental
description: Detects on-demand package execution (npx, uvx) pulling and running MCP servers or scripts with bypass flags, encoded commands, or download cradles. A common delivery mechanism for trojanized MCP tool servers.
references:
- https://attack.mitre.org/techniques/T1105/
- https://isc.sans.edu/diary/rss/33312
author: Security Arsenal
date: 2026/01/15
tags:
- attack.command_and_control
- attack.t1105
- attack.t1059
logsource:
category: process_creation
product: windows
detection:
selection_img:
Image|endswith:
- '\npx.cmd'
- '\npx.exe'
- '\uvx.exe'
- '\uv.exe'
- '\bunx.exe'
selection_flags:
CommandLine|contains:
- '-y '
- '--yes'
- 'mcp'
- 'iwr '
- 'Invoke-WebRequest'
- 'DownloadString'
- '-enc '
- 'FromBase64String'
condition: selection_img and selection_flags
falsepositives:
- Developers installing legitimate MCP servers; alert on first-seen package names per host
level: high
---
title: Agent Configuration or Credential File Modified Outside Install Window
id: 5b7e3a18-2c94-4d60-8f1a-7d3c9e5b6a42
status: experimental
description: Detects writes to AI agent configuration files that frequently contain MCP server definitions, API keys, and OAuth tokens. Unexpected modification can indicate malicious MCP server registration or token theft staging.
references:
- https://attack.mitre.org/techniques/T1552/
- https://isc.sans.edu/diary/rss/33312
author: Security Arsenal
date: 2026/01/15
tags:
- attack.credential_access
- attack.t1552.001
- attack.persistence
logsource:
category: file_event
product: windows
detection:
selection:
TargetFilename|contains:
- '\.claude.json'
- '\.claude\'
- 'mcp.json'
- '\.cursor\mcp.json'
- '\.config\claude\'
- '\continue\config.json'
filter_installer:
Image|endswith:
- '\claude.exe'
- '\cursor.exe'
- '\msiexec.exe'
condition: selection and not filter_installer
falsepositives:
- Users editing MCP configuration manually; correlate with change tickets and version control
level: high
KQL (Microsoft Sentinel / Defender)
This hunt surfaces unsanctioned LLM API egress (shadow AI) plus agent runtimes spawning high-risk child processes — the two highest-signal behaviors for agent compromise in an environment where agent use is not yet baselined.
let llm_endpoints = dynamic(["api.openai.com", "api.anthropic.com", "api.cohere.com", "generativelanguage.googleapis.com", "api.mistral.ai", "openrouter.ai", "api.groq.com", "bedrock-runtime", "azure-api.net"]);
// Part 1: Shadow AI — unexpected processes connecting to LLM API endpoints
DeviceNetworkEvents
| where TimeGenerated > ago(24h)
| where RemoteUrl has_any (llm_endpoints) or RemoteUrl contains "openai"
| extend ProcessName = tolower(split(InitiatingProcessFileName, ".")[0])
| summarize FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated), ConnectionCount=count(), Devices=dcount(DeviceId), DeviceList=make_set(DeviceName, 20) by InitiatingProcessFileName, InitiatingProcessCommandLine, RemoteUrl, InitiatingProcessAccountName
| order by ConnectionCount desc
;
// Part 2: Agent runtimes spawning shells/scripting engines or network tools
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where InitiatingProcessFileName has_any ("claude.exe", "cursor.exe", "windsurf.exe", "node.exe", "uvx.exe", "npx.cmd")
| where FileName has_any ("powershell.exe", "pwsh.exe", "cmd.exe", "curl.exe", "certutil.exe", "mshta.exe", "rundll32.exe")
or ProcessCommandLine has_any ("FromBase64String", "DownloadString", "-enc", "Invoke-Expression")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, SHA256
| order by TimeGenerated desc
Velociraptor VQL
Use this artifact to sweep a fleet for agent installations, their MCP/config files (which frequently contain plaintext credentials), and currently running agent processes — ideal for scoping shadow AI and locating trojanized MCP server registrations during an IR engagement.
-- Inventory AI agent runtimes and their configuration files for credential exposure and rogue MCP servers
SELECT
process.Pid AS Pid,
process.Name AS ProcessName,
process.CommandLine AS CommandLine,
process.Username AS Username
FROM pslist()
WHERE CommandLine =~ '(?i)claude|cursor|windsurf|mcp|uvx|npx'
LET configs = SELECT
FullPath,
Size,
Mtime AS Modified
FROM glob(
globs=[
'C:/Users/*/.claude.json',
'C:/Users/*/.claude/**',
'C:/Users/*/.cursor/mcp.json',
'C:/Users/*/AppData/Roaming/Claude/**',
'C:/Users/*/.config/claude/**',
'C:/Users/**/mcp.json'
],
accessor='ntfs'
)
SELECT FullPath, Size, Modified,
read_file(filename=FullPath, length=4096) AS ConfigHead
FROM configs
Remediation & Hardening Script
The script below inventories agent runtimes and MCP configurations on Windows endpoints, flags plaintext-looking secrets in agent configs, and reports LLM API connections — giving you a fast shadow-AI and exposure baseline.
# AI Agent Inventory & Exposure Audit — run elevated, output to CSV for central collection
$report = @()
# 1) Find installed agent runtimes and MCP-related processes
$agentProcs = Get-CimInstance Win32_Process | Where-Object {
$_.CommandLine -match '(?i)claude|cursor|windsurf|uvx|npx|mcp-server'
}
foreach ($p in $agentProcs) {
$report += [pscustomobject]@{
Type='Process'; Host=$env:COMPUTERNAME; Path=$p.ExecutablePath
Detail=$p.CommandLine; Risk='Review - active agent/MCP process'
}
}
# 2) Locate agent config files and flag embedded secrets (never print the secret itself)
$users = Get-ChildItem 'C:\Users' -Directory -ErrorAction SilentlyContinue
foreach ($u in $users) {
$configs = Get-ChildItem -Path $u.FullName -Recurse -Force -ErrorAction SilentlyContinue \
-Include '.claude.json','mcp.json','config.json' |
Where-Object { $_.FullName -match '(?i)claude|cursor|mcp|continue|windsurf' }
foreach ($c in $configs) {
$content = Get-Content $c.FullName -Raw -ErrorAction SilentlyContinue
$risk = if ($content -match '(?i)api[_-]?key|token|secret|Bearer') {
'HIGH - plaintext credential likely present in agent config'
} else { 'Info - agent config found' }
$report += [pscustomobject]@{
Type='Config'; Host=$env:COMPUTERNAME; Path=$c.FullName
Detail="Modified $($c.LastWriteTime)"; Risk=$risk
}
}
}
# 3) Audit active connections to LLM API endpoints
$llmHosts = 'api.openai.com','api.anthropic.com','api.cohere.com','openrouter.ai','api.mistral.ai'
foreach ($h in $llmHosts) {
$ips = (Resolve-DnsName $h -Type A -ErrorAction SilentlyContinue).IPAddress
if ($ips) {
Get-NetTCPConnection -State Established -ErrorAction SilentlyContinue |
Where-Object { $ips -contains $_.RemoteAddress } |
ForEach-Object {
$owner = (Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue).ProcessName
$report += [pscustomobject]@{
Type='Network'; Host=$env:COMPUTERNAME; Path=$h
Detail="Process: $owner"; Risk='Review - egress to LLM API'
}
}
}
}
$report | Export-Csv -Path "$env:TEMP\agent-exposure-audit.csv" -NoTypeInformation
Write-Output "Audit complete: $($report.Count) findings -> $env:TEMP\agent-exposure-audit.csv"
Remediation
There is no vendor patch for an architectural exposure class — remediation is posture management. Prioritized actions:
- Deploy agent observability before you need it. Whether Numbat, OpenTelemetry GenAI instrumentation, or a commercial platform, capture tool-call traces, prompts, and model I/O centrally. In an agent-compromise IR, the tool-call log is the difference between a two-hour and a two-week investigation. Ship these logs to your SIEM alongside endpoint telemetry.
- Inventory and govern. Know which agent runtimes and MCP servers are sanctioned. Everything else is shadow AI. Maintain an allowlist of MCP server packages with pinned versions and hashes — treat MCP servers like any other third-party dependency in your SBOM.
- Kill plaintext credentials in agent configs. Move API keys and OAuth tokens out of
mcp.json/.claude.json-style files into a secrets manager or OS credential store, and rotate any key found in a config file during your audit (assume exposure if the file ever left the host via backup, sync, or commit). - Constrain agent execution. Run agents in least-privilege contexts: dedicated service accounts, sandboxed containers or VMs, egress-filtered to approved API endpoints only, no standing access to production data stores or credential material.
- Control LLM egress. Route all sanctioned model traffic through an AI gateway/proxy with logging and DLP inspection; alert on direct-to-API connections from endpoints (see KQL above).
- Defend the prompt channel. Treat all external content an agent ingests as untrusted input: strip or quarantine instructions found in retrieved content, require human-in-the-loop approval for destructive or external-facing tool calls, and scope tool permissions per task rather than per session.
- Update your IR playbooks. Add agent-specific scoping questions: which agent ran, under whose identity, what tools were available, where are the traces, and what did the model actually send and receive.
The organizations that get hurt by agentic AI in 2026 won't be the ones that deployed it — they'll be the ones that deployed it without telemetry. Observability is the control that makes every other control verifiable.
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.