Agentic Security Pedia

Shadow AI agents: what they are and how to find them

Shadow AI agents are agents running on company machines or with company credentials that security never approved: coding agents, desktop assistants, browser agents, MCP servers and in-house bots. Find them in installed apps and CLIs, editor extensions, MCP config files and agent folders, and in traffic to model APIs.

The question Which agents run here that we never approved?

What counts as a shadow AI agent

A shadow AI agent is any agent acting with your company's access that security never approved. Often nobody hid it. An engineer installed it to work faster, and it never reached a review.

Five kinds turn up on company machines:

KindExamplesWhat it can do with your access
Coding agentsClaude Code, Codex, Gemini CLI, CursorRead and change code, run shell commands, call APIs
Desktop assistantsChat apps connected to your files and toolsRead files and call the tools you connect
Browser agentsAgents that click and type in a browserAct inside web apps where you are signed in
MCP serversLocal programs or remote services that give agents toolsReach GitHub, databases or email with stored tokens
In-house botsScripts and services that call a model API with a team keyWhatever their code and key allow

MCP servers are easy to miss, because each one is a single entry in a config file. The MCP docs say a local server “runs with your user account permissions”. What is MCP, and how do MCP servers create risk? covers them in depth, and What is agentic AI security? gives the wider picture.

How they arrive

Each route takes about a minute, and none of them needs a ticket.

  • A command-line install. One command, such as npm install -g @anthropic-ai/claude-code, puts an agent on the path. Claude Code's native installer also updates itself in the background.
  • An editor extension. VS Code “checks for extension updates and installs them automatically.” In July 2025, version 1.84.0 of the Amazon Q Developer extension for VS Code shipped with an injected prompt. It told the agent “to clear a system to a near-factory state and delete file-system and cloud resources”. AWS says the code failed to run because of a syntax error. BleepingComputer counted nearly one million installs of the extension.
  • A package. A package can run its own code the moment it installs. The Nx attack in August 2025 began with a post-install script in malicious versions of the Nx build tool.
  • One line in an MCP config file. An entry that runs npx -y with a package name starts that package whenever the app launches, installing it first if needed. The MCP docs' own example works this way, and -y confirms the install without asking. The first malicious MCP server reported in the wild impersonated postmark-mcp on npm and secretly copied emails to an attacker.

Where to look

Check every managed device, and check again on a schedule. Agents, extensions and MCP entries change without anyone filing a request.

WhereWhat to checkWhat it tells you
Installed apps/Applications on a Mac, Program Files on WindowsDesktop assistants and AI editors
Command-line toolsnpm ls -g --depth=0, brew list, which claude codex geminiAgents installed for the terminal
Editor extensionscode --list-extensions and ~/.vscode/extensionsAgent extensions, which update themselves
MCP config files~/.cursor/mcp.json, .cursor/mcp.json, ~/.claude.json, .mcp.json, ~/Library/Application Support/Claude/claude_desktop_config.json, ~/.codex/config.toml, ~/.gemini/settings.jsonEach MCP server an agent starts, and any token written into the file
Agent folders~/.claude/, ~/.codex/, ~/.gemini/, ~/.cursor/Settings and MCP servers, even for an agent nobody opens
Network logsDNS and proxy records for model APIs such as api.anthropic.comWhich machines call a model API, but not which program

Don't stop at the repository. Claude Code's security docs note that reviewing a project's .mcp.json “doesn't show every server a session can load”. User-level settings, connectors and plugins add more.

Blindspot, GIRD's open-source, read-only check, runs these checks on one computer. It lists the coding agents installed, the MCP servers each one starts and any keys sitting in plain text. For a fleet, run the same checks through your MDM.

Why dormant agents matter

An installed agent is a tool that any code on the machine can pick up. If it is still signed in, it works with the developer's access, whether or not anyone uses it.

The Nx attack showed this. On 26 August 2025, attackers published malicious versions of the Nx build system to npm. A post-install script searched each Linux or macOS machine for wallets, keystores, .env files and SSH keys. In Wiz's words, it also “weaponized installed AI CLI tools”. It ran the Claude, Gemini and Amazon Q command-line tools with --dangerously-skip-permissions, --yolo and --trust-all-tools.

The stolen data went to new public repositories in each victim's own GitHub account, named s1ngularity-repository or a numbered variant. Wiz counted over a thousand valid GitHub tokens from the first phase. A second phase used stolen tokens to make private repositories public: over 5,500 repositories across more than 400 users and organisations.

Nobody had to be using those agents that day. They were installed, so the script could run them. In GIRD's 19-day case study, 8 of 14 installed coding agents recorded no session at all. All eight stayed installed.

Dormant agents belong in the inventory, each with an owner and a decision: keep it, restrict it or remove it.

What to do with what you find

  1. Give every agent an owner. Record who installed it, who uses it and which team it serves.
  2. Approve a short list. Publish it, and make the approved route the easy one.
  3. Remove dormant agents first. They hold access, and an unused agent produces no activity for anyone to review.
  4. Check what each one can reach. Look at the keys in its config and the MCP tokens it holds. See What can an AI coding agent reach on a laptop? and Where AI agents leak your keys.
  5. Scope what stays. Give approved agents only the access their work needs. See Least privilege for AI agents.
  6. Keep looking. An agent installs with one command and an MCP server with one config line, so a one-time audit goes stale.

FAQs

Is an installed agent that nobody uses still a risk?

Yes. In the Nx attack of August 2025, a malicious package ran the AI command-line tools already on developers' machines. It switched off their safety prompts and had them hunt for secrets. An unused agent is still a tool that runs with your access.

Are MCP servers shadow agents too?

Treat them as part of the same inventory. A local MCP server is a program running with your user account's permissions. Many also hold a token for GitHub, a database or another service.

Can network logs alone find shadow agents?

No. DNS and proxy logs show which machine called a model API, not which program made the call. Pair them with checks on each device: installed tools, extensions, MCP config files and agent folders.

Should we ban every agent we didn't approve?

Approve a short list instead, and make it the easy route. Then remove what's left, starting with agents nobody uses, and keep checking for new ones.

How often should we look for new agents?

Continuously, or at least on every device check-in. An agent installs with one command and an MCP server with one config line, so the list can change between any two reviews.

Sources

  1. s1ngularity: supply chain attack leaks secrets on GitHub: everything you need to know, Wiz, 27 Aug 2025. Read 26 Oct 2026.
  2. Connect Claude Code to tools via MCP, Anthropic, Claude Code documentation. Read 26 Oct 2026.
  3. Security, Anthropic, Claude Code documentation. Read 26 Oct 2026.
  4. Advanced setup, Anthropic, Claude Code documentation. Read 26 Oct 2026.
  5. Model Context Protocol (MCP), Cursor documentation. Read 26 Oct 2026.
  6. Model Context Protocol, OpenAI, Codex documentation. Read 26 Oct 2026.
  7. Gemini CLI configuration, Gemini CLI documentation. Read 26 Oct 2026.
  8. Connect to local MCP servers, Model Context Protocol documentation. Read 26 Oct 2026.
  9. Extension Marketplace, Visual Studio Code documentation. Read 26 Oct 2026.
  10. Security Update for Amazon Q Developer Extension for Visual Studio Code (Version #1.84), AWS, 23 Jul 2025, updated 25 Jul 2025. Read 26 Oct 2026.
  11. Amazon AI coding agent hacked to inject data wiping commands, BleepingComputer, 25 Jul 2025. Read 26 Oct 2026.
  12. OWASP Top 10 for Agentic Applications for 2026, OWASP GenAI Security Project, 9 Dec 2025. Read 26 Oct 2026.