Guide

AI Gateway or Endpoint Hook: What Each One Sees of an AI Agent [2026]

APERION guide card: gateway or endpoint hook, what each one sees.

An AI gateway sees the model calls and tool calls that are routed through it. An endpoint hook sees what a coding agent is about to do on one laptop: the shell command, the file read, the tool call. Each misses part of what the other sees. A firm with agents on servers and coding agents on laptops needs a control at both points and one record that joins them.

Regulatory references verified as of November 22, 2026.

Two places a control can sit

A control for an AI agent can sit in one of two places. Each place has a limit, and each limit can be checked.

On the call path. A gateway sits between an agent and the models and tools it calls. Policy is applied to each call before it proceeds. The gateway works for any agent whose traffic can be pointed at it: a server-side agent, an internal application, an agent on a platform that lets an administrator set the model endpoint.

On the endpoint. Coding agents such as Claude Code, Cursor and Codex expose hooks: points where a program can inspect what the agent is about to do and allow it or refuse it, and on some events ask the developer. A control in those hooks sees the agent's native actions on the machine, before they run.

What each one sees

Question Gateway on the call path Hook on the endpoint
A prompt sent to a model Yes, when the call is routed through it The user's typed prompt, where the agent exposes a prompt hook
A model's response Yes, when routed The final reply, after it is written, where the agent exposes the event
An MCP tool call Yes, when the MCP server is reached through it Yes, before the server receives it
A shell command the agent runs Only the model's request for it, when the agent's model traffic is routed through it. The command runs locally Yes, before it runs
A file the agent reads or edits Only what is sent to the model, when routed Yes, where the agent exposes the event
A coding tool's own model traffic to its maker's service No, unless that traffic can be repointed The actions that follow it
A server-side or hosted agent Yes, when routed No. An endpoint hook covers the machine it is installed on
A person who is not the developer approving the action Yes, where the gateway can pause a call for an approver Not natively. The hook's question goes to the developer at the keyboard
Table graphic: what an AI gateway on the call path and a hook on the endpoint each see of an AI agent. A gateway sees prompts, responses and MCP tool calls routed through it, and can pause a call for an approver. A hook sees the user's typed prompt, the final reply, MCP tool calls, shell commands and file events on the machine it is installed on, and its native question goes to the developer at the keyboard.
What each control sees. Coverage on the call path depends on routing; on the endpoint, on which events the agent exposes.

Two rows deserve a second read.

The shell command. An agent that deletes a directory or reads a credentials file does it with a local tool. At most, a gateway carrying the agent's model traffic sees the model's request for the action. It cannot see the action run.

The second person. A hook can stop an agent and ask. The person it asks is the developer who is running the agent. For an action that needs someone else's approval, the call has to wait where that person can reach it. On the call path, a call can pause until that person decides.

What each one misses

A gateway misses anything that is not routed to it. That includes local tools, a coding assistant's traffic to its own service, and any agent whose owner never changed the endpoint. Coverage is a routing fact, and it can be tested: list the agents, then list the ones whose calls appear in the gateway's log.

A hook misses everything that is not on a hooked machine. That includes server-side agents, hosted agent platforms and commands a developer types in their own terminal. Some after-the-fact hook events can only observe: the action has already run.

Each limit follows from where the control sits. A firm with agents in both places needs a control in both.

What an examiner needs from both

OCC Bulletin 2026-54 gives national bank examiners a framework for AI that covers generative and agentic systems. It sets no supervisory expectations for banks. Three points in it bear on this choice.

  • Coding tools appear in two tiers. Code assistance is a Tier 4 example. Code assistance for changes to internal code or data access is a Tier 2 example. The difference is what the code touches, and the endpoint is where the agent touches it.
  • Agent credentials. The framework says agent identities, credentials, logs and data use may be governed like those of privileged users. In this guide's reading, that applies to an agent on a server and to one on a laptop.
  • Reconstruction. Records may allow a bank to reconstruct a material action: inputs, outputs, context, retrieved sources, tool calls, approvals, overrides and actions. A record from the gateway and a record from the laptop that cannot be joined to the same person are two partial accounts.

The OCC Bulletin 2026-54 guide lists all 16 components.

Five questions to put to any vendor

  • Which of our agents would your product see on day one, and which would it not?
  • When an agent runs a shell command, where does your product inspect it?
  • When an action needs a person, who is asked, and can it be someone other than the person running the agent?
  • If the control is missing or does not answer, does the action run?
  • Do the gateway's records and the endpoint's records name the same person?

How APERION governs the hybrid AI estate

Owned intelligence, governed from the first call. APERION future-proofs the hybrid AI estate: every agent and every model an enterprise rents or owns, governed from one control point inside its own walls. Enterprises will rent some intelligence and own more of it.

APERION runs on both sides. Smartflow sits on the call path and enforces policy on every model call and MCP tool call routed through it. An action that needs a person pauses until someone with approval rights decides. APERION Shield runs in the native hooks of Claude Code, Cursor and Codex and checks what a coding agent is about to do before it runs. On a managed laptop, the hooks are locked at the machine level. If the Shield binary is missing or does not answer on a tool call, the action is denied.

The limits are the ones in the table. Cursor sends most of its model traffic to Cursor's own service, and that traffic does not pass through the Smartflow gateway. From Cursor, the log carries Shield's decisions and tool events. A question from Shield goes to the developer at the keyboard. Approval by a second person applies to tool calls that pass through the gateway.

A verified person, the authority that person delegated, the agent that used it, the policy that applied, the decision and the record of all of it. That chain is the product.

Claude Code is a product of Anthropic. Cursor is a product of Anysphere. Codex is a product of OpenAI. APERION is an independent company.

Frequently asked questions

Is an AI gateway enough to govern coding agents?

No. A gateway sees model calls and tool calls that are routed through it. A coding agent's shell commands, file reads and file edits run as local tools on the laptop. At most, a gateway carrying the agent's model traffic sees the model's request for them. Governing them takes a control in the agent's own hooks, on the machine.

Is an endpoint hook enough to govern AI agents?

No. A hook covers a coding agent on a machine where the hook is installed. It does not cover server-side agents, hosted agent platforms or any agent with no laptop under it. A hook's native question goes to the developer running the agent. Routing an action to a second person for approval takes a path outside the hook.

What is the difference between an MCP gateway and an agent hook?

An MCP gateway sits between agents and MCP servers and applies policy to each tool call that passes through it. An agent hook runs inside a coding agent on the laptop and inspects the agent's actions, MCP calls included, before they run. The gateway covers many agents on one path. The hook covers one agent's actions, where the agent exposes the event.

Where should human approval for an AI agent's action sit?

It depends on who approves. If the developer running the agent can decide, a hook on the endpoint can ask them. If the action needs someone else, such as a payment approver or a system owner, the call has to wait somewhere a second person can reach it. On the call path, a call can pause until that person decides.

What does OCC Bulletin 2026-54 say about coding assistants?

The framework attached to OCC Bulletin 2026-54 lists code assistance as a Tier 4, low-risk example, and code assistance for changes to internal code or data access as a Tier 2, high-risk example. The tiers are illustrative examples for examiners. The bulletin sets no supervisory expectations for banks.

Sources

Related reading

Craig Alberino
Craig Alberino
Craig Alberino is the Co-Founder and CEO of APERION, which builds the runtime governance layer for AI agents in regulated enterprises. Inline policy enforcement and identity-bound audit, deployable on premises.

Put this in the path of your own agents.

Policy enforced inline between your agents and every model and tool they reach, with a record bound to the human who owns it.

Request a Demo Read the docs