Shadow AI in engineering teams: how to find and govern it

Shadow AI is AI use a company cannot see: personal coding agents, API keys in shells, pasted code, and unvetted MCP servers. How to find and govern it.

Published
Reading time
11 min read
Level
Intermediate
By
AI for Devs
TL;DR
  • Shadow AI in engineering teams takes four forms: coding agents on personal plans, personal API keys in shells and repos, code pasted into browser chat, and MCP servers or skills nobody reviewed.
  • Data terms depend on the plan a tool signs in with. As of November 16, 2026, consumer Claude plans keep data for 5 years when training is allowed, against 30 days on commercial plans, and personal ChatGPT plans share data for training by default.
  • Egress logs, key scanning, SSO and expense records, and an inventory of MCP config files each find some shadow AI, and none finds all four forms.
  • Vendor admin controls, including the organization IP allowlist Anthropic added on November 5, 2026, stop at the company account. Personal accounts sit outside them.
  • Bifrost, as the AI gateway, is the control plane for SSO-issued keys, budgets, guardrails, and logs, and Bifrost Edge extends that policy to AI apps, browser AI, and MCP servers on laptops.

Shadow AI is work done with AI tools, accounts, or model access that the company has not approved and cannot see. In engineering teams it looks ordinary: Claude Code on a personal plan, an API key in ~/.zshrc, a stack trace pasted into ChatGPT, an MCP server copied from a README. The fix that holds is an approved path that is faster than the workaround, plus enough visibility to see when the workaround still wins. This article covers how to find each form and how to govern it, with Bifrost, an open-source AI gateway, as the worked example for the control layer.

#What is shadow AI

Shadow AI is the AI version of shadow IT: tools, accounts, or keys used for work outside what the company approved. For developers the tools are usually mainstream coding agents and chat apps. The account is what makes them shadow.

FormExampleWhat leaves the companyWhat sees it today
Coding agent on a personal planClaude Code or Cursor on a personal subscriptionPrompts, files the agent reads, command outputSoftware inventory
Personal API keyANTHROPIC_API_KEY in a shell profile or .envWhatever a script sends, billed to a personal cardSecret scanners, once it reaches a repo or log
Browser chatA stack trace and a source file pasted into chatgpt.comExactly what was pastedProxy logs, domain only
Unvetted MCP server or skillAn npx -y server from a README, or a folder in ~/.claude/skillsAnything its tools can read, plus keys in its configA config file in the home directory

The last row is the least watched. A local MCP server runs with the developer's own file and network permissions, and building one takes an afternoon. The MCP hub covers the protocol.

#Why developers use shadow AI

Developers use unapproved AI because it works and the approved option is missing or worse. Stack Overflow's 2026 Developer Survey, with 30,903 responses from 169 countries, published October 6, 2026, found coding assistants and agents were the top AI use case at 66%, ahead of chatbots at 63%.

Deloitte UK's GenAI Workforce Survey 2026, fielded in May and June 2026 with insights from 25,000 UK workers, found 31% of GenAI users use it without their employer knowing and 17% pay for their own tools. Among people using tools that may not be approved, 21% said those tools beat the company's, and 14% said they are essential to the job but unfunded.

In the Stack Overflow survey, 29% of 11,462 respondents said a tool meeting security and privacy requirements matters when they adopt or expand it. A policy can ask for controls, as long as the approved tool is as good.

#Shadow AI risks for engineering teams

Shadow AI carries four risks in engineering teams: code and secrets leave, retention follows a consumer plan, spend has no cap, and an unreviewed tool can feed instructions to an agent with shell access.

#Source code and secrets leave the company

A coding agent sends each prompt, and every file it reads, to the model provider. Claude Code's data usage page says it sends all prompts and model outputs, and it keeps session transcripts in plaintext under ~/.claude/projects/ for 30 days by default. A key read from a .env file travels with the rest.

#Terms and retention follow the plan

The same app runs under different terms depending on its account, as of November 16, 2026:

PlanTrains on your data by defaultDefault retention
Claude Free, Pro, Max, and UltraOnly if the user allows it5 years if training is allowed, otherwise 30 days
Claude Team, Enterprise, and APINo30 days; zero retention for qualified Enterprise accounts
ChatGPT Free, Plus, and ProYes, until the user turns it offNot stated on the data controls page
ChatGPT Business, Enterprise, and Edu; OpenAI APINoConfigurable, including zero retention on the API

Sources are the data usage page, Anthropic's consumer terms update, and OpenAI's data controls article and business data page. A developer on a personal plan has accepted consumer terms for the company's code.

#Spend has no owner

A personal key bills a personal card that finance never sees. A shared company key with no budget is worse, because nothing caps it, and rates differ widely between models (see the LLM pricing dataset).

#Prompt injection arrives through tools

An agent reads tool results, web pages, and files as input, and any of them can carry instructions. OWASP's LLM01 entry calls this indirect prompt injection. The MCP specification, version 2026-07-28, says clients must treat tool annotations as untrusted unless they come from trusted servers, and should validate tool results before the model sees them.

Claude Code's skills docs add that a skill can run shell commands before its content reaches the model and can grant itself broad tool access. Review a skill in a repository as you would a script.

#How to detect shadow AI

Detect shadow AI with four signals, because each one misses a form that another catches. Figure 1 maps the coverage.

Five forms of shadow AI against five signals: no single detection signal finds every form, and gateway plus Edge covers the most but lists skills only as trafficEgress logsKey scansSSO, expensesEndpoint filesGateway + EdgeCoding agentpersonal plandomain onlyno key usedif expensedapp installedrouted by userAPI keypersonal, in shelldomain onlyrepo, logs, rcif expensedshell filesprovider hostsBrowser chatpasted codeno contentnothing storedwork sign-insno installtwo sites onlyMCP serveradded from a READMEunknown hostskeys in configno sign-inconfig filesallow or denySkillcopied into a reporuns locallykeys in fileno sign-inSKILL.md filestraffic onlyfinds itfinds some casesmisses it
Fig. 1No single signal finds every form of shadow AI. Config files on the laptop reveal MCP servers and skills that network logs never see, and browser chat leaves nothing on the machine to inventory.

#Egress and DNS logs

Proxy and DNS logs show which AI services each device reaches: api.anthropic.com and claude.ai, api.openai.com and chatgpt.com, generativelanguage.googleapis.com for the Gemini API, and *.cursor.sh from Cursor's network configuration docs. They show a domain and a volume, not the account, so a company Claude seat and a personal one look the same.

#Key scanning

Gitleaks v8.30.1, released March 21, 2026, ships 222 default rules, including rules for Anthropic and OpenAI keys. Since November 9, 2026, GitHub secret scanning also checks Actions workflow logs, in public preview for GitHub Enterprise Cloud with Secret Protection or Advanced Security. It stays off until an enterprise owner turns it on, skips runs that finished earlier, and sends no notifications during the preview. These commands were not run for this article:

Shell
gitleaks git -v .                    # every commit in the current repository
gitleaks dir -v ~/.zshrc ~/.cursor   # a shell profile and an editor config

#SSO and expense records

Identity and finance data find accounts, not usage. In Google Workspace, OAuth log events record each time a third-party app is authorized to access a work account's data. Card feeds show AI subscriptions that nobody approved.

#Endpoint inventory

MCP servers and skills live in config files that app inventories do not read. This script lists MCP servers from Claude Code, Claude Desktop, Cursor, and Codex, flags skills that run shell commands or set allowed-tools, and masks provider keys found in shell profiles.

ai_inventory.py
Python
"""List MCP servers, skills, and inline AI keys under one home directory. Python 3.11+."""
import json
import re
import sys
import tomllib
from pathlib import Path
 
KEY = re.compile(r"sk-ant-[\w-]{20,}|sk-(?:proj|svcacct|admin)-[\w-]{20,}|AIza[\w-]{35}|ghp_[0-9A-Za-z]{36}")
SHELL_FILES = [".zshrc", ".zprofile", ".bashrc", ".bash_profile", ".profile"]
MCP_CONFIGS = [
    ("Claude Code", ".claude.json"),
    ("Claude Desktop", "Library/Application Support/Claude/claude_desktop_config.json"),
    ("Claude Desktop", ".config/Claude/claude_desktop_config.json"),
    ("Cursor", ".cursor/mcp.json"),
    ("Codex", ".codex/config.toml"),
]
 
 
def masked_keys(text: str) -> str:
    return ", ".join(m[:7] + "..." for m in KEY.findall(text)) or "-"
 
 
def servers(path: Path) -> dict:
    if path.suffix == ".toml":  # Codex keeps each server in a [mcp_servers.<name>] table
        return tomllib.loads(path.read_text()).get("mcp_servers", {})
    data = json.loads(path.read_text())
    found = dict(data.get("mcpServers", {}))
    for project, cfg in data.get("projects", {}).items():  # Claude Code local scope
        for name, server in cfg.get("mcpServers", {}).items():
            found[f"{name} ({project})"] = server
    return found
 
 
def inventory(home: Path):
    for tool, rel in MCP_CONFIGS:
        if (home / rel).is_file():
            for name, s in servers(home / rel).items():
                target = s.get("url") or " ".join([s.get("command", ""), *s.get("args", [])])
                yield tool, name, target, masked_keys(json.dumps(s))
    for skill in sorted(home.glob(".claude/skills/*/SKILL.md")):
        text = skill.read_text()
        flags = [f for f, hit in (("runs shell", "!`" in text), ("allowed-tools", "allowed-tools:" in text)) if hit]
        yield "Claude Code skill", skill.parent.name, ", ".join(flags) or "-", masked_keys(text)
    for rc in SHELL_FILES:
        if (home / rc).is_file() and (keys := masked_keys((home / rc).read_text())) != "-":
            yield "Shell", rc, "exported key", keys
 
 
if __name__ == "__main__":
    for row in inventory(Path(sys.argv[1]).expanduser()):
        print(" | ".join(row))

It ran on Python 3.15.1 on November 16, 2026, against a synthetic home directory with fake keys. No real machine was scanned.

Text
$ python3 ai_inventory.py ./fakehome
Claude Code | github | https://api.githubcopilot.com/mcp/ | -
Claude Code | postgres (/Users/dev/payments) | npx -y @example/postgres-mcp postgresql://localhost/payments | -
Claude Desktop | filesystem | npx -y @modelcontextprotocol/server-filesystem /Users/dev/Desktop | -
Claude Desktop | web-search | npx -y @example/search-mcp | sk-proj...
Cursor | tickets | https://mcp.tickets-bridge.example/sse | -
Codex | docs | uvx example-docs-mcp | -
Claude Code skill | release-notes | runs shell, allowed-tools | -
Shell | .zshrc | exported key | sk-ant-...

The paths come from the Claude Code, Cursor, and Codex docs. Run it with consent and collect counts, not keys.

#Where vendor admin controls stop

Vendor admin controls govern one vendor's tool and the company's own accounts. Turn them on, and plan for what they leave out.

By default, anyone running Claude Code can connect any MCP server. Admins restrict that with a managed-mcp.json file or with allowedMcpServers and deniedMcpServers in managed settings, and the docs warn that serverName entries are not a security control because users choose the name. Cursor Enterprise has its own MCP allowlist, matched by command and URL.

On November 5, 2026, Anthropic added an organization IP allowlist in beta, with up to 1,000 addresses or ranges, which limits where a leaked company key or a stolen Enterprise sign-in works. The Compliance API gained Security posture data for Claude Enterprise the same day. The allowlist docs note that a blocked user can still sign in to a personal account.

Each control has its own format and console, and each stops at the company account.

#A shadow AI policy developers will accept

A shadow AI policy holds when the approved path is faster than the workaround, so write it around what developers get.

WorkaroundApproved pathWhy it wins
Personal Claude or ChatGPT planA company seat on commercial termsSame app, no personal bill
API key in ~/.zshrcSSO sign-in that issues a per-person keyNothing to paste, rotate, or leak
MCP server from a READMEA catalog entry reviewed within a set number of daysConfigured once, with credentials held centrally
Code pasted into a browser tabAn approved chat on the same modelsSame workflow, with secrets caught first

The table stays true under these rules:

  1. Fund the tools people already use before blocking anything. Deloitte's 14% who called their tools essential but unfunded describes a budget gap.
  2. Issue credentials from the identity provider, never as shared keys, and show each person their remaining budget.
  3. Publish an MCP and skills catalog with a review deadline, and let pending requests keep working during the first rollout.
  4. Publish what is logged and who can read it.

Rules 2 and 3 need a system that ties keys to identity and records budgets and logs, which is the job of an AI gateway.

#How an AI gateway governs approved AI traffic

An AI gateway governs approved traffic by putting identity, budgets, guardrails, and logs on the one path every sanctioned request takes. In this setup Bifrost is the control plane and policy engine, with one OpenAI-compatible API in front of 10,000+ models across 25+ providers.

On Bifrost Enterprise, user provisioning connects Okta, Microsoft Entra ID, Google Workspace, or any other OIDC provider, with SCIM sync. An access profile attached to a role sets providers, models, budgets, rate limits, and MCP access, and each user gets a write-protected virtual key with their own counters. Budgets stack, so a request must clear the key's budget and every team and customer budget above it. A key with no MCP configuration gets no MCP tools, except from clients an admin marks Allow by Default.

Guardrails run on requests and responses. Secrets detection embeds the same Gitleaks v8.30.1 default rules and can detect, block (the default), or redact. Rules with the mcp target inspect a tool's arguments before it runs and its result after it returns, which is where instructions injected through a tool appear. Request logs attribute each call to a user and key, and audit logs record admin changes with HMAC signatures.

With Enterprise SSO, the Bifrost CLI starts Claude Code with a short-lived token from an apiKeyHelper, so no long-lived key lands in Claude settings. These commands were not run for this article:

Shell
bifrost context add production --base-url https://bifrost.example.com --use
bifrost auth login
bifrost claude --model anthropic/claude-opus-5-5

A gateway governs only the traffic sent to it, so a developer who never runs those commands stays outside it.

#Bifrost Edge: the same policy on every laptop

Bifrost Edge extends the gateway's governance to employee machines, routing AI apps, browser AI, coding agents, and their MCP servers to the Bifrost Gateway without per-app setup. Edge enforces the keys, budgets, guardrails, and logs configured at the gateway, not a separate policy. It runs on macOS, Windows, and Linux, requires the Bifrost Enterprise Gateway, and is priced per endpoint.

Apps on a laptop send AI traffic to Bifrost Edge, which routes it to the Bifrost Gateway for identity, budgets, guardrails, and logs before providers; policy syncs back, denied apps stop on the device, and other traffic is not routedEmployee laptopClaude Codeterminal agentCursorAI editorchatgpt.combrowser AIMCP serversin each appBifrost EdgeSSO sign-inDenied appstops on deviceOther trafficnot AI domainsNot routed through EdgeAI onlypolicydefault 60 sBifrost GatewayVirtual key from SSOBudgets, rate limitsGuardrailsLogs by userProviders25+ supported
Fig. 2Edge sends only AI traffic from the laptop to the gateway, where the user's SSO-issued key, budgets, guardrails, and logs apply. Policy syncs back to the device, a denied app stops before anything leaves, and other traffic is not routed.

A user signs in once through company SSO, which links the machine to the user and syncs policies. A tray agent shows status and the active key's budget, and lets the user turn routing on or off. Edge intercepts only configured AI domains, using an organization certificate each device must trust, and passes traffic through uninspected until it does.

As of November 16, 2026, the supported applications are Claude Desktop, ChatGPT desktop, Cursor, Codex desktop, Antigravity desktop, Claude Code, Codex CLI, OpenCode, Antigravity CLI, ChatGPT web, and Claude web, plus traffic to every provider Bifrost supports. Gemini CLI support is deprecated in favor of Antigravity CLI.

With app governance, a denied app is blocked before data leaves the machine. MCP governance reads the MCP configuration inside Claude Code, Claude Desktop, Cursor, Codex, OpenCode, and Antigravity, builds a fleet-wide inventory, and enforces denials on the device, even for servers configured before the policy existed.

A newly discovered app or MCP server is pending; with Allow pending on it keeps working, with it off it is blocked; an admin approves or denies it, and the decision applies at the next check-inDiscoverednew app or MCP serverPendingin the Approvals listAllow pending: onkeeps workingAllow pending: offblocked until approvedapprovedenyApprovedallowed, governed by policyDeniedstopped on the deviceDecisions reach each device at its next check-in: every 60 s by default, 5 s at the minimum
Fig. 3Each new app or MCP server Edge discovers starts as pending. The Allow pending setting decides whether it works during review, and an approval or denial reaches each device at its next check-in.

The Approvals dashboard keeps deduplicated catalogs of apps and MCP servers, with bulk actions. In Edge settings, agents poll every 60 seconds by default, with a 5-second minimum. Gateway guardrails apply to Edge traffic with nothing configured on the endpoint, so a secret typed into ChatGPT on the web meets the same secrets rule as an API call.

The Edge docs inventory MCP servers but not skills, so keep the file scan for skill folders. Edge also covers AI traffic only and runs next to existing endpoint and network security tools.

#A shadow AI rollout that keeps developers working

Roll out visibility first, approved paths second, and denials last, so nobody loses a working tool before its replacement arrives.

  1. Run the four detection signals for two weeks without blocking anything, and count each form.
  2. Build the approved path: an identity provider, a role, and an access profile with the models, budgets, and catalog MCP servers developers need, in the order Prepare identity and access gives.
  3. Pilot Bifrost Edge with a direct install. A device is ready when the tray shows Connected, the machine restarted after trusting the certificate, Diagnostics reports Healthy, and a test request appears in the logs under the right user, per sign in and verify.
  4. Roll out through MDM, using Jamf, Microsoft Intune, Kandji, Omnissa Workspace ONE, or JumpCloud, with pending items allowed, and work through the Approvals catalog.
  5. Turn off Allow pending and deny what the catalog rejected, telling affected developers first. Claude Code's docs note that a server blocked by policy vanishes from its list without a reason.
  6. Rerun the detection signals monthly, and measure success by the workaround counts from step 1.

The Bifrost and Edge details here describe the products as of November 16, 2026.

#Questions

What is shadow AI?

Shadow AI is work done with AI tools, accounts, or model access that a company has not approved and cannot see. In engineering teams it usually means mainstream tools on the wrong account: coding agents and AI editors on personal plans, API keys exported in a shell, code pasted into browser chat, and MCP servers or skills installed without review. The tools work. The account, the terms, and the missing record are the problem.

What is an example of shadow AI?

A developer signs in to Claude Code with a personal Pro plan and runs it on the company repository. Every file the agent reads goes to Anthropic under consumer terms, which keep data for 5 years when the user allows training, against 30 days on commercial plans, as of November 16, 2026. No company log records the session, and no company budget caps it.

Is shadow AI the same as shadow IT?

Shadow AI is a kind of shadow IT with two differences. The data leaves a few lines at a time inside prompts, rather than as whole files. And agents act: a coding agent connected to an unreviewed MCP server can read files and run commands on the laptop, so the risk covers what the tool does as well as what it stores.

How do you detect shadow AI?

Combine four signals. Egress and DNS logs show which AI domains devices reach. Key scanners such as Gitleaks and GitHub secret scanning find provider keys in repositories and logs. SSO and expense records show accounts and subscriptions. An inventory of MCP config files and skill folders on each machine finds tools that network logs never see. Each signal misses at least one form.

Should a company ban personal AI accounts for work?

Ban them only after an approved alternative exists and works at least as well. In Deloitte UK's 2026 GenAI Workforce Survey, 21% of people paying for or using tools that may not be approved said those tools outperform what their company provides. A ban without a better approved path moves the same usage to a phone or a personal laptop, where it is harder to see.

Does an AI gateway stop shadow AI on its own?

No. A gateway governs the traffic sent to it, so it covers approved apps and the developers who point their tools at it. Tools on laptops that were never configured for the gateway stay outside it. Bifrost Edge closes that gap by routing AI traffic from supported apps, browser AI, coding agents, and MCP servers on each machine through the Bifrost Gateway under the same policy.