Skip to content

Security and governanceGuide

Finding shadow AI: unapproved model API usage and how to govern it

Every company with engineers has AI API keys it does not know about: on personal cards, in old projects, in a prototype that became production. Here is how to find them with the providers' own admin APIs and your own logs, and how to bring them under policy without a ban.

By INFRO Editorial

Published

6 min read

A dark ground where several faint amber lines run outside a lit glass boundary while others pass through it, representing AI traffic inside and outside governance

In short

Shadow AI API usage is model API traffic your organization did not approve or cannot see: keys on personal or team cards, unmanaged projects, prototypes in production. Find it by combining expense and card data, the providers' admin APIs (OpenAI's audit logs and project API key lists, Anthropic's API key list and usage report), egress logs for provider hostnames, and code and secret scanning. Then offer an approved path that is easier than the shadow one — a central gateway with keys per team, budgets and an allowlist — and a short written policy, rather than a ban.

Key takeaways

  • Shadow AI usage is model traffic you did not approve or cannot see; it is usually well-meant and badly governed.
  • Find it from four sources: card and expense data, provider admin APIs, egress logs for provider hosts, and code and secret scanning.
  • OpenAI's Admin API lists project API keys and audit log events; Anthropic's lists API keys by workspace and reports usage by key.
  • Replace shadow usage with an approved path that is faster to use: keys per team in minutes, budgets, an allowlist, no procurement wait.
  • Write a one-page usage policy covering data classes, approved providers, key handling and who approves exceptions.

How do you find shadow AI usage? Look in four places: card and expense data for provider charges, the providers' own admin APIs for keys and projects in accounts you control, egress logs for traffic to provider hostnames, and code and secret scanning for keys in repositories. Then make the approved path easier than the shadow one — a central gateway that issues keys per team in minutes, with budgets and a model allowlist — and write a one-page policy. Bans without an alternative only move the traffic further out of sight.

What shadow AI usage looks like

For engineering organizations, shadow AI is rarely a rogue tool. It is usually one of these:

  • A key on a personal or team card. Someone needed a model for a prototype and expensed the account.
  • An unmanaged project in the company account. Created by someone who has since left, still holding a live key.
  • A prototype that became production. It calls a provider directly, with no budget, no logging and no review of the data it sends.
  • A coding agent on a personal subscription, running against company code.
  • A vendor or contractor integration using its own model account with your data.

Each is a cost risk (spend nobody budgets), a security risk (keys nobody rotates) and a data risk (prompts carrying information nobody classified). None is solved by finding the people involved and telling them off; they were solving a real problem faster than the approved route allowed.

Four ways to find it

1. Money

Search card statements and expense reports for every model provider and cloud AI service. A recurring charge from a provider your platform team does not manage is the most reliable signal there is, and it surfaces accounts you have no admin access to. Ask finance for a monthly report filtered on provider names.

2. The providers' admin APIs

For accounts the company owns, the providers expose what you need:

  • OpenAI. The Admin API's audit log lists user actions and configuration changes in an organization, filterable by actor, project, resource and event type, including API key creation, updates and deletion; project endpoints list each project's API keys with their owner and a redacted value12.
  • Anthropic. The Admin API lists API keys across the organization, filterable by status and workspace, and the usage report breaks token usage down by model, workspace and service tier and can filter by API key34.

Run both monthly. Look for keys with no recent owner, keys in projects or workspaces nobody claims, and usage on keys outside your gateway. Admin keys are powerful, so hold them in the platform team only; least privilege for provider admin keys covers how.

openai_key_inventory.py
import os
import requests

ADMIN = {"Authorization": f"Bearer {os.environ['OPENAI_ADMIN_KEY']}"}
BASE = "https://api.openai.com/v1/organization"

projects = requests.get(f"{BASE}/projects", headers=ADMIN, params={"limit": 100}).json()["data"]
for project in projects:
    keys = requests.get(f"{BASE}/projects/{project['id']}/api_keys", headers=ADMIN).json()["data"]
    for key in keys:
        owner = (key.get("owner") or {}).get("user", {}).get("email", "service account")
        print(project["name"], key["name"], owner, key.get("last_used_at"))

The script is a starting point: paginate, write the output somewhere durable, and compare it month to month.

3. Egress

If production traffic leaves through a proxy, NAT gateway or firewall that logs destinations, search for provider API hostnames — api.openai.com, api.anthropic.com, generativelanguage.googleapis.com and the rest — by source service. Traffic to a provider from a service that should be going through your gateway is shadow usage by definition, and the source tells you who to talk to.

4. Code and secrets

Secret scanners in your repositories and CI catch provider keys committed to code, and a code search for provider SDK imports and base URLs lists every service that calls a model directly. Treat a committed key as compromised: revoke it at the provider, then find out why it was there.

Make the approved path faster

Shadow usage exists because the official route was slower. Fix that first:

Shadow usage happens because…The approved path should offer
Getting a key takes a ticket and a weekA key per team or service in minutes, self-service
Procurement for a new provider takes monthsPre-approved providers and models, with an allowlist
Nobody knows what they may spendA budget per team, visible to the team
Prototypes need models nowA sandbox environment with a small budget and no production data
Coding agents need setupA documented gateway configuration and a key per developer

A central gateway or control plane makes this practical: provider accounts are held once, centrally; teams get scoped keys; budgets and allowlists are enforced before the provider is called; and every request is attributed. Once that exists, retiring shadow keys is a migration, not a confrontation.

A one-page AI usage policy

A policy engineers read is short. Cover five things:

  1. Data. Which data classes may be sent to which providers (for example: public and internal data to approved providers; customer personal data only through approved paths with guardrails; credentials and secrets never).
  2. Providers and models. The approved list, and how to request an addition.
  3. Keys. Provider keys are held centrally; applications and people use scoped gateway keys; no provider keys in code, laptops or personal accounts.
  4. Spend. Every key has a budget; who can raise it.
  5. Exceptions. Who approves them, and how long they last.

Review it twice a year. The provider and model list will change faster than the rest; model access governance covers keeping the allowlist current.

Moving shadow usage onto the approved path

Finding shadow keys is the start. Moving the traffic without breaking anything takes a plan per key:

  1. Identify the owner and the workload. Who created it, what calls it, how much it spends, and what data it carries.
  2. Offer the replacement first. Issue a key on the approved path with a budget that covers the current spend, and a short guide to switching the base URL.
  3. Run both for a short overlap. Let the team move traffic behind a flag and confirm nothing breaks.
  4. Set a revocation date. Agree it with the owner; revoke the shadow key at the provider on that date.
  5. Close the account if it was personal. Make sure a personal provider account used for company work is cleaned up, including any data it retained.

Governing it with INFRO

INFRO holds your provider accounts' credentials once, sealed, and issues gateway keys per team, service or developer that can be limited to chosen providers, environments and IP ranges. Model allowlists apply at organization, project and key level; budgets at organization, project, member and key level refuse a request before the provider is called; and every request is attributed by project, key and model. The audit log records who created keys, changed allowlists and raised budgets. It does not discover keys in accounts you have not connected — the four searches above do that — but it gives the traffic you find somewhere governed to move to.

Summary

Find shadow AI with money, admin APIs, egress logs and code scanning. Then make the governed path faster than the ungoverned one — self-service keys, budgets, an allowlist, a sandbox — write a one-page policy, and retire the shadow keys as teams move.

Questions readers ask

What is shadow AI?
AI usage an organization has not approved or cannot see. For engineering teams it usually means model API keys on personal or team cards, unmanaged provider projects, or prototypes calling a model in production without review. It is rarely malicious; it exists because the approved path was slower.
How do I find OpenAI API keys in my organization?
For accounts you own, OpenAI's Admin API lists API keys per project with their owner and a redacted value, and its audit log records key creation, updates and deletion. For accounts you do not own, look at card and expense data, egress logs for api.openai.com, and secret scanning of your repositories.
Should we ban unapproved AI tools?
A ban without an alternative pushes usage further out of sight. Offer an approved path that is faster than the shadow one — keys in minutes, clear budgets, an allowlist of models — and a short policy on data, then retire the shadow keys as teams move.

From the team that builds it

Where this shows up in INFRO

INFRO is a control plane in front of the provider accounts you already hold. The capabilities below are the parts of it this article touches, each with the documentation that defines its behaviour.

INFRO accounts are self-serve. Provider usage is billed to you by your providers; INFRO charges a software subscription and takes 0% of model spend. See plans.

Sources

Numbered in order of first citation. Each was opened and checked against the claim on the date shown.

  1. 1.List audit logs (opens in a new tab) — OpenAI. Accessed Oct 20, 2026.
  2. 2.Admin APIs (opens in a new tab) — OpenAI. Accessed Oct 20, 2026.
  3. 3.Admin API (opens in a new tab) — Anthropic. Accessed Oct 20, 2026.
  4. 4.Usage and Cost API (opens in a new tab) — Anthropic. Accessed Oct 20, 2026.

About this article

Provider capabilities are taken from OpenAI's Admin API and audit log documentation and Anthropic's Admin and Usage and Cost API documentation, opened on 2026-10-20. Discovery methods are general security practice. INFRO is described from its own documentation. Written by the team that builds INFRO.

Last checked against its sources on . The next review is due by . No separate named reviewer is recorded for this article.

How articles are written, sourced and corrected is set out in the editorial standards.