NIST, CISA, and the NSA have jointly published ten voluntary practices for preparing for, detecting, responding to, recovering from, and reporting incidents involving rogue AI agents. This is the first coordinated US government guidance treating autonomous or semi-autonomous AI agents as a distinct incident class — on par with how we formalized ransomware and supply-chain IR playbooks over the past decade.
Why does this matter now? Because enterprises are deploying agentic AI — LLM-driven systems that can execute code, call tools, browse the web, invoke APIs, and chain actions together without a human in the loop — faster than they are building guardrails. When one of these agents misbehaves (whether through prompt injection, compromised tooling, poisoned memory, misconfigured permissions, or a supply-chain compromise of the agent framework itself), the blast radius looks a lot like an insider threat with API keys. Your existing IR playbooks were not written for an adversary — or an asset — that can authenticate as a trusted service account and act at machine speed.
If your organization runs Copilot Studio agents, LangChain/LangGraph pipelines, AutoGen or CrewAI workflows, MCP-connected tooling, or any custom agent that holds credentials, this guidance applies to you today.
Technical Analysis
What the guidance covers
The joint practices span the full IR lifecycle — preparation, detection, response, recovery, and reporting — applied to AI agents that act outside their intended bounds. A 'rogue' agent in this framing includes:
- Compromised agents: an attacker hijacks the agent via prompt injection, tool poisoning, or stolen credentials/API keys, then uses the agent's legitimate permissions to act.
- Misaligned or malfunctioning agents: the agent pursues its objective through unintended means — deleting data, exfiltrating context, spamming downstream systems, or recursively spawning subtasks.
- Impersonated agents: adversaries register lookalike agents or abuse agent-to-agent trust relationships.
Why agents are a unique attack surface
From a defender's perspective, agents concentrate risk in ways traditional software does not:
- Delegated credentials and over-privilege. Agents typically hold OAuth tokens, API keys, or service account credentials scoped far broader than any single task requires. A hijacked agent inherits all of it.
- Non-deterministic execution paths. You cannot whitelist an agent's exact behavior the way you can a batch job. Detection must be behavioral, not signature-based.
- Tool and protocol chaining. Frameworks like MCP (Model Context Protocol) let agents discover and invoke tools dynamically. A compromised tool server can inject malicious capability descriptions or poison tool outputs — the confused-deputy problem, at scale.
- Memory and context poisoning. Agents with persistent memory (vector stores, conversation history, RAG corpora) can be poisoned so that malicious instructions survive across sessions.
- Speed. An agent loop can execute hundreds of tool calls per minute. Containment measured in hours is containment that failed.
Exploitation status
This is guidance, not a vulnerability advisory — there is no CVE and no single exploit. However, prompt injection, tool poisoning, and agent credential theft are being actively demonstrated and exploited against real deployments throughout 2025 and into 2026, and CISA's involvement signals that these incidents are now frequent enough to warrant standardized federal response practices. Treat this as a 'prepare now' directive, not a theoretical exercise.
Detection & Response
The most reliable telemetry for rogue agent activity comes from three sources: process execution on agent hosts (agents shelling out unexpectedly), identity/API telemetry (agent service principals behaving anomalously), and network egress (agents talking to unexpected endpoints or LLM APIs from wrong contexts). Below are rules and hunts tuned to fire on genuinely suspicious behavior, not routine agent operation.
---
title: AI Agent Runtime Spawning Shell or Script Interpreter
id: 3f8a1c24-7b6e-4d91-a5f2-9c3e7d1b8a04
status: experimental
description: Detects Python, Node, or agent framework runtimes spawning command shells or script interpreters, consistent with a rogue or prompt-injected AI agent executing arbitrary commands via a code execution or shell tool.
references:
- https://www.securityweek.com/us-agencies-detail-incident-response-practices-for-rogue-ai-agents/
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\python.exe'
- '\python3.exe'
- '\node.exe'
- '\deno.exe'
selection_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\wscript.exe'
- '\cscript.exe'
- '\mshta.exe'
- '\rundll32.exe'
- '\curl.exe'
- '\certutil.exe'
condition: selection_parent and selection_child
falsepositives:
- Legitimate LangChain/CrewAI shell-tool usage by approved automation agents - baseline known agent hosts and alert only on deviation
- Data science workstations running interactive notebooks
level: high
---
title: Agent Process Making Unexpected Outbound Connection to LLM API
id: 8b2d5e17-4a9c-4f83-b6d1-2e7a9c5f3d08
status: experimental
description: Detects non-browser, non-agent processes establishing connections to public LLM API endpoints, which may indicate an unauthorized or shadow AI agent exfiltrating data through an LLM API.
references:
- https://www.securityweek.com/us-agencies-detail-incident-response-practices-for-rogue-ai-agents/
- https://attack.mitre.org/techniques/T1567/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.exfiltration
- attack.t1567
logsource:
category: network_connection
product: windows
detection:
selection_dest:
DestinationHostname|contains:
- 'api.openai.com'
- 'api.anthropic.com'
- 'generativelanguage.googleapis.com'
- 'api.cohere.ai'
- 'api.mistral.ai'
filter_known_agents:
Image|endswith:
- '\chrome.exe'
- '\msedge.exe'
- '\firefox.exe'
condition: selection_dest and not filter_known_agents
falsepositives:
- Approved internal AI applications and developer tooling - maintain an allowlist of authorized agent processes per host
level: medium
---
title: Mass Tool Invocation or File Access by Agent-Hosting Process
id: c47e9a62-1d5b-4e28-93f6-5a8d2c7b4e19
status: experimental
description: Detects an agent runtime accessing sensitive files (credentials, SSH keys, cloud config, browser stores) inconsistent with its intended function - a hallmark of a rogue or hijacked agent performing collection.
references:
- https://www.securityweek.com/us-agencies-detail-incident-response-practices-for-rogue-ai-agents/
- https://attack.mitre.org/techniques/T1552/
author: Security Arsenal
date: 2026/04/06
tags:
- attack.credential_access
- attack.t1552
logsource:
category: file_event
product: windows
detection:
selection_process:
Image|endswith:
- '\python.exe'
- '\python3.exe'
- '\node.exe'
selection_files:
TargetFilename|contains:
- '\.ssh\'
- '\.aws\credentials'
- '\.azure\'
- '\.config\gcloud\'
- 'Login Data'
- '\.kube\config'
- '\.env'
- 'mcp.json'
- 'claude_desktop_config.json'
condition: selection_process and selection_files
falsepositives:
- Agents legitimately configured with MCP tooling that reads cloud credentials - scope tightly to hosts where agents should never touch credential stores
level: high
// Hunt: Anomalous agent process behavior - agent runtimes spawning shells or touching credential material
// Tables: DeviceProcessEvents / DeviceFileEvents (Defender), CommonSecurityLog for egress
let agentRuntimes = dynamic(["python.exe", "python3.exe", "python", "node.exe", "node", "deno"]);
let shellChildren = dynamic(["cmd.exe", "powershell.exe", "pwsh.exe", "sh", "bash", "curl", "wget", "certutil.exe", "mshta.exe"]);
let procHits =
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where InitiatingProcessFileName in~ (agentRuntimes)
| where FileName in~ (shellChildren)
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, AccountName;
let fileHits =
DeviceFileEvents
| where TimeGenerated > ago(24h)
| where InitiatingProcessFileName in~ (agentRuntimes)
| where FileName has_any ("credentials", "id_rsa", "Login Data", ".env", "mcp.json", "claude_desktop_config")
or FolderPath has_any ("\\.ssh\\", "\\.aws\\", "\\.azure\\", "\\.kube\\")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, FolderPath, FileName, AccountName;
union procHits, fileHits
| sort by TimeGenerated desc
// Companion egress hunt: unexpected hosts talking to public LLM APIs (via CEF/syslog firewall ingestion)
// CommonSecurityLog
// | where TimeGenerated > ago(24h)
// | where DestinationHostName has_any ("api.openai.com", "api.anthropic.com", "generativelanguage.googleapis.com")
// | summarize ConnectionCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DeviceName
// | where ConnectionCount > 500 // burst threshold - tune to baseline; rogue loops generate extreme volume
// | sort by ConnectionCount desc
-- Hunt: Enumerate agent framework artifacts and anomalous agent-spawned processes across the fleet
-- Deploys as a Velociraptor hunt artifact to inventory MCP configs, agent installs, and shell children of agent runtimes
-- 1. Find MCP / agent configuration files that reveal deployed agents and their tool permissions
SELECT FullPath, Size, Mtime
FROM glob(globs=[
'C:/Users/*/AppData/Roaming/Claude/claude_desktop_config.json',
'C:/Users/*/.cursor/mcp.json',
'C:/Users/*/.vscode/mcp.json',
'C:/ProgramData/*/mcp.json',
'/home/*/.config/Claude/claude_desktop_config.json',
'/home/*/.cursor/mcp.json',
'/etc/**/mcp.json'
])
-- 2. Identify agent runtimes that have spawned shells or download utilities
SELECT Pid, Ppid, Name, Exe, CommandLine, Username, CreateTime
FROM pslist()
WHERE Name =~ '(?i)python|node|deno'
AND CommandLine =~ '(?i)(subprocess|os\.system|child_process|spawn|exec\()'
-- 3. Correlate: find shell processes whose parent is an agent runtime
SELECT p.Pid, p.Name, p.CommandLine, p.Username, parent.Name AS ParentName, parent.CommandLine AS ParentCommandLine
FROM pslist() AS p
JOIN pslist() AS parent ON p.Ppid = parent.Pid
WHERE parent.Name =~ '(?i)python|node|deno'
AND p.Name =~ '(?i)cmd|powershell|pwsh|sh$|bash|curl|wget'
# Audit and harden: inventory AI agents, MCP tool permissions, and credential scope on a Windows host
# Run elevated. Produces a JSON report for IR scoping per the NIST/CISA/NSA preparation practices.
$report = [ordered]@{ Hostname = $env:COMPUTERNAME; Timestamp = (Get-Date -Format o) }
# 1. Locate MCP/agent configuration files and enumerate granted tools
$mcpPaths = @(
"$env:APPDATA\Claude\claude_desktop_config.json",
"$env:USERPROFILE\.cursor\mcp.json",
"$env:USERPROFILE\.vscode\mcp.json"
)
$report.McpConfigs = foreach ($p in $mcpPaths) {
if (Test-Path $p) {
$cfg = Get-Content $p -Raw | ConvertFrom-Json
[pscustomobject]@{ Path = $p; Servers = ($cfg.mcpServers.PSObject.Properties.Name -join ',') }
}
}
# 2. Inventory installed agent frameworks (pip + npm)
$report.PythonAgentPackages = (pip list 2>$null | Select-String -Pattern 'langchain|langgraph|autogen|crewai|openai|anthropic|mcp|semantic-kernel|llamaindex')
$report.NpmAgentPackages = (npm ls -g --depth=0 2>$null | Select-String -Pattern 'langchain|mcp|openai|anthropic')
# 3. Find hardcoded API keys / tokens in common agent env files
$report.EnvFiles = Get-ChildItem -Path "$env:USERPROFILE" -Recurse -Filter '.env' -ErrorAction SilentlyContinue |
Select-String -Pattern 'OPENAI_API_KEY|ANTHROPIC_API_KEY|AZURE_OPENAI|GOOGLE_API_KEY' -List |
Select-Object Path, LineNumber
# 4. Check for agent processes currently holding network connections to LLM endpoints
$report.LlmConnections = Get-NetTCPConnection -State Established -ErrorAction SilentlyContinue |
Where-Object { $_.RemoteAddress -notmatch '^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.|127\.)' } |
ForEach-Object {
$proc = Get-Process -Id $_.OwningProcess -ErrorAction SilentlyContinue
if ($proc.ProcessName -match 'python|node|deno') {
[pscustomobject]@{ Process = $proc.ProcessName; PID = $_.OwningProcess; RemoteIP = $_.RemoteAddress; RemoteHost = (Resolve-DnsName $_.RemoteAddress -ErrorAction SilentlyContinue).NameHost }
}
}
$report | ConvertTo-Json -Depth 5 | Out-File "$env:TEMP\agent_ir_audit_$($env:COMPUTERNAME).json"
Write-Output "Audit written to $env:TEMP\agent_ir_audit_$($env:COMPUTERNAME).json - review MCP server permissions and key exposure first."
# 5. Emergency containment snippet: revoke network access for a rogue agent process by name
# Get-Process python | Stop-Process -Force
# New-NetFirewallRule -DisplayName "IR-CONTAIN-AgentEgress" -Direction Outbound -Program "C:\Python312\python.exe" -Action Block
Remediation
The agencies' ten practices are voluntary, but they map cleanly onto IR phases you already run. Operationalize them as follows:
Prepare
- Maintain an agent inventory. You cannot respond to what you haven't cataloged. Record every deployed agent, its framework, owner, model, connected tools (MCP servers, function definitions), credentials held, and data scopes. The audit script above is a starting point for host-level discovery.
- Scope agent credentials to least privilege. Issue per-agent, short-lived, task-scoped tokens — never shared human credentials. Assume every key an agent holds will eventually appear in a prompt context window.
- Establish a kill switch. Pre-build the ability to revoke an agent's credentials, block its egress, and halt its orchestrator in seconds — not a change ticket. Test it quarterly like a DR exercise.
- Baseline normal agent behavior. Record typical tool-call rates, API volumes, and data access patterns per agent. Anomaly detection is impossible without it.
Detect 5. Log the full agent loop. Capture prompts, tool invocations with arguments, tool outputs, and final actions — immutable and centralized. Agent telemetry must survive the agent. 6. Deploy behavioral detections like those above: agent runtimes spawning shells, unexpected LLM egress, credential-store access, and tool-call burst anomalies.
Respond 7. Contain at machine speed. On confirmation: revoke the agent's tokens, isolate the host, disable the MCP/tool servers it trusted, and freeze its memory store for forensics — do not wipe it; poisoned memory is evidence. 8. Scope downstream impact. Treat every system the agent could reach as potentially compromised. Rotate credentials the agent held or touched, and review tool-call logs for actions taken (emails sent, tickets closed, records modified, code committed).
Recover and Report 9. Recover deliberately. Re-deploy agents only after root cause is understood — prompt injection path closed, tool server validated, memory rebuilt from known-good state. Restore with reduced permissions and ratchet back up. 10. Report internally and externally. The guidance encourages sharing rogue-agent incident details with CISA and sector ISACs. Build the reporting path into your IR plan now — the organizations that report early shape the threat intelligence everyone else defends with.
Reference the joint NIST/CISA/NSA publication directly via cisa.gov and nist.gov for the authoritative practice text, and map your implementation to NIST's AI Risk Management Framework alongside your existing CSF profiles.
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.