The seven controls in this series so far assume the agents under management are known to the organization — registered, scoped, and instrumented before production. The problem this chapter addresses is what happens when that assumption fails. Shadow AI agents are deployed by teams or individuals without going through the organization's governance process; rogue agents are registered but have deviated from their sanctioned behavior at runtime. Both are materially more dangerous than a known, governed agent with a misconfigured policy, because the detection problem precedes the remediation problem: you cannot contain an agent you do not know is running, and you cannot investigate behavioral drift in an agent you have no baseline for. This maps directly to OWASP Agentic ASI10 (Unbounded Agent Autonomy) and amplifies the blast radius of every other risk in the Agentic Top 10 when the agent in question is outside the governance perimeter.

Shadow agents vs. rogue agents: the distinction matters

The terms are sometimes used interchangeably, but they describe different failure modes with different detection approaches. A shadow agent was never registered with the organization's AI governance process. It may be a developer's proof-of-concept that reached production, a vendor-supplied integration that includes embedded AI capabilities not disclosed in the contract, or a departmental workflow tool that added an AI agent feature in a minor update. The defining characteristic is absence from the asset inventory, which means no policy, no audit trail, and no authorized scope. A rogue agent was registered and approved, but its runtime behavior has diverged from the sanctioned baseline. This can happen because of prompt injection that has persistently altered the agent's goals, a model update that shifted behavior outside tested parameters, a configuration drift, or deliberate modification by an insider. The agent appears legitimate in the registry but is no longer behaving as approved. Both require detection; neither can be addressed through runtime policy alone, because shadow agents are not subject to the runtime policy and rogue agents are evading it.

38%
of enterprise AI deployments include at least one agent that was not reviewed or registered through the organization's AI governance process

The four detection vectors

1

Asset Discovery

Continuous scanning of the network, API gateways, cloud function registries, and SaaS integration logs for traffic patterns that indicate AI model calls — particularly calls to external inference endpoints (OpenAI, Anthropic, Bedrock, Vertex) or self-hosted model servers. An agent running outside governance still has to call a model; that call leaves a trace at the network boundary even if the agent itself is invisible to the application layer.

2

Identity Verification

Every sanctioned agent should carry a cryptographically verifiable identity issued at registration — a short-lived credential tied to its persona definition, authorized scope, and deployment context. Any agent making tool calls or API calls without a verifiable credential is by definition outside the governance perimeter. The Model Context Protocol authentication specification and OAuth 2.0 mTLS certificate binding both provide workable primitives for this layer.

3

Behavioral Baseline Comparison

For registered agents, a sanctioned behavioral baseline is established at approval time: the tools the agent uses, the data scopes it typically touches, the model call frequency and token distribution, the trust-tier distribution of its inputs. Continuous comparison of live behavior against the baseline surfaces rogue drift before it manifests as an incident. This is the behavioral analytic layer described in Chapter 7, applied specifically to the rogue detection problem.

4

Scope Boundary Monitoring

Even without a behavioral baseline, attempting to access data, tools, or systems outside the authorized scope is a strong signal for both shadow and rogue agents. Shadow agents have no scope at all and will appear as unauthorized on every resource access. Rogue agents will generate scope violations when their compromised goal state leads them to attempt access outside what was approved. Both produce the same observable: a resource access attempt with no valid authorization against the requesting identity.

Building an agent registry that enables detection

Detection depends on having something to detect against. An agent registry is the organizational record of every AI agent that has been reviewed, approved, and deployed — analogous to a software bill of materials but for autonomous runtime behavior. Each entry should capture the agent's unique identity (cryptographic key or certificate), the model and version it is authorized to use, the tools and data scopes it is authorized to access, the persona definition it was approved against, the human or team responsible for it, and the deployment context (environment, dependent systems). Without this registry, the question "is this agent sanctioned?" has no authoritative answer, and the network traffic that reveals a shadow agent has nothing to be compared against.

The registry also provides the baseline for rogue detection. At approval time, the agent's expected behavioral envelope is documented — not as a rigid specification (agents are non-deterministic) but as a distribution of expected actions. A coding assistant agent should primarily be calling a code execution tool and a search tool; a data analysis agent should primarily be querying a specific database. When production behavior diverges significantly from that documented envelope, the deviation is a detection signal. The registry turns that signal from a vague intuition into a measurable delta.

“A shadow agent was never registered. A rogue agent was, but is no longer behaving as approved. You cannot contain either through runtime policy alone — detection has to come first.”

Working through these controls yourself? The Skyrelis Agent Checklist condenses this series into a one-page pre-production reference.

Download Free →

Detection signals and response tiers

SignalShadow or Rogue?Response
AI model API call from an unregistered service identityShadowBlock at API gateway; alert security team; initiate asset discovery scan of the originating system
Registered agent making model calls with an unrecognized model versionRogueAlert; flag session for human review; compare current model against approved version in registry
Registered agent accessing data scope outside its authorized boundariesRogueDeny access; real-time alert; suspend session pending review if pattern repeats
Registered agent tool-call distribution shifts significantly from documented baselineRogueAlert; increase monitoring fidelity; human review of recent action log before next session
Agent traffic observed on networks or systems with no registered agent inventoryShadowImmediate containment; network isolation of originating service; incident response initiated

Containment and remediation

Detection without containment is incomplete. For shadow agents, containment is straightforward in principle: revoke the API credentials or block the network path the agent is using to reach its model, then investigate the deployment path to understand how governance was bypassed. The more operationally important outcome is not just stopping this particular agent, but closing the gap that allowed it to reach production without review. For rogue agents, containment is more nuanced because the agent identity is legitimate — it is the behavior that has deviated. The typical response is session suspension (preventing the agent from taking further actions) while a human reviews the recent action log to determine the scope of the drift, whether any unauthorized actions were taken, and whether the root cause is a prompt injection, a model update, or a configuration change. Remediation then restores the agent to its sanctioned baseline, or retires it if the drift cannot be explained.

Both containment paths depend on the infrastructure built in earlier chapters: the runtime enforcement layer provides the session suspension mechanism, the audit and monitoring layer provides the action log for investigation, and the least-privilege scoping limits the blast radius of any actions taken before detection. Detection is the layer that triggers those mechanisms when an agent has escaped the governance perimeter.

Shadow and Rogue Agent Detection Checklist

Agent registry exists with cryptographic identity, authorized model, authorized tools, authorized data scope, and responsible owner for every sanctioned agent
API gateways and network egress points scan for AI model API calls from unregistered service identities
Every sanctioned agent carries a verifiable credential issued at registration and rotated on a defined schedule
Behavioral baselines documented at approval time; continuous comparison against live behavior for all registered agents
Scope boundary violations generate real-time alerts regardless of whether the access was ultimately blocked
Containment playbooks exist for both shadow (revoke/block) and rogue (suspend session, human review) scenarios
Shadow agent discovery findings feed back into the onboarding process to close governance bypass paths

See how Skyrelis surfaces shadow and rogue agents

Continuous asset discovery, cryptographic agent identity, behavioral baseline comparison, and automated containment — in one runtime layer.

Frequently Asked Questions

What is a shadow AI agent?
A shadow AI agent is any AI agent running in an organization's environment that was not reviewed, approved, or registered through the organization's AI governance process. Common examples include developer prototypes that escaped to production, vendor integrations with undisclosed AI capabilities, and departmental tools that added AI agent features without security review. Shadow agents are not necessarily malicious — they are ungoverned, which means they carry all the risks of a production agent (data access, external calls, action-taking) with none of the controls. The detection approach is network-layer discovery of AI model API calls from unregistered service identities, since even an invisible agent still has to call a model.
How does a registered agent become rogue?
A registered agent can become rogue through several mechanisms. Persistent prompt injection — where malicious instructions embedded in retrieved content have altered the agent's effective goal state across sessions — is increasingly common. Model updates from a provider can shift behavior outside tested parameters without triggering a re-review. Configuration drift in the deployment environment can alter the agent's context in ways that change its behavior. In higher-risk scenarios, an insider with deployment access may deliberately modify the agent's system prompt or tool configuration. Detection requires a documented behavioral baseline established at approval time and continuous comparison against live behavior, so that drift is caught before it results in unauthorized actions.
Why can't runtime policy enforcement alone catch shadow agents?
Runtime policy enforcement, as described in Chapter 1, operates on agents that are subject to the policy layer — agents whose tool calls and model calls flow through the enforcement infrastructure. A shadow agent, by definition, was not set up to route through that infrastructure. Its calls to external model APIs go through network paths the policy layer was never configured to inspect. Detection requires a different mechanism: monitoring at the network boundary (API gateways, egress proxy, cloud spend anomalies on AI service accounts) for traffic that indicates AI agent activity from services that are not in the agent registry. Once a shadow agent is identified, it can be brought under governance or decommissioned — but the discovery has to come first.
How is this related to OWASP's Agentic Top 10?
Shadow and rogue agent detection maps most directly to ASI10 (Unbounded Agent Autonomy) in the OWASP Top 10 for Agentic Applications. Unbounded autonomy is the condition where an agent operates without the controls that should constrain it; shadow agents are the most extreme form of this — they were never subject to controls — and rogue agents represent a failure of the controls that were applied. Detection and containment are the operational responses to both conditions. The audit infrastructure in Chapter 7 provides the forensic evidence needed once a shadow or rogue agent is identified.
What should an agent registry contain at minimum?
At minimum, an agent registry entry should include: a unique cryptographic identity (key or certificate) issued at registration; the model provider, model name, and authorized version range; the complete list of tools and APIs the agent is authorized to call; the data scopes and classifications the agent is authorized to access; the persona definition (system prompt or equivalent) that was reviewed and approved; the human owner or team responsible for the agent; the deployment environment and dependent systems; and a documented behavioral baseline describing the expected distribution of actions. Without this, the registry is a name list rather than a governance record — it can confirm an agent was registered but not what it was approved to do, which makes rogue detection impossible.