Microsoft's newly revealed Project Perception — which introduces Guardian Agents designed to monitor, evaluate, and contain anomalous AI agents — is the clearest signal yet that Redmond views autonomous agents as a first-class insider threat. The concept is sound in principle: agents acting with delegated credentials, touching sensitive data stores, calling APIs, and chaining tools together are indistinguishable from a compromised insider when they go off the rails. The problem, as multiple experts quoted in the Dark Reading coverage point out, is that using unpredictable agents to police unpredictable agents may compound the risk rather than contain it.
Here's the blunt reality for defenders: whether or not Guardian Agents ship as promised, your organization is already deploying AI agents — Copilot Studio agents, custom agents built on Azure OpenAI, LangChain/AutoGen orchestrations, MCP-connected toolchains — and most SOC teams have zero telemetry coverage for what those agents actually do at runtime. This post is your starting point: what the threat actually looks like, why agent-on-agent oversight has structural blind spots, and concrete detection and hardening content you can deploy today.
Technical Analysis: Why AI Agents Behave Like Compromised Insiders
No CVE is associated with this news item. This is a structural threat — an emergent attack surface created by agentic AI architectures — not a patchable vulnerability. That makes it harder to remediate, not easier.
The affected surface
- Microsoft 365 Copilot and Copilot Studio agents operating under delegated user or application permissions
- Azure AI Foundry / Azure OpenAI-backed custom agents with service principal identities in Entra ID
- Self-hosted agent frameworks (Python/Node.js runtimes: LangChain, AutoGen, Semantic Kernel, CrewAI) executing on endpoints and servers
- MCP (Model Context Protocol) tool integrations that let agents invoke local binaries, query databases, read files, and call third-party APIs
How the threat works — the agentic insider kill chain
From a defender's perspective, a rogue or compromised AI agent follows a recognizable pattern:
- Identity assumption. The agent authenticates as a service principal, managed identity, or via a delegated OAuth token. These identities are frequently over-privileged — granted
Mail.Read,Files.Read.All, orDirectory.Read.Allat provisioning because nobody scoped them down. - Manipulation or drift. A prompt injection attack (via poisoned documents, emails, or web content the agent ingests), a compromised tool/MCP server, or plain model misalignment causes the agent to deviate from its intended task.
- Action at machine speed. The agent executes API calls, file reads, emails, or shell commands through its toolchain — at a rate and volume no human insider could match. This is the defining characteristic: exfiltration or lateral movement compressed into seconds.
- Telemetry gap. Because the activity rides legitimate tokens and sanctioned APIs, it blends into normal traffic. Traditional UEBA baselines tuned for human users won't flag a service principal that legitimately makes thousands of calls per day.
The structural problem with Guardian Agents
Microsoft's bet — agents monitoring agents — introduces real concerns practitioners should weigh before depending on it:
- Shared failure modes. If a guardian agent runs on the same model class as the agents it polices, a prompt injection or model-level exploit may neutralize both simultaneously.
- Recursive trust problem. Who monitors the Guardian Agent? An attacker who compromises the oversight layer gains a kill switch over your defensive tooling.
- Opacity. An LLM-based guardian making containment decisions produces probabilistic judgments, not deterministic audit trails. IR teams need reproducible evidence, not "the guardian decided to."
The correct posture: treat Guardian Agents (when available) as one signal among many, and build deterministic, query-driven detection beneath them.
Exploitation status
Prompt injection and agent hijacking are no longer theoretical — indirect prompt injection against tool-using agents has been demonstrated repeatedly in 2025–2026 research, and red teams are actively incorporating agent manipulation into engagements. There is no CISA KEV entry because there is no single CVE; the exposure is architectural.
Detection & Response
The detections below target the observable behaviors of rogue agent activity: agent runtimes spawning shells, service principal API anomalies, and agent identities touching resources outside their mission scope. They are tuned to minimize noise — agent runtimes legitimately make API calls, so we key on behavioral deviation (shell spawns, token-use spikes, first-seen resource access), not raw volume alone.
---
title: AI Agent Runtime Spawning Interactive Shell or Script Interpreter
id: 3f8a2c71-6b9d-4e15-a2c7-9d1e5f8b3a06
status: experimental
description: Detects common AI agent runtimes (Python, Node, Semantic Kernel hosts) spawning cmd.exe, powershell.exe, or bash. Tool-using agents that suddenly invoke interactive shells are a strong indicator of prompt injection-driven command execution or compromised MCP tooling.
references:
- https://www.darkreading.com/cybersecurity-operations/ai-agents-insider-threats-inside-microsoft-unified-security-stack
- https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/01/15
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: windows
detection:
selection_parent:
ParentImage|endswith:
- '\python.exe'
- '\pythonw.exe'
- '\node.exe'
- '\dotnet.exe'
selection_child:
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
- '\wscript.exe'
- '\cscript.exe'
- '\rundll32.exe'
filter_automation:
CommandLine|contains:
- 'pip install'
- 'npm install'
- '--version'
condition: selection_parent and selection_child and not filter_automation
falsepositives:
- Agent frameworks legitimately invoking local tools (build an allowlist per approved MCP tool)
- Development workstations running agent prototypes
level: high
---
title: AI Agent Runtime Spawning Shell on Linux Hosts
id: 8c4e1b92-2d7a-4f38-b6e1-4a9c3d7e5f21
status: experimental
description: Detects Python or Node agent runtimes spawning bash/sh on Linux. An autonomous agent dropping to a shell is consistent with indirect prompt injection escalating from tool invocation to host-level command execution.
references:
- https://www.darkreading.com/cybersecurity-operations/ai-agents-insider-threats-inside-microsoft-unified-security-stack
- https://attack.mitre.org/techniques/T1059/004/
author: Security Arsenal
date: 2026/01/15
tags:
- attack.execution
- attack.t1059.004
logsource:
category: process_creation
product: linux
detection:
selection_parent:
ParentImage|endswith:
- '/python'
- '/python3'
- '/node'
selection_child:
Image|endswith:
- '/bash'
- '/sh'
- '/dash'
- '/zsh'
- '/curl'
- '/wget'
condition: selection_parent and selection_child
falsepositives:
- Legitimate agent toolchains (shell tools registered via MCP) — baseline per host and tune
level: high
---
title: Service Principal Credential or Secret Added to Existing App Registration
id: 1b7d4e63-9f2c-4a81-8d35-6e2b9c4f7a18
status: experimental
description: Detects new secrets or certificates added to existing Entra ID app registrations. Attackers targeting AI agent infrastructure add credentials to agent service principals to gain persistent, token-based access that survives containment of the agent runtime itself.
references:
- https://www.darkreading.com/cybersecurity-operations/ai-agents-insider-threats-inside-microsoft-unified-security-stack
- https://attack.mitre.org/techniques/T1098/001/
author: Security Arsenal
date: 2026/01/15
tags:
- attack.persistence
- attack.t1098.001
logsource:
service: auditlogs
product: azure
detection:
selection:
OperationName:
- 'Update application – Certificates and secrets management'
- 'Add service principal credentials'
condition: selection
falsepositives:
- Routine certificate rotation by app owners — correlate with change tickets
level: high
// Hunt: Anomalous spike in Graph API activity by AI agent service principals
// Rogue or manipulated agents exhibit sudden call-volume surges and first-seen resource access.
// Tune the baseline window and multiplier to your environment.
let baseline_start = ago(14d);
let baseline_end = ago(1d);
let baseline = AADServicePrincipalSignInLogs
| where TimeGenerated between (baseline_start .. baseline_end)
| summarize DailyCalls = count() by ServicePrincipalId, bin(TimeGenerated, 1d)
| summarize AvgCalls = avg(DailyCalls) by ServicePrincipalId;
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(1d)
| summarize TodayCalls = count(),
UniqueResources = dcount(ResourceDisplayName),
Resources = make_set(ResourceDisplayName, 20),
IPs = make_set(IPAddress, 10)
by ServicePrincipalId, ServicePrincipalDisplayName
| join kind=inner baseline on ServicePrincipalId
| where TodayCalls > (AvgCalls * 5) and TodayCalls > 500
| project ServicePrincipalDisplayName, TodayCalls, AvgCalls, UniqueResources, Resources, IPs
| order by TodayCalls desc;
// Hunt: Agent service principals accessing first-seen sensitive resources
// Flags an agent identity touching Mail, SharePoint, or Directory scopes it has never used before.
let lookback = 30d;
let recent = 24h;
let historical = AADServicePrincipalSignInLogs
| where TimeGenerated between (ago(lookback) .. ago(recent))
| summarize by ServicePrincipalId, ResourceDisplayName;
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(recent)
| where ResourceDisplayName has_any ("Microsoft Graph", "Office 365 Exchange Online", "SharePoint")
| summarize FirstSeenResource = min(TimeGenerated), AppId = any(AppId)
by ServicePrincipalId, ServicePrincipalDisplayName, ResourceDisplayName
| where historical !contains (ServicePrincipalId, ResourceDisplayName)
| order by FirstSeenResource desc;
// Hunt: Endpoint telemetry — agent runtimes spawning shells (complements Sigma rule 1)
DeviceProcessEvents
| where TimeGenerated > ago(24h)
| where InitiatingProcessFileName in~ ("python.exe", "pythonw.exe", "node.exe", "dotnet.exe", "python3", "python", "node")
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "bash", "sh", "curl", "wget")
| project TimeGenerated, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine,
FileName, ProcessCommandLine, AccountName
| order by TimeGenerated desc;
-- Artifact: Windows.Hunt.AIAgentRuntimeExposure
-- Hunt for agent runtimes (python/node) with established network connections
-- or shell-spawning behavior across the fleet. Scope by label group for agent hosts.
LET runtime_procs = SELECT Pid, Ppid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE Name =~ '(?i)(python|pythonw|node|dotnet)\.exe$'
AND CommandLine !~ '(?i)pip install|npm install'
LET runtime_conns = SELECT Pid, Name, RemoteAddress, RemotePort, Status
FROM netstat()
WHERE Status = 'ESTABLISHED'
AND Name =~ '(?i)(python|pythonw|node|dotnet)\.exe$'
SELECT * FROM runtime_procs
UNION ALL
SELECT Pid, NULL AS Ppid, Name, NULL AS CommandLine,
format(format='%v:%v', args=[RemoteAddress, RemotePort]) AS Exe,
Status AS Username, NULL AS CreateTime
FROM runtime_conns
Remediation: Hardening the Agent Identity Layer
There is no patch to apply — remediation here means governing agent identities, scoping permissions, and instrumenting telemetry. The PowerShell below audits your Entra ID estate for the most common exposure: over-privileged, unowned, or stale agent service principals.
# AI Agent Identity Hygiene Audit — run with an account holding Application.Read.All + AuditLog.Read.All
# Requires: Microsoft.Graph PowerShell SDK
Connect-MgGraph -Scopes "Application.Read.All","Directory.Read.All","AuditLog.Read.All" -NoWelcome
# 1. Enumerate app registrations (candidate agent identities) with high-risk Graph permissions
$riskyScopes = 'Mail.Read','Mail.ReadWrite','Mail.Send','Files.Read.All','Files.ReadWrite.All',
'Directory.Read.All','Directory.ReadWrite.All','Sites.FullControl.All'
$apps = Get-MgApplication -All -Property Id,DisplayName,RequiredResourceAccess,CreatedDateTime,Owners
$report = foreach ($app in $apps) {
$grants = $app.RequiredResourceAccess.ResourceAccess | Where-Object { $riskyScopes -contains $_.Id -or $_.Type -eq 'Role' }
$owners = (Get-MgApplicationOwner -ApplicationId $app.Id -ErrorAction SilentlyContinue)
if ($grants -or -not $owners) {
[PSCustomObject]@{
DisplayName = $app.DisplayName
AppId = $app.AppId
Created = $app.CreatedDateTime
HasOwners = [bool]$owners
DelegatedGrants = ($grants | Measure-Object).Count
}
}
}
$report | Export-Csv -Path ".\agent-identity-audit-$(Get-Date -Format yyyyMMdd).csv" -NoTypeInformation
$report | Format-Table -AutoSize
# 2. Identify service principals with credentials older than 180 days (rotate these)
$sps = Get-MgServicePrincipal -All -Property Id,DisplayName,PasswordCredentials,KeyCredentials
foreach ($sp in $sps) {
$stale = $sp.PasswordCredentials | Where-Object { $_.StartDateTime -lt (Get-Date).AddDays(-180) }
if ($stale) { Write-Warning "$($sp.DisplayName): secret older than 180 days — rotate and scope down permissions" }
}
# 3. Quick win: remove an over-privileged app role assignment once identified
# Get-MgServicePrincipalAppRoleAssignment -ServicePrincipalId <sp-object-id>
# Remove-MgServicePrincipalAppRoleAssignment -ServicePrincipalId <sp-object-id> -AppRoleAssignmentId <assignment-id>
Remediation checklist
- Inventory every agent identity today. You cannot defend what you haven't enumerated. Catalog all Copilot Studio agents, Azure AI Foundry deployments, and third-party agent frameworks, mapped to their Entra ID service principals and granted scopes.
- Enforce least privilege aggressively. Application permissions like
Files.Read.AllandDirectory.Read.Allshould be the rare, documented exception — not the provisioning default. Scope agents to specific sites, mailboxes, and APIs. - Treat agent tokens as crown jewels. Apply Conditional Access for workload identities where licensing permits, pin token lifetimes to the minimum viable, and alert on any new credential added to an existing agent app registration (Sigma rule 3 above).
- Segment agent execution. Run agent runtimes in dedicated containers or hosts with egress allowlists. An agent that can only reach its sanctioned APIs can't exfiltrate to an attacker-controlled endpoint even if prompt-injected.
- Log tool invocation, not just auth. Require agent frameworks to emit structured logs of every tool call (MCP or otherwise) to your SIEM. Authentication telemetry alone will not catch a manipulated agent abusing sanctioned access.
- Define a containment playbook for rogue agents now. When an agent goes rogue you have seconds-to-minutes, not hours. Pre-stage runbooks: revoke service principal credentials, disable the app registration, invalidate refresh tokens (
Revoke-MgUserSignInSessionequivalent for workloads), and isolate the runtime host. - Don't outsource judgment to Guardian Agents. When Microsoft's oversight layer ships, ingest its verdicts as signals into your SIEM — never as autonomous containment authority. Deterministic guardrails (egress controls, scoped permissions, rate limits) fail closed; LLM-based oversight fails probabilistically.
Bottom line
Project Perception validates what practitioners have been saying since agents got tool access: autonomous agents are insiders with superhuman speed and zero institutional loyalty. Microsoft's guardian-agent approach may mature into a useful layer, but the experts' warning is correct — defense cannot rest on agents grading other agents. Identity governance, scoped permissions, deterministic network controls, and SOC-level behavioral detection are the controls that will actually hold. Build them now, while your agent sprawl is still countable.
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.