How can you enforce zero trust when an application calls external functions?
Function calling, whether it’s a microservice invoking a downstream API, a serverless routine reaching a third‑party service, or an AI agent triggering a specialized routine, has become a core integration pattern. The convenience comes with a hidden risk: credentials are often baked into code, network paths are left wide open, and there is little visibility into who invoked what and when. In many teams the call travels straight from the caller to the target, bypassing any checkpoint that could verify the request or record its outcome.
Typical starting point: direct calls with static secrets
Most organizations begin by storing an API key or service account token in a configuration file or secret manager, then letting the application use it whenever it needs to call the function. This approach satisfies the immediate need for connectivity, but it also creates a broad blast radius. Anyone who can read the secret can issue calls, there is no per‑call audit, and sensitive responses flow back unfiltered. The setup provides identity at the provisioning stage, but it does not enforce any policy at the moment of execution.
What zero trust actually demands for function calls
Zero trust is not a single technology; it is a set of principles that must be applied at every hop. For function calling this means:
- Identity‑aware access: each request is tied to a verified identity, not just a shared secret.
- Least‑privilege scoping: the caller receives only the permissions needed for that specific function.
- Just‑in‑time verification: the request is evaluated against policy immediately before it reaches the target.
- Full audit trail: every invocation, its parameters, and its response are recorded for later review.
- Inline protection: sensitive data in responses can be masked before it reaches the caller.
Meeting these requirements demands a control point that sits in the data path of the call. Without such a gateway, the request still travels directly to the function, leaving the enforcement outcomes unattainable.
Why the data path matters
The only place you can reliably apply the zero‑trust checks listed above is at the point where traffic passes through a proxy that both sees the request and can intervene. This proxy becomes the enforcement boundary. It is responsible for verifying the caller’s token, applying just‑in‑time policies, optionally routing risky calls for human approval, masking returned secrets, and persisting a replayable session record.
hoop.dev as the zero‑trust gateway for function calling
hoop.dev implements exactly this data‑path enforcement model. It sits between the caller and the function, acting as an identity‑aware proxy that inspects the wire‑protocol of the call. Because hoop.dev is positioned in the data path, it can:
