Splunk SPL for detecting Agentic AI

Detecting Agentic AI with Splunk: Practical SPL Prompts for Modern Security Teams

Introduction

Agentic AI is rapidly transforming the cybersecurity landscape. Unlike traditional artificial intelligence systems that operate within narrowly defined boundaries, agentic AI systems can plan, reason, make decisions, invoke tools, access external resources, and execute multi-step tasks with minimal human oversight. While these capabilities create tremendous business value, they also introduce new security risks.

Security Operations Centers (SOCs) are now challenged with detecting unauthorized AI usage, identifying potentially malicious autonomous behavior, preventing data leakage through AI systems, and monitoring interactions between AI agents and enterprise resources.

Splunk remains one of the most powerful platforms for detecting emerging threats, including those involving large language models (LLMs), AI copilots, autonomous agents, and AI-powered automation tools. This article provides practical Splunk Search Processing Language (SPL) prompts and detection strategies that security teams can implement today to identify agentic AI activity.


Understanding Agentic AI Behaviors

Before developing detections, it is important to understand the characteristics of agentic systems:

  • Autonomous decision-making
  • Sequential tool execution
  • API chaining
  • External data gathering
  • Code generation and execution
  • Automated account actions
  • Multi-step workflows
  • Persistent goal completion

From a detection perspective, these characteristics often manifest as:

  • Unusual API call patterns
  • Rapid execution of administrative actions
  • Automated browser activity
  • Excessive prompt submissions
  • High-volume outbound requests
  • Interaction with AI hosting services
  • Automated script creation and execution

Detection 1: Identify Access to Popular AI Services

Many organizations want visibility into employees accessing public AI platforms.

SPL Query

index=proxy OR index=web

(url_domain="chat.openai.com"

OR url_domain="claude.ai"

OR url_domain="gemini.google.com"

OR url_domain="copilot.microsoft.com"

OR url_domain="poe.com"

OR url_domain="perplexity.ai")

| stats count by user, src_ip, url_domain

| sort -count

Purpose

This search helps identify:

  • AI service adoption
  • Shadow AI usage
  • Departments frequently accessing AI platforms
  • Potential compliance concerns

Detection 2: Monitor Large Data Uploads to AI Services

One of the greatest concerns surrounding AI tools is sensitive data exposure.

SPL Query

index=proxy

(

url_domain="chat.openai.com"

OR url_domain="claude.ai"

OR url_domain="gemini.google.com"

)

bytes_out > 5000000

| stats sum(bytes_out) as uploaded by user, src_ip

| sort -uploaded

Purpose

Potential indicators include:

  • Intellectual property leakage
  • Source code uploads
  • Customer data exposure
  • Financial document sharing

Detection 3: Detect Automated API Consumption

Agentic AI commonly consumes APIs at a consistent, automated rate.

SPL Query

index=firewall

action=allowed

| bucket span=1m _time

| stats count by src_ip, dest_ip, _time

| eventstats avg(count) as avg_calls by src_ip

| where count > avg_calls*5

Purpose

This detection identifies:

  • AI agents continuously calling APIs
  • Automation abuse
  • Bot-like behavior
  • Potential autonomous workflows

Detection 4: Excessive OpenAI API Usage

Organizations leveraging enterprise AI should monitor API utilization.

SPL Query

index=proxy

url="api.openai.com"

| stats count by src_ip,user

| where count > 1000

| sort -count

Purpose

Helps uncover:

  • Agent deployment activity
  • Scripted AI interactions
  • Unauthorized AI applications
  • Cost-generating API abuse

Detection 5: AI-Generated PowerShell Execution

Many agentic workflows generate and execute code automatically.

SPL Query

index=sysmon EventCode=1

Image="*powershell.exe"

| regex CommandLine="(?i)(invoke-webrequest|invoke-expression|downloadstring|iwr)"

| stats count by user, host, CommandLine

Purpose

Identifies:

  • AI-generated scripts
  • Download-and-execute behavior
  • Autonomous remediation scripts
  • Potential AI-assisted attacks

Detection 6: Browser Automation Associated with AI Agents

Many agents rely on browser automation frameworks.

SPL Query

index=sysmon EventCode=1

(

CommandLine="selenium"

OR CommandLine="playwright"

OR CommandLine="puppeteer"

)

| stats count by user, host, CommandLine

Purpose

Detects:

  • Browser-based autonomous agents
  • Automated account access
  • Web scraping agents
  • AI workflow automation

Detection 7: Correlating Multiple Administrative Actions

One hallmark of agentic AI is rapidly executing multiple tasks across systems.

SPL Query

index=wineventlog

(

EventCode=4720

OR EventCode=4728

OR EventCode=4729

OR EventCode=4732

)

| transaction user maxspan=10m

| where eventcount > 5

Purpose

Highlights:

  • Bulk account creation
  • Mass privilege modification
  • Automation misuse
  • Agent-driven account management

Detection 8: AI-Assisted Reconnaissance Activity

Agentic attackers frequently automate reconnaissance.

SPL Query

index=sysmon

EventCode=1

(

CommandLine="whoami"

OR CommandLine="net user"

OR CommandLine="ipconfig"

OR CommandLine="systeminfo"

OR CommandLine="net group"

)

| stats count by host,user

Purpose

Can reveal:

  • Automated discovery actions
  • AI-assisted penetration testing
  • Lateral movement preparation
  • Internal system enumeration

Detection 9: Long-Duration Automated AI Sessions

Agentic systems often maintain persistent communications.

SPL Query

index=proxy

url_domain IN ("chat.openai.com","claude.ai","copilot.microsoft.com")

| bucket span=1h _time

| stats count by user,_time

| eventstats avg(count) as avg_session by user

| where count > avg_session*3

Purpose

Detects:

  • Extended AI agent operation
  • Workflow automation
  • Non-human interaction patterns
  • Potential autonomous assistants

Detection 10: Multi-Stage Agent Behavior Correlation

A more advanced detection correlates common stages of autonomous operation.

SPL Query

(index=sysmon EventCode=1) OR (index=proxy url="api.openai.com") OR (index=firewall action=allowed)

| stats values(process_name) as processes values(url) as urls count by host,user

| where count > 50

Purpose

Provides visibility into:

  • Prompt submission
  • API usage
  • Tool execution
  • Network communication

This closely aligns with how agentic systems operate in production environments.


Behavioral Detections Are More Effective Than IOC-Based Detections

Traditional security monitoring relies on indicators of compromise (IOCs) such as:

  • IP addresses
  • File hashes
  • Domain names

However, agentic AI introduces dynamic and rapidly evolving behaviors. Instead of hunting for known AI tools, SOC teams should focus on detecting:

  • Automated decision loops
  • Tool invocation patterns
  • High-frequency API activity
  • Autonomous privilege changes
  • AI-driven code execution
  • Task chaining across systems

Behavioral analytics provide more durable detections than simply monitoring known AI domains.


Mapping Agentic AI Detections to MITRE ATT&CK

Several ATT&CK techniques frequently overlap with agentic AI operations:

ATT&CK TechniqueDescription
T1059Command and Scripting Interpreter
T1087Account Discovery
T1018Remote System Discovery
T1105Ingress Tool Transfer
T1078Valid Accounts
T1190Exploit Public-Facing Application
T1021Remote Services
T1047Windows Management Instrumentation

Organizations should enrich detections with ATT&CK mappings to improve threat hunting and reporting.


Conclusion

Agentic AI is fundamentally changing how users, administrators, and attackers interact with enterprise systems. Security teams can no longer rely solely on traditional detections because autonomous systems generate activity that often resembles legitimate user behavior. Splunk provides an ideal platform to identify these emerging threats through behavioral analytics, correlation searches, risk-based alerting, and anomaly detection. By combining network telemetry, endpoint logs, cloud activity, and authentication data, defenders can build effective detections that uncover both authorized and malicious agentic AI activity.

Note: Apologies for the format as I had some trouble pasting from LibreOffice Writer.

Cybersecurity Governance in the Age of Agentic AI

Artificial Intelligence has evolved rapidly over the past few years, but the next significant shift is not simply AI that generates content or answers questions. It is the rise of Agentic AI: systems capable of making decisions, executing actions, and interacting with multiple platforms with minimal human involvement. While many organizations are focused on the productivity gains that these technologies can deliver, cybersecurity leaders need to focus on a different question: how do we govern systems that can act independently?

Traditional cybersecurity governance was designed around human users, predefined automation, and controlled workflows. Agentic AI changes that model entirely. Organizations are now introducing digital agents that can access sensitive data, interact with enterprise applications, make recommendations, execute tasks, and potentially influence security-critical decisions. As a result, governance programs must evolve to address risks that were never contemplated in traditional security frameworks.

One of the biggest changes I expect to see is the treatment of AI agents as managed identities. Today, security teams invest heavily in identity and access management for human users, service accounts, and privileged administrators. Agentic AI should be viewed no differently. Every agent should have a defined identity, documented business purpose, assigned owner, and clearly scoped permissions. The principle of least privilege becomes even more important when dealing with autonomous systems that may interact with multiple environments and data sources simultaneously.

Organizations will also need stronger governance around authorization and accountability. If an AI agent changes a configuration, accesses sensitive information, or triggers an automated response, security teams must be able to determine exactly what action occurred, why it occurred, and what data influenced the decision. Without detailed logging and audit capabilities, organizations risk creating blind spots that make incident response and compliance validation significantly more difficult.

Another area where governance will need to mature is continuous monitoring. Most governance programs today rely on periodic audits, quarterly reviews, and annual assessments. Agentic AI operates in real time, which means governance controls must operate in real time as well. Security operations teams will need visibility into agent behavior, decision patterns, and system interactions. Monitoring should extend beyond traditional indicators of compromise and include behavioral analytics capable of identifying when an agent begins acting outside of its expected parameters.

Human oversight will remain a critical component of any effective governance strategy. Despite the capabilities of Agentic AI, there are certain decisions that should never be fully autonomous. Organizations will likely adopt a risk-based governance model where the level of human involvement is determined by the potential impact of the action. Routine administrative tasks may be executed without approval, while actions involving privileged access, security controls, financial transactions, or regulated data should require human validation before execution. Maintaining a human-in-the-loop approach for high-risk activities provides an additional safeguard against unintended consequences.

Data governance will become inseparable from cybersecurity governance. Agentic AI systems depend on access to large volumes of information to perform effectively. However, unrestricted access creates obvious security and privacy concerns. Organizations must establish clear policies regarding data classification, handling requirements, retention, and access controls. Governance programs should ensure that agents only access the information necessary to perform their designated functions. This becomes especially important in highly regulated environments where compliance obligations related to privacy and data protection are already significant.

Third-party risk management will also play a larger role in governing Agentic AI. Most organizations will rely on external AI models, cloud providers, and software platforms rather than developing their own solutions from scratch. As a result, governance teams must evaluate not only their internal controls but also the security practices of the vendors supporting these AI ecosystems. Understanding how models are trained, how updates are deployed, and how data is handled throughout the supply chain will become a necessary part of security governance.

From a regulatory perspective, I expect increasing scrutiny surrounding AI accountability, transparency, and risk management. Frameworks such as the NIST AI Risk Management Framework provide an early foundation, but organizations should anticipate additional requirements from regulators and industry standards bodies as adoption accelerates. Executive leadership and boards of directors will likely demand greater visibility into AI-related risks, similar to the way cybersecurity risk reporting has matured over the last decade.

Ultimately, the future of cybersecurity governance for Agentic AI will be centered on accountability, transparency, and control. Organizations that view AI agents as trusted employees without implementing the same level of oversight will expose themselves to unnecessary risk. Successful governance programs will treat AI agents as managed entities with defined responsibilities, monitored activities, and enforceable security boundaries.

Agentic AI has the potential to transform how organizations operate, but autonomy without governance can quickly become a liability. As these technologies continue to evolve, cybersecurity leaders must ensure that governance frameworks evolve alongside them. The organizations that establish strong governance foundations today will be better positioned to leverage Agentic AI securely while maintaining compliance, protecting sensitive information, and preserving trust across the enterprise.

Author’s Perspective: As cybersecurity professionals, we have spent years developing governance models around human behavior, system administration, and traditional automation. Agentic AI introduces a new category of actor within the enterprise ecosystem. The challenge moving forward is not simply securing AI, but governing its authority, monitoring its actions, and ensuring accountability for its decisions. The organizations that solve this challenge first will gain the benefits of AI innovation without sacrificing security or compliance.