Every model call in a governed system passes a sequence of hops: the caller, some enforcement component, and the model provider's data center. Where you put the enforcement component changes what you can decide, how fast you can decide it, and how badly things break when the decision goes wrong.
An API gateway sits at the edge and handles north-south traffic, meaning requests from external clients into your services, and it is the natural place for authentication, rate limiting and routing to downstream services (Kong, Solo.io). A sidecar is a co-located process that intercepts a workload's outbound calls over a local hop, and it is the mechanism that makes a service mesh work (Design Gurus). In-process routing is an embedded SDK: the policy check runs inside your application code with no network hop at all (Trussed).
The key structural difference is not traffic direction, which is where most comparisons stall. It is where the routing decision lives and therefore who can change it. Routing in the gateway defines the policy once for all traffic; routing in application code duplicates policy in every service (Maxim AI).
A useful worked example, using numbers from the Supabase regional invocation documentation. A function that makes several database round trips took roughly 250ms when colocated with its database in us-west, 1.1s when executed in us-east, and 2.3s in Southeast Asia, a pattern reported in the Supabase discussion on regional execution (discussion). The policy layer you choose does not create that gap, but it determines whether you can see and fix it centrally.



