Comparison

Wrapper Library vs Proxy: Coverage Gaps in Shadow AI Traffic

Neither SDK/wrapper instrumentation nor network proxy monitoring provides complete visibility into AI agent traffic. Wrapper libraries only see calls routed through the instrumented SDK; proxies only see traffic that reaches their network vantage point and can be inspected. Because the two approaches intercept at different layers, their blind spots rarely overlap, and shadow AI activity typically occurs in the space neither control covers.

Questions to Ask Before Relying on Either Control

  • Which specific traffic types does this control explicitly fail to capture?
  • Does it depend on code instrumentation only, network interception only, or both?
  • How are new or unknown AI endpoints and integrations detected once they appear?
  • What happens to logging and enforcement when a call bypasses the control entirely?
  • Is SDK adoption or proxy routing actually enforced, or only assumed?
  • Can the interception mechanism and its known limitations be documented rather than asserted?

Wrapper library instrumentation works by inserting monitoring code inside an application, typically at the point where an SDK calls out to a model provider or tool. Every request that passes through the instrumented SDK call is visible, including the prompt, the model invoked, the tool parameters, and the response. This approach is accurate for the code paths it covers because it operates inside the application process, with full access to call context before any network transmission occurs. Proxy-based monitoring takes a different approach. Instead of modifying application code, a proxy sits on the network path between the application and the destination endpoint, inspecting traffic as it passes. This allows a single control point to observe calls from many applications and languages without code changes, but only if that traffic is actually routed through the proxy and is observable at the network layer. These are structurally different interception points, one at the application layer and one at the network layer, and that difference is the direct source of their respective blind spots.

Wrapper Library vs Proxy: Structural Coverage

Where Wrapper Libraries Lose Visibility

A wrapper library can only see what it instruments. Any code path that reaches a model or tool without calling through the instrumented SDK is architecturally invisible to it, not merely under-logged. Coverage degrades further as an environment grows, since every uninstrumented variant is a gap by default rather than an exception.

  • A raw HTTP request issued directly to a model provider's API, bypassing the SDK entirely.
  • A different SDK version or fork that has not received the same instrumentation.
  • A third-party or custom integration implementing its own client instead of the sanctioned SDK.
  • Tool-call logic embedded directly in agent code, invoked without passing through the monitored library layer.

Where Proxies Lose Visibility

A proxy can only see what reaches its network vantage point and can be meaningfully inspected once it does. Traffic that never traverses that path, or that cannot be decrypted at that path, is structurally invisible rather than simply unmonitored. These failure modes are not edge cases; they occur whenever an agent framework supports local models, whenever a tool runs in-process rather than as a remote service, or whenever network configuration permits an alternate route.

  • End-to-end encrypted communication with no trusted interception point available to the proxy.
  • Local or on-device model inference, which never generates network traffic in the first place.
  • Intra-process or local socket communication between an agent and a tool on the same host.
  • Non-HTTP protocols the proxy is not built to parse.
  • Direct connections to alternate IP addresses or DNS paths that route around the configured proxy.

Why the Gaps Compound Into Shadow AI

Because wrapper libraries and proxies intercept at different layers, their blind spots are largely non-overlapping. A raw HTTP call invisible to a wrapper is often visible to a well-configured proxy, and an intra-process tool call invisible to a proxy may still be visible to a wrapper if that call site happens to be instrumented. In practice, however, most enterprises rely on one approach or the other, not both in combination, and both controls share the same precondition: traffic must actually pass through the instrumented path to be seen. Without an enforced mandate requiring SDK use or proxy routing, either control can be bypassed simply by not using it. Shadow AI activity emerges in exactly this residual space, traffic that exists in the environment but falls outside every control point the organization relies on for policy enforcement and audit logging. Treating either approach as sufficient in isolation understates the actual exposure.

Two Interception Points, Two Blind Spots

Each control is accurate within its own layer and structurally blind outside it. The table below maps where visibility holds and where it does not.

Interception Point Sees Traffic When Structural Blind Spot
Wrapper / SDK layer The call is made through the instrumented SDK path, inside the application process. Raw HTTP calls, alternate SDK versions or forks, and custom clients that bypass the instrumented library.
Network proxy layer The call is routed through the proxy and is decryptable once it arrives. Local inference, intra-process tool calls, non-HTTP protocols, and traffic routed around the proxy.

Visibility That Does Not Depend on Which Path Traffic Took

Wrapper instrumentation and proxy inspection each cover real traffic, but neither reaches intra-process calls, local inference, or routes around the control point. Runtime governance that enforces agent identity and tool-call policy at execution time can close that residual gap alongside existing controls.

Explore Runtime Governance