Technical Guide

Shadow AI: Detecting Unauthorized AI Tools and Agents in the Enterprise

Shadow AI detection requires correlating three independent data planes: network and API traffic to known AI provider domains, identity telemetry such as OAuth grants and API key issuance, and runtime logs of agent tool calls, including MCP interactions. No single layer provides complete visibility, because AI usage occurs through browser sessions, embedded SaaS features, self-service API signups, and autonomous agent tool invocations that traditional shadow IT tooling was not built to capture.

Three Detection Layers

Shadow AI activity can surface at any one of these layers without triggering the others, which is why effective detection treats them as complementary rather than redundant.

Layer 1

Network and API Traffic

Domain classification, proxy logs, and API gateway traffic to AI provider endpoints.

Layer 2

Identity and Access Telemetry

OAuth grants, API key issuance, and SSO logs that surface AI service enrollment.

Layer 3

Agent Runtime Logs

Tool invocation records and MCP server/client traffic generated by autonomous agents.

What Shadow AI Is, and Why It Differs From Shadow IT

Shadow AI refers to the use of AI tools, embedded AI features, and autonomous agents within an organization without security or IT review. It extends the established concept of shadow IT, where unsanctioned technology adoption typically occurs because official procurement or approval processes create friction for end users. Shadow AI inherits this dynamic but adds distinct technical characteristics that make detection harder.

Unlike a typical unsanctioned SaaS application, shadow AI usage frequently does not require new software installation. Employees access consumer AI tools through a browser, use AI features embedded inside already-approved SaaS platforms, or deploy locally run AI agents that never touch an app store or endpoint installer. This means endpoint detection and traditional application allowlisting, the tools most security teams rely on for shadow IT, often produce no signal at all.

A second distinguishing factor is credential issuance. API keys for AI model providers can be created outside centralized identity provider workflows through self-service signup. These keys do not appear in standard IAM audit logs, which creates a detection gap that is specific to AI tooling rather than general SaaS adoption.

Where Shadow AI Activity Actually Shows Up

Detecting shadow AI requires looking at three layers independently, because usage can manifest at any one of them without triggering the others.

Network and API traffic analysis, the method underlying most CASB and SASE tooling, inspects DNS and proxy logs to identify connections to known AI provider domains. This approach was built for discovering SaaS application usage generally, and it can be extended to AI-specific services through updated application signatures. However, encrypted traffic and the use of API gateways can obscure which specific AI service or model is being accessed, and domain and IP allowlists require ongoing maintenance as new AI tools launch.

Identity and access telemetry provides a second, largely independent signal. SSO logs, OAuth grant records, and API key issuance data can reveal unauthorized AI service enrollment even when network-level detection is evaded through encryption or proxying. This is often the more reliable layer for catching self-service AI adoption, since it captures the enrollment event rather than relying on inferring intent from traffic patterns.

Application and agent runtime logs are the third layer, and the one most enterprise security stacks are least equipped to capture today.

Autonomous Agents and MCP Introduce a New Telemetry Gap

Autonomous AI agents that chain API requests or invoke external tools generate a fundamentally different telemetry signature than human-driven SaaS usage. The Model Context Protocol, published by Anthropic, defines a standardized method for AI models to call external tools and data sources. This tool-call traffic is not captured by traditional web or API monitoring designed around SaaS session activity, because it occurs at the orchestration layer between an agent and the tools it invokes, not at the browser or standard API gateway level.

This matters for detection because an agent can be technically sanctioned, running on approved infrastructure, while its tool invocations reach unauthorized systems or data sources without that activity appearing in existing SIEM correlation rules. OWASP's guidance for large language model applications identifies excessive agency and insecure plugin or tool integration as distinct risk categories for this reason. Monitoring an agent's existence is not the same as monitoring what it is allowed to call and what it actually calls.

Capturing this layer requires instrumentation at the orchestration framework or MCP gateway level, logging not just that a tool call occurred but its parameters and destination. Most SIEM deployments need new parsers or connectors to ingest AI provider API logs, agent orchestration logs, and MCP server logs, since these are not standard log sources today.

Implementation Considerations Before Deploying Detection

Governance Provides the Definition Detection Depends On

Detection tooling can identify AI-related network connections, credential issuance events, and tool invocations, but it cannot determine what counts as unauthorized without a governance baseline. NIST's AI RMF Govern and Map functions provide a reference structure for establishing AI use policies and maintaining a system inventory, which is what allows detected activity to be classified as sanctioned or not.

This is also where audit logging requirements intersect with detection. NIST SP 800-53's access control and audit families provide the baseline control structure commonly referenced for extending identity and logging controls to AI service usage, but this extension requires explicit policy updates rather than happening automatically. Similarly, OWASP's guidance on excessive agency suggests that governance policy should define the permitted scope of autonomous agent tool access, which gives runtime monitoring a concrete standard to enforce against rather than a general risk category to flag.

For organizations running autonomous agents, this means governance and runtime enforcement need to be connected. Defining agent identity, permissions, and least-privilege tool access as policy is what makes runtime monitoring of tool calls actionable, since the system can then flag calls that exceed defined scope rather than simply logging that a call occurred.

Building a Detection Architecture Across Three Layers

  1. 1

    Treat the layers as complementary, not redundant

    An effective shadow AI detection architecture treats network, identity, and runtime telemetry as complementary rather than redundant, since each layer catches activity the others miss.

Extend Governance to Agent Runtime Activity

Detecting shadow AI at the network and identity layers is necessary but not sufficient once autonomous agents are making tool calls. Runtime governance gives security teams visibility into agent identity, permissions, and tool invocation activity, including MCP interactions, as part of a defined policy rather than after-the-fact log review.

Talk to an Expert