How to Discover Shadow AI on Company Endpoints
Shadow AI is no longer just a chatbot tab. It is coding agents in the terminal, MCP servers started by the IDE, models running on the laptop and API keys in shell profiles. This guide shows what to look for, how to check one machine, how to scale the checks across a fleet, and what to do with what you find.
Short answer. Shadow AI on an endpoint is any AI tool that runs on, or is configured on, the laptop itself: desktop chat apps, terminal coding agents such as Claude Code or Codex CLI, AI extensions in the IDE and the browser, MCP servers, local model runtimes such as Ollama, and AI API keys left in config files, plus all of the above inside WSL, containers and VMs. Network and SaaS-discovery tools see some of its traffic but not the programs, configs and keys behind it. To find it: check one machine by hand, run the same read-only checks in every user profile with your MDM or RMM, then keep the inventory current with continuous discovery and decide, tool by tool, what is approved.
Looking for one product? The per-tool detection pages list the exact traces of each one.
- What counts as Shadow AI on an endpoint
- Why network and SaaS tools miss part of it
- Step 1: decide what you are counting
- Step 2: check one machine by hand
- Step 3: run the checks across the fleet
- Step 4: keep it current with continuous discovery
- What to do with the findings
- What Kuntur covers, and what it does not
- Automate it
- FAQ
- Sources
What counts as Shadow AI on an endpoint
"Shadow AI" usually means AI use the company has not reviewed. On a laptop it takes a few concrete forms, and each leaves different traces:
| Category | Examples | Where it shows up | Detail |
|---|---|---|---|
| Desktop AI apps | ChatGPT, Claude, Microsoft Copilot, Perplexity, Doubao, Cherry Studio | Per-user installs, Microsoft Store packages, /Applications | Desktop apps guide, ChatGPT, Cherry Studio, Doubao |
| Terminal coding agents | Claude Code, Codex CLI, Gemini CLI, GitHub Copilot CLI, Amp, Crush, Factory Droid, Auggie, OpenHands | Global npm packages, binaries in ~/.local/bin, config folders such as ~/.claude, ~/.codex, ~/.gemini | Coding CLIs guide, Claude Code, Codex CLI, Gemini CLI, Amp, Crush, Factory Droid, Auggie, OpenHands |
| AI IDEs and IDE extensions | Cursor, Windsurf, Kiro, Qoder, CodeBuddy; Copilot, Cline, Roo Code, Kilo Code, Continue in VS Code | Editor installs and the editor's extensions folder per user | AI IDEs guide, IDE extensions, Cursor, Windsurf, GitHub Copilot, Kilo Code, Qoder, CodeBuddy |
| Browser AI extensions and AI browsers | Writing assistants, meeting summarizers, sidebars; ChatGPT Atlas, Perplexity Comet | Browser profile Extensions folders; browser installs | Browser extensions guide, AI browsers guide |
| MCP servers | GitHub, filesystem, database, shell or browser-automation servers | JSON, TOML or YAML config files of each AI client, user-level and inside projects | MCP server inventory, How to detect MCP servers, MCP security risks |
| Local models | Ollama, LM Studio, llama.cpp, Jan, GPT4All, Open WebUI; GGUF and safetensors files | Runtime installs, listening ports, model folders and caches | Ollama and local LLMs, Model files, Ollama, LM Studio, Open WebUI |
| AI API keys | OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY and similar | Shell profiles, agent settings, MCP configs, app config folders, .env files | Find exposed AI API keys |
| Hidden environments | Any of the above inside WSL, Docker or a local VM | The distro's or container's own file system; the hypervisor | Claude Code and Codex in WSL, AI in Docker and VMs |
Most of these install per user, without admin rights. Claude Code's documented native installer, for example, writes to the user's home folder. That is why the software inventory in your MDM, which mostly reads the list of installed programs, tends to miss them.
Why network and SaaS tools miss part of it
A proxy, secure web gateway, CASB or SaaS-discovery tool sees traffic and sign-ins. That is the right place to govern web chat use, and you should keep doing it. But much of the endpoint side never shows up as something those tools can attribute:
- Local MCP servers are child processes. In the MCP stdio transport, the AI client launches the server as a subprocess and talks to it over standard input and output. The server's own reach (your files, your shell, a database on the LAN) is not a web request to an AI service.
- Local models need no network at all. Ollama binds to
127.0.0.1:11434by default. Prompts and outputs never leave the machine, so there is nothing for a gateway to see, unless someone exposes it withOLLAMA_HOST, which is a finding in itself. - A connection is not a configuration. A proxy can log that a laptop reached an AI provider's API. It cannot tell you which program made the call, which MCP servers that program loaded, whether it runs with approval prompts turned off, or that a long-lived key sits in plain text in
~/.zshrc. - Virtual environments hide the program. Traffic from a WSL distro or a container usually leaves through the host's network stack, and a VM either shares it or has an address of its own. Either way, the tool inside is invisible to the host's software inventory.
So endpoint discovery does not replace network controls; it covers the part they cannot attribute. The full technical explanation, including what EDR and WSL policies do cover, is in Why your CASB or SWG can't see Claude Code running in WSL. If you are weighing an inventory against runtime protection, AIDR vs AI inventory explains what each one sees. For a side-by-side of approaches see Kuntur vs AppLocker, App Control and EDR and Kuntur vs Microsoft Defender.
Step 1: decide what you are counting
Before running anything, write down the categories from the table above and, for each, what "found" means. A useful rule: an install or config file means "present", and a running process or recent session data means "in use". Record per user, not just per machine, because nearly all of these tools live in the user profile. Start a simple register with three columns: tool, decision (approved, approved with conditions, unauthorized) and owner. The AI coding agent policy template and the general AI acceptable use policy give you the wording.
Step 2: check one machine by hand
Pick a developer laptop and run these as the logged-in user. They only read: they list commands on the PATH, global npm packages, well-known config folders, key variable names (never values), WSL distros and containers.
Windows (PowerShell, as the user)
# 1. AI coding CLIs on the PATH
'claude','codex','gemini','copilot','cursor-agent','opencode','goose','aider','qwen','amp','crush','droid','auggie','ollama' |
ForEach-Object { Get-Command $_ -ErrorAction SilentlyContinue } | Select-Object Name, Source
# 2. Global npm packages from AI vendors
npm ls -g --depth=0 2>$null | Select-String 'claude-code|@openai/codex|gemini-cli|@github/copilot|qwen-code|opencode|@ampcode|@sourcegraph/amp|auggie|kilocode|codebuddy|qoder'
# 3. Agent, MCP and model folders in the profile
'.claude','.claude.json','.codex','.gemini','.cursor','.codeium\windsurf','.copilot','.continue','.kiro','.qwen','.ollama','.lmstudio','.cache\huggingface' |
ForEach-Object { Join-Path $env:USERPROFILE $_ } | Where-Object { Test-Path $_ }
"$env:APPDATA\Claude\claude_desktop_config.json", "$env:APPDATA\Code\User\mcp.json" | Where-Object { Test-Path $_ }
# 4. AI key variables: names only, never values
Get-ChildItem Env: | Where-Object Name -match '(OPENAI|ANTHROPIC|GEMINI|GROQ|MISTRAL|DEEPSEEK|OPENROUTER)_API_KEY' | Select-Object Name
Select-String -Path $PROFILE.CurrentUserAllHosts, $PROFILE -Pattern '_API_KEY' -ErrorAction SilentlyContinue | Select-Object Path, LineNumber
# 5. Hidden environments
wsl -l -q 2>$null
docker ps --format '{{.Image}} {{.Names}} {{.Ports}}' 2>$null
macOS and Linux (bash or zsh, as the user)
# 1. AI coding CLIs on the PATH
for b in claude codex gemini copilot cursor-agent opencode goose aider qwen amp crush droid auggie ollama; do command -v "$b"; done
# 2. Global npm packages from AI vendors
npm ls -g --depth=0 2>/dev/null | grep -E 'claude-code|@openai/codex|gemini-cli|@github/copilot|qwen-code|opencode|@ampcode|@sourcegraph/amp|auggie|kilocode|codebuddy|qoder'
# 3. Agent, MCP and model folders; AI apps on macOS
ls -d ~/.claude ~/.claude.json ~/.codex ~/.gemini ~/.cursor ~/.codeium/windsurf ~/.copilot ~/.continue ~/.kiro ~/.qwen ~/.ollama ~/.lmstudio ~/.cache/huggingface 2>/dev/null
ls /Applications 2>/dev/null | grep -iE 'chatgpt|claude|cursor|windsurf|perplexity|lm studio|ollama|kiro|antigravity|comet|atlas'
# 4. AI key variables in shell profiles: file, line and name only
grep -nE '^[^#]*(OPENAI|ANTHROPIC|GEMINI|GROQ|MISTRAL|DEEPSEEK|OPENROUTER)_API_KEY=' \
~/.bashrc ~/.bash_profile ~/.profile ~/.zshrc ~/.zprofile ~/.zshenv 2>/dev/null | cut -d= -f1
# 5. Local model listeners and containers
lsof -nP -iTCP -sTCP:LISTEN 2>/dev/null | grep -E ':(11434|1234) '
docker ps --format '{{.Image}} {{.Names}} {{.Ports}}' 2>/dev/null
This takes a minute and is usually enough to prove the point internally. It is not a complete inventory: it misses tools not on the list, Node versions managed by nvm or Volta (each has its own global folder), MCP servers declared inside project folders, other user profiles, anything inside WSL distros and containers, and extensions. The per-tool pages (Claude Code, Cursor, MCP servers and others) go deeper on each one.
Step 3: run the checks across the fleet
The same checks scale through the tools you already use to run scripts. The mistakes that make results look clean when they are not are always the same:
- Running as SYSTEM or root.
$env:USERPROFILEand~then point at the system profile and every check comes back empty. Either run in user context or loop over every folder underC:\Users,/Usersor/home. - Only the active Node version. With nvm, fnm or Volta, list every version's global
node_modules, not justnpm ls -g. - Skipping WSL. A Linux install inside a distro is invisible from Windows paths; see finding Claude Code and Codex in WSL.
- Printing secrets. Report key names and file paths, never values, or your inventory becomes a credential dump.
Ready-made, read-only scripts for each platform:
- Windows: Intune Remediations, Configuration Manager (SCCM), Workspace ONE, NinjaOne, Datto RMM, ConnectWise Automate, PDQ, CrowdStrike RTR.
- macOS: Jamf Pro, Iru (formerly Kandji), Mosyle, Addigy.
- Both: ManageEngine Endpoint Central.
For MCP specifically, How to inventory MCP servers across your fleet covers which config files to collect and how to normalise them so the same server on two machines counts once.
What the per-MDM scripts check
The platform guides above share one detection list, taken from the paths in Kuntur's public detection catalog. Each guide only changes how the result is reported back to that tool (an exit code, a custom field, an extension attribute, one line of output). The Windows and macOS lists differ slightly, and each script file is the exact list. The common checks:
| Category | Examples | Signal the scripts test for |
|---|---|---|
| AI desktop apps | Claude, ChatGPT, ChatGPT Atlas, Codex, Gemini, Cursor, Windsurf, Ollama, LM Studio | App bundle in /Applications or ~/Applications; install folder under %LOCALAPPDATA%\Programs on Windows |
| Coding agents (CLI) | Claude Code, Codex CLI, Gemini CLI | Native binary in ~/.local/bin, global npm packages (including every nvm version), Homebrew, and the data folders ~/.claude, ~/.codex, ~/.gemini |
| Local models | Ollama, LM Studio | ~/.ollama/models, ~/.lmstudio, ~/.cache/lm-studio |
| IDE extensions | GitHub Copilot, Claude Code, Codex, Cline, Roo Code, Kilo Code, Continue, Codeium, Gemini Code Assist, Amazon Q, Tabnine | Extension folders of VS Code, Cursor and Windsurf |
| MCP configs | Claude Desktop, Claude Code, Cursor, VS Code, Windsurf | Whether the config file exists. The scripts never open it, because these files often hold API tokens in plain text; review one with the free MCP config auditor, which runs in the browser. |
All of them are read-only: they test whether paths exist, make no network calls and print tool names and paths only.
What every MDM inventory script misses
- Browser-only use. ChatGPT, Claude or Gemini in a browser tab leave nothing in these paths; that needs browser history or network data.
- Unusual install locations. A renamed binary, a CLI unpacked into a project folder or a custom npm prefix is missed. The paths are the common install locations, not every possible one.
- WSL, containers and VMs. They have their own file systems; see Claude Code and Codex in WSL and AI in Docker containers and VMs.
- Install versus use. A script reports what is present, not when it was last used. For Claude Code, recent activity in
~/.claude/projectsis the better signal (details). - New tools. The list is fixed when you paste it. A tool released next month stays invisible until someone adds a check for it.
Those gaps are the honest case for an agent with a maintained catalog. If a fixed list is enough for you, the scripts are free to keep using.
Step 4: keep it current with continuous discovery
A script run is a snapshot. New agents and MCP servers appear every month, and a developer can install one in a minute without admin rights. Whatever you use for the ongoing inventory, it should do at least this:
- cover every user profile, on Windows, macOS and Linux, including running WSL distros;
- read MCP configs at user and project level and group the same server across machines by what it actually runs (package, image or remote host), not by the name a user gave it;
- flag risky settings, not just installs: approval prompts disabled, plaintext tokens, unpinned packages, models listening on the network;
- find AI that is not on any list yet, and keep those candidates separate until someone confirms them;
- record decisions (approved, unauthorized) with who made them and when, so the inventory doubles as audit evidence (see Shadow AI audit evidence for SOC 2 and ISO 27001 and compliance).
You can build this from scripts and a spreadsheet; Kuntur vs inventory scripts is an honest look at when that is enough. The Kuntur agent does it continuously; see what it covers below.
What to do with the findings
- Decide per tool, not per machine. Mark each tool approved, approved with conditions (for example "Claude Code, company account, managed settings deployed") or unauthorized. Most of the work is a handful of decisions that then apply to everyone.
- Fix the high-severity findings first. A plaintext API key means rotate the key, then move it to a secret manager or the OS keychain. A model runtime listening on all interfaces means bind it to localhost. An MCP server with a token in its config means rotate and switch to a reference.
- Use the controls the vendors ship. Coding agents have admin policy: Claude Code managed settings, Codex
requirements.toml, Gemini CLI system settings, Cursor team settings. The policy template lists the keys for each clause, and Cursor and Claude Code security goes deeper. - Restrict what is unauthorized with the tools you already own. Discovery is not enforcement. To stop an app from running, use application control: Claude Code with Intune, Claude Code with Jamf Pro, Cursor with Intune, Cursor with Jamf Pro, ChatGPT Desktop with Intune and ChatGPT Desktop with Jamf Pro. Browser extensions are managed with browser policy (see the extensions guide), and EDR can block by hash or path where you have it.
- Write it down and re-check. Put the decisions in your policy and register, then re-run discovery to confirm the change actually landed on every machine.
What Kuntur covers, and what it does not
Kuntur is an endpoint agent for Windows, macOS and Linux with a web console. What it reads, all of it from disk, process lists and local APIs, read-only:
- the named catalog of AI desktop apps, coding CLIs, AI IDEs, local runtimes, AI browsers and AI container images listed on what Kuntur detects, by install path, binary, global npm package, running process and per-user config;
- browser extensions in Chrome, Edge, Brave, Chromium, Vivaldi, Arc, Opera, Comet, Atlas and Firefox, and IDE extensions in VS Code and its forks and in JetBrains IDEs;
- MCP servers from the config files of more than twenty clients, at user level and in the project folders it learns about from Claude Code, Codex, VS Code-family and JetBrains recent-project lists, plus stdio servers seen running as children of an AI client (details in MCP server security risks);
- risky agent settings: Claude Code
bypassPermissionsand unrestricted shell rules, Codex without sandbox or approvals, Gemini CLI YOLO mode set in its settings file; - AI API keys in shell profiles, in the AI apps' own config folders, in MCP configs and in Claude Code settings, reported as provider and masked prefix only;
- local models by runtime and by file signature, runtimes and containers listening beyond localhost;
- running WSL distros, scanned from the host; Docker and Podman containers and images through the engine API; installed hypervisors and running VMs;
- AI candidates that are not in the catalog, kept apart until you confirm them.
What it does not do, plainly:
- It does not block, uninstall or quarantine anything. You mark items approved or unauthorized; an unauthorized item in use raises a finding, and enforcement stays with your MDM, application control or EDR.
- It does not capture prompts, file contents or traffic payloads, and it cannot tell you what someone typed into an approved tool.
- It does not see inside VMs: from the host it reports the hypervisor, the VM and AI traffic from the hypervisor process. Install the agent inside the VM for an inventory.
- It does not look inside containers: containers are matched by image, so a CLI agent installed inside a dev container is not reported.
- It reports stopped WSL distros as inventory only, without starting them.
- It does not read Windows registry user environment variables or scan source repositories for
.envfiles. - It does not see bypass modes passed per session on the command line (for example
--dangerously-skip-permissionsor--yolo), or run modes set inside Cursor. - It does not see unmanaged devices: it runs on the endpoints you enroll.
Automate it
To see the inventory for one machine right now, run the free Kuntur scanner. It covers the categories above for that computer and the user running it.
- Download scan.ps1.
- Read it. It's plain text; here's what it does.
- Check its SHA-256 against the published hash:
Get-FileHash .\scan.ps1 -Algorithm SHA256 - Run it:
powershell -ExecutionPolicy Bypass -File .\scan.ps1
Windows shortcut, if you trust the source (PowerShell)
irm https://app.kuntur.io/scan.ps1 | iexmacOS and Linux (Terminal)
curl -fsSL https://app.kuntur.io/scan.sh | shIt needs no account and no admin rights, writes an HTML report to the Desktop (or home folder) and uploads nothing. You can read scan.ps1 or scan.sh before running it; what it collects is documented.
Across a fleet, the Kuntur agent keeps the same inventory current for every user on every enrolled endpoint, records where each detection ran (host, WSL distro or container), and lets you mark each tool approved or unauthorized for the whole organization, with alerts and an audit log of every decision. Rolling it out: deployment guides.
Free for up to 5 endpoints. Pro is US$3 per endpoint per month (or US$30 per endpoint per year) for 10 to 30 endpoints. The trial needs no credit card. Kuntur detects and reports; it does not block or uninstall anything.
FAQ
- What is Shadow AI on an endpoint?
- AI tools installed or configured on the laptop without review: desktop chat apps, terminal coding agents such as Claude Code or Codex CLI, AI extensions in the IDE and the browser, MCP servers, local model runtimes such as Ollama, and AI API keys stored in plain text, including inside WSL distros, containers and virtual machines.
- Can a CASB or a proxy find AI coding agents and MCP servers?
- Only partly. A proxy or CASB can log connections to AI provider APIs, but not which program made them, which MCP servers it loaded, whether approval prompts are off, which keys sit in config files, or a local model that never touches the network. Keep network controls for web chat use and add an endpoint inventory for the rest.
- Do I need admin rights to find AI tools on a laptop?
- No, to check your own profile: the commands on this page run as the user and only read. Across a fleet you either run the check in each user's context or run it as an administrator and loop over every profile folder, and you check WSL distros separately, because a Linux install inside a distro is invisible from Windows paths.
- Does Kuntur block Shadow AI tools?
- No. Kuntur detects and reports: you mark each tool approved or unauthorized and get findings when an unauthorized one is in use. To stop a tool from running, use your MDM, application control (AppLocker, App Control for Business, Jamf Restricted Software), browser policy or EDR; the restrict guides show how.
Sources
- Model Context Protocol specification: Transports (stdio and Streamable HTTP)
- Claude Code documentation: Advanced setup (install methods and locations)
- Ollama FAQ: default bind address and OLLAMA_HOST
- Claude Code documentation: Deploy managed settings
- OpenAI Codex: Managed configuration (requirements.toml)
- Gemini CLI for the enterprise: system settings
More guides and tools: