Blog

Elastic ships 143 detection rules for AI agents and LLM platforms

A fake MCP server copied every outgoing email to an attacker and the new rules catch that, along with coding agents running attacker commands, secrets pasted into prompts, and stolen keys running models on your bill.

Elastic 9.6 will ship 143 AI security detection rules. A coding agent runs with your shell and your files, along with your cloud keys. The rules cover agents hijacked into running attacker commands, malicious Model Context Protocol (MCP) servers, credentials pasted into prompts, jailbreaks, and stolen API keys used to run models at someone else’s expense. When that activity happens on a developer’s machine, Elastic Defend can kill the process outright.

In August 2025, malicious versions of the Nx build tool used a post-install script to collect credentials and invoke installed AI coding command line interfaces (CLIs) with safety checks bypassed, to help find sensitive files (GHSA-cxm3-wv7p-598c). An npm package impersonating a Postmark MCP server copied every outgoing email to an attacker (postmark-mcp, version 1.0.16). A compromised Amazon Q Developer extension release carried instructions telling the AI agent to delete local files and cloud resources (AWS-2025-015), although AWS confirmed that the payload failed on a syntax error.

The rules run in both Elastic detection engines, as prebuilt security information and event management (SIEM) rules in detection-rules and as Elastic Defend behavior rules in protections-artifacts. In this blog post, we cover the threat vectors that these rules address, the telemetry that each one needs, how coverage compares across AI vendors, and what to do with the alerts.

Figure 1: AI security detection coverage in Elastic 9.6, including where threats live and the rules that act on them.

Key takeaways

  • Elastic 9.6 will ship 143 production SIEM rules for AI security that cover coding agents, MCP servers, AI platforms, and the cloud services behind them.

  • Coverage spans Amazon Bedrock, OpenAI ChatGPT Enterprise, Anthropic, Google Cloud Vertex AI, and Microsoft Foundry, with comparable detections for each, wherever the provider's logs allow it.

  • Elastic Defend adds on-host prevention for Claude Code, Cursor, Codex, and other coding agents, stopping agent-driven persistence and malicious Cursor workspaces before they run.

  • The AI rules map to MITRE Adversarial Threat Landscape for Artificial-Intelligence Systems (ATLAS) and MITRE ATT&CK, so AI threat coverage can be measured against AI-specific techniques.

Where AI security detection rules fit: Agents, platforms, and cloud

AI risk lives in multiple places. A coding agent runs on a developer laptop, the models it calls run in a cloud AI platform, and the keys, guardrails, and agents behind those models are managed through a cloud control plane. The Elastic 9.6 rules are organized around the threats that show up in each of those places and the telemetry that Elastic already collects from them.

What’s coming in the 9.6 AI security detection rule set

  • 143 production SIEM rules tagged Domain: GenAI. New rules in this release add OpenAI ChatGPT Enterprise, Google Cloud Vertex AI, and Microsoft Foundry to existing coverage for Amazon Bedrock, Anthropic, Azure OpenAI, and the endpoint.

  • Elastic Defend prevention for AI coding agents. Persistence via GenAI Tool kills a process started by a coding agent when it tries to install persistence on macOS or Windows, and Cursor Arbitrary Code Execution via PHP stops a malicious repository from running code when it’s opened in Cursor.

  • MITRE ATLAS mappings. All 143 AI SIEM rules map to MITRE ATLAS techniques alongside MITRE ATT&CK, and 9.6 will be the first release that carries those mappings into the product. A dedicated article covers the mappings in detail.

Where do AI threats show up, and what telemetry detects them?

No single log source covers all three layers, so the rules are built around the telemetry that each layer produces, including:

  • User AI tooling, where coding agents, MCP servers, and local model runtimes execute. Elastic Defend process, file, network, and domain name system (DNS) events give full process lineage from the agent to whatever it started. SIEM rules use this data (several also accept Sysmon, SentinelOne, Microsoft Defender XDR, and Auditd), alongside the Elastic Defend behavior rules.

  • AI platforms, where prompts and admin actions are logged, along with connector activity. Fleet integrations collect OpenAI ChatGPT Enterprise audit and conversation logs, Anthropic audit logs, Amazon Bedrock invocation and AgentCore runtime logs, Google Cloud Vertex AI prompt and audit logs, and Microsoft Foundry and Azure OpenAI logs.

  • The cloud control plane, where models, guardrails, agents, and keys are provisioned. AWS CloudTrail drives the Bedrock and AgentCore control plane rules.

Across these sources, the 143 SIEM rules break down by platform as follows:

Source

SIEM rules in Elastic 9.6

Amazon Bedrock

38

OpenAI ChatGPT Enterprise

34

Anthropic

29

Endpoint (Elastic Defend and third party)

18

Google Cloud Vertex AI

14

Microsoft Foundry and Azure OpenAI

10

Total

143

Rules that inspect prompt and response content need prompt logging turned on in the provider. Everything else works from the default audit streams.

Two detection engines: SIEM rules and Elastic Defend behavior rules

The 9.6 coverage comes from two engines that work differently and complement each other:

  • Prebuilt SIEM rules run in Kibana on a schedule against indexed data from any source: Elastic Defend, third-party endpoint tools, cloud audit logs, and AI platform logs. They detect and alert minutes after the data arrives and correlate across sources. They catch patterns that only appear over time, such as usage spikes or impossible travel. This is where cloud and AI platform threats are covered.

  • Elastic Defend behavior rules run on the host, inside the Elastic Defend agent, against live process, file, and network events. They evaluate as the activity happens and keep working when the host is offline. In prevent mode, they can kill the offending process before the action completes. This is where an attack carried out through a coding agent can be stopped mid-flight.

The two layers feed each other. Elastic Defend alerts land in the SIEM alongside everything else, and several SIEM rules run on Elastic Defend telemetry. Elastic Defend Alert from GenAI Utility or Descendant adds AI context to any Elastic Defend alert whose process tree leads back to an AI tool.

How attackers use AI coding agents to run their commands

A coding agent runs whatever its context tells it to run. If an attacker controls part of that context, through a poisoned README, issue, web page, or dependency, the agent becomes a signed, trusted process that executes the attacker's commands. The Nx compromise showed the other route, malware that simply starts the agent itself with approvals disabled. Detections here focus on how the agent was started and what it started:

On the endpoint, Elastic Defend can stop the activity outright. Persistence via GenAI Tool kills a process started by a coding agent when it writes a LaunchAgent, LaunchDaemon, Startup folder item, rc.local, or sudoers entry. For a full walkthrough, see Living off the coding agent.

Figure 2: GenAI CLI Started with Unsafe Permission Bypass alert raised when a coding agent CLI was launched with approvals disabled.

Credential theft through AI coding agents and prompts

Agents run with the developer's access to cloud credentials, Secure Shell (SSH) keys, keychains, and browser stores, and users routinely paste secrets into prompts. Both paths end with credentials somewhere that they shouldn’t be. GenAI Process Accessing Sensitive Files detects AI tools (such as Claude Code and Cursor) opening cloud credentials, SSH keys, keychains, browser credential stores, and shell profiles. Agents have legitimate reasons to touch some of these files, which is why the alert carries full process lineage for triage. Prompt-level coverage applies the same idea on every platform that logs content, including:

Figure 3: GenAI Process Accessing Sensitive Files alert raised when Cursor opened a cloud credentials file.

Figure 4: AWS Bedrock AgentCore Runtime Prompt Targeting Credentials or Instance Metadata alert, mapped to Cloud Instance Metadata API (T1552.005).

Agent supply chain: MCP servers, skills, hooks, and plugins

An agent's MCP servers, skills, hooks, and instruction files decide what it does in every future session. A single malicious entry gives an attacker persistence that looks like an ordinary configuration change, which is exactly how postmark-mcp worked. (See MCP Tools: Attack Vectors and Defense Recommendations for Autonomous Agents for background.) Unusual Process Modifying GenAI Configuration File flags unexpected processes writing to agent configuration, such as .cursor/mcp.json, .codex/hooks.json, and Claude SKILL.md files. Related coverage includes:

Figure 5: Unusual Process Modifying GenAI Configuration File alert raised when an unexpected process wrote to a Codex configuration file.

Detecting prompt injection, jailbreaks, and guardrail evasion

Jailbreaks try to talk the model out of its safety policy. Guardrail evasion goes around it, either by calling models without a guardrail attached or by changing the guardrail itself. Platform rules use the provider's own verdicts and the prompt text. Examples include:

Figure 6: AWS Bedrock Invocations without Guardrails Detected by a Single User Over a Session alert.

Figure 7: OpenAI ChatGPT Enterprise Jailbreak Prompt Heuristics alert raised when a user message combined multiple jailbreak techniques.

When an AI agent gets cloud tools and IAM roles

Managed agent platforms give models real tools: code interpreters, browsers, file systems, and identity and access management (IAM) roles. That turns a successful injection into cloud access. AWS Bedrock High Risk Filesystem or Execution Tool Invocation fires when a Bedrock agent calls execution-capable tools, and AWS Bedrock AgentCore Execution Role Used Outside Its Runtime fires when an agent's role credentials are used from outside the agent. First Time GCP Vertex AI Agent Engine Sandbox Code Execution by User and Source ASN covers the same pattern on Google Cloud.

Figure 8: AWS Bedrock High Risk Filesystem or Execution Tool Invocation alert, mapped to Command and Scripting Interpreter (T1059).

LLMjacking: Detecting stolen AI API keys and runaway usage

In LLMjacking, stolen AI credentials are resold or used to run large language models (LLMs) at the victim's expense, and attackers often test which models a key can reach before they start. The rules look for enumeration followed by invocation, sudden request and token spikes, and removal of spend controls. Examples include:

Figure 9: AWS Bedrock High-Frequency Single-Model Inference API Probing alert.

Data exfiltration through AI connectors and unsanctioned AI use

Connectors let assistants read and send mail, search file shares, and publish content. A compromised account or an injected instruction can move data out through tools that the business already approved. The new ChatGPT Enterprise rules watch connector activity directly, and the endpoint rules catch AI use outside approved channels. Examples include:

AI security detection coverage by platform: Bedrock, OpenAI, Anthropic, Google, Microsoft

Most organizations use more than one AI provider, so we built the same detections for each platform wherever the provider's logs make it possible. Secrets in prompts, along with abnormal usage volume, are covered on almost every platform, as are agent and tool activity. Where a cell is empty, the gap usually reflects the data that the provider exposes rather than a choice on our side. The Anthropic audit logs we ingest, for example, record administrative and account activity but not prompt content, so content-level rules apply to Bedrock, Vertex AI, Foundry, and ChatGPT Enterprise. Bedrock is the most complete column because it exposes invocation logs, guardrail verdicts, AgentCore runtime logs, and CloudTrail.

Figure 10: Prebuilt SIEM rule coverage by threat category and AI platform in Elastic 9.6.

What to do with AI security alerts

An alert is the starting point. Elastic Security gives you several ways to act on these detections, including:

  • Block on the endpoint. Run Elastic Defend in prevent mode so the behavior rules that we’ve covered in this post stop agent-driven persistence and malicious Cursor workspaces before they complete.

  • Triage with full lineage. Endpoint alerts carry the process tree from the agent to the child process, so you can see whether a human, an agent, or a package install started the activity.

  • Correlate with Attack Discovery. Attack Discovery groups related alerts (for example, an agent reading credentials followed by a cloud API call from a new location) into a single attack narrative. See our Hugging Face breach analysis for an example.

  • Prioritize with entity risk scoring. AI alerts raise the risk score of the host and user involved, which helps surface a developer workstation that’s accumulating suspicious agent activity.

  • Respond. Isolate a host, or kill a process. Trigger a workflow that rotates a leaked key or disables an AI platform account.

  • Tune and extend. Add exceptions for approved agents and MCP servers, and adjust thresholds to your usage. Use the building block rules as inputs for your own correlations and hunts.

How to enable AI security detection rules in Elastic 9.6

To get started:

  1. Once available, upgrade to Elastic 9.6, open Security > Rules > Detection rules (SIEM), and install or update the prebuilt rules.

  2. Filter by the Domain: GenAI tag, and enable the rules that match the data you collect.

  3. Add the integrations for the AI platforms you use (OpenAI ChatGPT Enterprise, Anthropic, Amazon Bedrock, Google Cloud Vertex AI, Microsoft Foundry, Azure OpenAI), and turn on prompt logging where you want content-level detections.

  4. Deploy Elastic Defend to developer endpoints in prevent mode to get the behavior protections.

References

The following sources were referenced throughout the above research:

  1. Detection Rules. https://github.com/elastic/detection-rules 

  2. Exploring the Hugging Face Breach: mapping AI agent tactics to Elastic Defend. https://www.elastic.co/security-labs/ai-agent-attack-detection-hugging-face-breach 

  3. Information Regarding Malicious "postmark-mcp" Package. https://postmarkapp.com/blog/information-regarding-malicious-postmark-mcp-package 

  4. Living off the coding agent: Two tales of tunnels and LaunchAgents. https://www.elastic.co/security-labs/coding-agent-launchagent-tunnel-detection 

  5. Malicious versions of Nx and some supporting plugins were published. https://github.com/nrwl/nx/security/advisories/GHSA-cxm3-wv7p-598c 

  6. MCP Tools: Attack Vectors and Defense Recommendations for Autonomous Agents. https://www.elastic.co/security-labs/mcp-tools-attack-defense-recommendations 

  7. MITRE ATLAS: Navigate threats to AI systems through real-world insights. https://atlas.mitre.org/

  8. Protections Artifacts. https://github.com/elastic/protections-artifacts 

  9. Security Update for Amazon Q Developer Extension for Visual Studio Code (Version #1.84). https://aws.amazon.com/security/security-bulletins/AWS-2025-015/

About Elastic Security Threat Command

Elastic Security Threat Command is the threat intelligence branch of Elastic Security dedicated to creating positive change in the threat landscape. Threat Command provides publicly available research on emerging threats with an analysis of strategic, operational, and tactical adversary objectives and then integrates that research with the built-in detection and response capabilities of Elastic Security.

Follow Elastic Threat Command on X @elasticseclabs, and check out our Elastic Security Threat Command research. 

Try it out on Elastic Security

Try these new capabilities on your deployment, or start a free trial. To learn more, visit Elastic Security. 

The release and timing of any features or functionality described in this post remain at Elastic's sole discretion. Any features or functionality not currently available may not be delivered on time or at all.

How helpful was this content?

Related Content

AlertZero in Elastic Security: Every alert answered. Every decision yours

AlertZero in Elastic Security: Every alert answered. Every decision yours

James Spiteri
Thinking fast about prompt injection: New System 1 models in Elastic

Thinking fast about prompt injection: New System 1 models in Elastic

Mika Ayenson
Mapping the AI threat landscape: MITRE ATLAS comes to Elastic Security

Mapping the AI threat landscape: MITRE ATLAS comes to Elastic Security

Davis Plumlee
From posture to root cause: Investigate OpenShift compliance with Elastic Agent Builder

From posture to root cause: Investigate OpenShift compliance with Elastic Agent Builder

Anand Vyas

Elastic Security Labs Newsletter