API discovery finds every API you actually run, including shadow and orphaned endpoints. Learn what they are, why they matter, and how to find them.

TL;DR
- API discovery finds every API an organization actually runs, including endpoints missing from the official inventory.
- A shadow API was never documented or approved; an orphaned API was documented once, then lost its owner.
- Discovery combines live traffic, code, documentation, infrastructure, DNS, certificates, and logs, then reconciles them with the catalog.
- OWASP lists Improper Inventory Management as API9 of its ten 2023 API risks and rates it widespread.
Answer capsule
What is API discovery?
API discovery is the practice of finding every API an organization runs, whether or not it was formally documented or approved, by comparing live traffic, code, and infrastructure with the official inventory. OWASP rates the resulting gap, Improper Inventory Management (API9:2023), as widespread.
The API had been running for two years.
A contractor had built it for a feature that shipped, but nobody formally handed it off when the work was done. The contractor moved on. The endpoint remained live, still processing production data, but it was absent from the organization's official API documentation.
The team found it during a security audit.
That is the problem with APIs you do not know what you have. This article explains what API discovery means, how shadow APIs differ from orphaned APIs, and the methods teams can use to find them. It also explains why discovery has to be continuous: new APIs can appear during ordinary development long before anyone updates the official inventory.
What is API discovery?
API discovery is the practice of finding every API an organization runs across its environments, whether or not those APIs were formally documented or approved. It compares what is actually running with what your API catalog says should be running, using signals such as live traffic, code repositories, and infrastructure.
An API catalog tells you what your organization believes it has. API discovery tests that assumption against reality. An endpoint can be missing from the catalog but still receive production traffic. Discovery exposes that gap.
That makes API discovery an ongoing process, not a one-time audit. New APIs can appear as teams build features, add integrations, or deploy services, while older APIs may remain active long after their original owners or use cases have disappeared. And, just as important, continuous discovery can tell you when an API or its dependencies have been modified, so your information doesn’t get stale.
Reliable discovery therefore needs more than an API gateway or documentation repository. It should draw on traffic, code, and infrastructure to build a more complete picture of what is actually running.
What are shadow APIs and orphaned APIs?
Shadow APIs and orphaned APIs are different problems, even though both can exist outside an organization's current API inventory.
A shadow API is an API that was never formally documented or approved. It may have been created for a specific feature, test, or third-party integration and never added to the official inventory. The security team may not know it exists.
An orphaned API is an API that was documented and known at some point but has since lost its owner. The team that built it may have moved on, the feature may have been deprecated, or the person who understood it may have left. The API can remain running without anyone actively maintaining or reviewing it, causing the API to still show up in the catalog but have significant differences in function or dependencies than were originally documented.
The difference is straightforward: a shadow API was never accounted for; an orphaned API was accounted for and then forgotten. Both can be missed by a security review that relies only on current documentation.
How do I discover shadow and undocumented APIs?
Discovering shadow and undocumented APIs usually requires combining several sources. No single method can show everything that is running across an organization's environments.
The key is correlation across sources, creating a single source of truth. Traffic shows what is being used, code shows what has been built, and infrastructure shows what is deployed. Comparing those signals with the official inventory gives you a more complete view of the APIs actually in operation.
Why is API discovery important for API security?
API discovery matters for API security because you cannot secure, test, or apply a policy to an API you do not know exists. This connects directly to API9:2023, Improper Inventory Management, in the OWASP API Security Top 10, which identifies incomplete or outdated API inventories and documentation as security weaknesses.
API discovery does not secure an API by itself. It gives security teams the visibility needed to identify what is running, determine what needs review, and apply the appropriate controls.
How do you keep API discovery current, not just accurate once?
API discovery is not a project you finish once. It must keep pace with APIs being deployed and retired across your environments, or the inventory will become incomplete again.
- Point-in-time audits go stale: An inventory can be accurate when it is created but become incomplete as new APIs are deployed and existing ones change.
- Shadow APIs can appear through ordinary work: A quick integration, a test endpoint left running, or a new microservice can introduce an API that never makes it into the catalog.
- Continuous discovery keeps the inventory current: Monitoring live production traffic helps teams identify APIs as they appear instead of waiting for the next periodic audit.
The goal is to keep knowing what APIs are actually running.
How Harness discovers and protects live APIs
The challenge
The hard part of API security is knowing what is actually running, which documentation alone cannot show.
The approach
The Harness Runtime Protection Agent continuously discovers APIs from the edge, inline, and out of band, so it can identify newly surfaced endpoints as they appear wherever they appear.
Find every API from live traffic and prioritize them.
Harness API Posture Management continuously discovers API endpoints from live traffic, including shadow and forgotten APIs, and assesses their exposure, vulnerabilities, and drift. It provides the visibility needed to understand what APIs are actually running and identify endpoints that may have been missed by the official inventory. It offers multiple deployment options and can collect data from everywhere so no APIs are missed. It then assesses and scores the risk of each API so security teams can prioritize appropriately.
Act on what discovery finds.
Once an endpoint is discovered, Harness API Advanced Protection provides contextual runtime threat protection using behavioral analysis to detect and block malicious API activity. This extends protection beyond knowing an endpoint exists to detecting threats against APIs while they run.
Extend discovery to AI-fronting endpoints.
The same continuous discovery model extends to AI workloads. Harness AI Security monitors AI API traffic to discover LLMs, MCP servers, AI services, and agents, including AI assets that were never formally inventoried. This gives security teams visibility into AI endpoints alongside the rest of their API surface.
The outcome
The result is a unified view of the API surface built from live traffic: newly surfaced endpoints appear as they are observed, and each one can move from discovery to posture assessment to runtime protection.
What this means for your APIs
The test is whether every endpoint you discover has a corresponding entry in that catalog and that each entry has a current risk assessment. That shift matters because APIs can disappear from view in two ways: they can be created without ever being documented, or they can remain active after their owners and documentation have disappeared.
API discovery addresses both problems by combining live traffic with code, infrastructure, DNS, certificates, and logs. The result is a view of what is actually running, not just what your documentation says should be running.
See how Harness continuously discovers the APIs carrying live traffic, shadow and forgotten ones included.



