Defend · 40 queries
Detection & hunting library
Queries that find AI-specific abuse in cloud, endpoint, identity and LLM application logs. Each one cites the research it implements. Treat “hunt” queries as starting points: tune them on your data before alerting.
Download packs: Sigma · KQL · SPL · ES|QL · CloudTrail Lake SQL · osquery · YARA · Sentinel analytics rules (ARM, 4)
KQL and SPL packs include Microsoft Sentinel and Splunk versions of the Bedrock CloudTrail rules. 39 of 40 queries map to MITRE ATT&CK Enterprise v20.1; Sigma rules carry attack.* tags.
Cloud AI abuse: Amazon Bedrock (LLMjacking)
- Bedrock invocation probing: failed model calls across models or regions
- Bedrock model-access enablement APIs called with a long-term access key
- Bedrock model invocation logging configuration deleted
- Bedrock reconnaissance burst: model, availability and logging checks in one hour
- Bedrock calls from a long-term access key with a browser, empty or scripting user agent
- Bedrock invocation volume far above a principal's own baseline
- One source IP using several AWS principals against Bedrock
Cloud AI abuse: Azure OpenAI, Vertex AI, self-hosted
- Azure OpenAI / AI Foundry account keys listed by a new caller
- Azure OpenAI model deployment or Responsible AI policy changed
- Azure OpenAI data-plane requests from a caller IP not seen in the previous two weeks
- Vertex AI inference from a principal not seen in the previous two weeks
- Ollama API (port 11434) listening on all interfaces or accepting public connections
AI coding agents on endpoints
- AI coding agent CLI started with an approval-bypass flag
- AI CLI run non-interactively with a bypass flag by a script interpreter (s1ngularity pattern)
- Command spawned by an AI coding agent references credential files
- AI coding agent spawns a shell that pipes a download into an interpreter
- Destructive cloud or cluster CLI command launched under an AI coding agent
- Shell startup file modified by a script runtime or by an AI agent's child process
- s1ngularity (Nx) artifacts: AI CLI bypass runs in shell history and /tmp/inventory.txt
- YARA: s1ngularity (Nx) telemetry.js payload and shell-profile shutdown line
- Claude Code telemetry: Bash tool commands that read credential stores
- Claude Code telemetry: sessions running in bypassPermissions mode
- AI agent transcripts or credential stores held open by an unexpected process
MCP servers and agent configuration
- AI tool MCP or agent configuration written by a process other than the tool
- AI tool MCP configuration file modified by an unexpected process (Sigma, macOS/Linux)
- Claude Code / VS Code project persistence files from the Mini Shai-Hulud worm
- New MCP server registered through an agent CLI (claude / codex / gemini mcp add)
- YARA: MCP or hook config that launches a script from a hidden home directory or pipes curl into a shell
- YARA: SANDWORM_MODE npm worm and its McpInject rogue MCP server
- MCP server process started by an AI client connects to a rare internet destination
Prompt injection and exfiltration in LLM app logs
Shadow AI and AI-powered attackers
- Entra ID user or admin consent granted to an AI application
- Endpoint process talking to an AI API that is not on the approved list
- Web proxy: requests to AI model APIs that do not come from the approved AI gateway
- Windows script host or HTA connects to an LLM API (PROMPTFLUX pattern)
- PROMPTFLUX artifacts: thinking_robot_log.txt or VBScript written to Startup by a script host
- Machine-paced burst of scanning and credential tools launched under an AI agent
Queries are reviewed against vendor documentation but not tested in your environment. Defensive use only. Adapted rules carry their original licence attribution.