Skip to content

What is an AI agent action gateway?

Alex Vakhitov, founder of Comonad Limited

Written by Alex Vakhitov, founder of Comonad Limited. Published

On this page

What it is, and how it relates to the harness, an API gateway and an MCP gateway

Every agent system has a step where the model's output turns into something that happens: a record is updated, a message is sent, a payment is queued. An action gateway is the control at that step. It receives what the agent proposes, decides whether it may run, and only then lets it through to the system.

It is not the same as the harness. The Australian Signals Directorate's guidance on agentic AI harnesses (opens in new tab) describes the harness as the software layer connecting a language model to data, tools and systems, and lists the controls inside it: permissions, sandboxes, approval gates, hooks and policies. The gateway is the enforcement point within or beside that layer. Our guide to what an AI agent harness is covers the whole runtime.

It is also different from an API gateway, although an API gateway can be one of its parts. An API gateway sees a request and knows who the calling application is. It does not know that an agent is acting for a particular person, that this particular action is outside what was delegated, or that the order the agent wants to refund has already been refunded. The gateway for an agent has to check those things as well. A gateway that fronts tool servers using the Model Context Protocol is one way to build it. The protocol does not matter; the checks do.

Two neighbouring guides split the ground. Delegated authority for AI agents is about what authority an agent has been given and who approves. This guide is about where that authority is enforced. When the systems being acted on were built for people, integrating AI agents with legacy systems describes how that enforcement point is introduced: read-only first, then shadow, then one approved action at a time.

Why the rules cannot live in the prompt

A language model takes instructions and data through the same channel. The UK National Cyber Security Centre says that current models do not enforce a security boundary between instructions and data inside a prompt, and that prompt injection may never be fully mitigated in the way SQL injection can be. In its blog on the subject (opens in new tab), it recommends treating such systems as inherently confusable and focusing design protections on deterministic, non-LLM safeguards that constrain what the system can do, rather than only trying to keep malicious content away from the model.

NIST's design tenets for agent identity (opens in new tab) say the same in architectural terms. Tenet 07 reads: "The logic that determines what an agent attempts to do is architecturally separated from the systems that determine what it is allowed to do." Tenet 08 adds that deterministic capabilities should be the primary mechanism for access decisions. A probabilistic signal, such as a classifier's score, can be an input, but it is not the decision.

The ASD advises implementing controls through the harness and surrounding infrastructure wherever possible, rather than relying solely on model behaviour or prompt instructions. A rule that exists only as a sentence in a prompt is a request. A rule in the gateway is a fact about what can happen.

Our default is to move any rule that can be checked mechanically out of text and into code: a type, a check, a test or a gateway rule. Prose stays only for judgement that code cannot encode, and it stays until enforcing code exists and has been seen to fail on a real violation.

The checks on every proposed action

The gateway runs the same checks on every action, in code, and the model has no say in the outcome.

What an action gateway checks

Check
Identity and on-behalf-of
The question it answers
Which agent is asking, and for whom is it acting?
A refusal looks like
An agent with no linked principal, or one acting under a person's own login
Check
Scope
The question it answers
Is this tool, with these permissions, within what was delegated for this task?
A refusal looks like
A tool call outside the written list, or a second agent claiming more than its parent holds
Check
Arguments
The question it answers
Are the inputs the right type, range and shape, and do they name things the agent may touch?
A refusal looks like
A refund for a customer outside the task, or a malformed account number
Check
Business state
The question it answers
Is the action allowed given the current state of the record?
A refusal looks like
Refunding an order that has already been refunded
Check
Approval
The question it answers
Does this action meet a condition that needs a person?
A refusal looks like
A payment over its limit, or any action in the never-without-approval group
Check
Limits
The question it answers
Is the agent within its rate, value and spend limits?
A refusal looks like
The tenth change in a minute where the limit is five
Check
Credential
The question it answers
Does the gateway, not the model, obtain the access for this single call?
A refusal looks like
A request with no short-lived credential issued for it

One proposed action, seven checks

  1. Identity and on-behalf-of

  2. Scope

  3. Arguments

  4. Business state

  5. Approval

  6. Limits

  7. Credential

    • Alone, and recorded

      Reversible work within written limits.

    • Waits for approval

      Sent to a named person with enough context to disagree.

    • Refused

      Logged and returned to the agent with a reason.

The record

One record whether the action ran or not, kept where the agent cannot change it.

The gateway runs the same checks on every action, in code, and the model has no say in the outcome. The action then runs, waits for a person or is refused. Whichever happens, the gateway writes one record.

Identity, delegation, least privilege and short-lived access follow NIST's tenets 01 to 04. Business-state checks are the ones agent frameworks most often leave out, because they live in the system being acted on.

Approval routing without consent fatigue

Most actions should pass without a person. If everything waits, approvers click through. NIST's fifth tenet warns about this directly: consent fatigue is where human escalation becomes so frequent that actions are approved habitually, rather than through careful risk consideration.

So set thresholds in the gateway: amount, record type, a customer flagged as vulnerable, anything outside the written scope. Batch low-risk, similar requests where that is safe, so a person decides a pattern once and not a hundred times. Show the reviewer what they need to disagree: the proposed action, the arguments, what will change, the limit that triggered review and what the agent was asked to do. A request that times out is refused, not approved. A model's own confidence score may send an action to a person. It never waves one through without approval. Reversibility is a useful first cut: reversible actions within scope proceed and are reviewed afterwards, while actions that cannot be undone, such as deleting data, sending a message outside the organisation or moving money, wait for a person unless a written, narrow grant covers them.

Refusals: logged, returned and visible

A refused action is still information. Return it to the agent in a structured form, with a reason it can act on, so it can try a permitted route or hand over to a person. Log it. Show the owner the pattern: an agent that keeps trying a refused action is either badly configured or being steered.

The NCSC makes the security point as well. Detecting and responding to failed tool or API calls can reveal the early stages of an attack, because an attacker has to work out what the system will allow.

The record each decision leaves

Whether the action ran or not, the gateway writes one record. NIST's tenet 10 asks for a tamper-evident, append-only body of evidence, kept independently of the agent so that it cannot edit its own history.

  • The agent's identity and the person or function it acted for.
  • The task or instruction that led to the proposal.
  • The proposed action and its arguments.
  • The policy decision, and which version of the rules made it.
  • Who approved, if anyone, and what they were shown.
  • The result returned by the system.

Build, buy or configure: what to ask of any gateway

You may already own most of it: an API gateway, an identity provider, a workflow tool and a logging pipeline. You may add a purpose-built component. Whichever route you take, these questions are worth asking.

  • Does it decide without the model's help, and does it fail closed when it cannot decide?
  • Can the agent reach the system any other way, and if it can, what stops it?
  • Where do the credentials live, and does the model ever see them?
  • Are the rules written as code or configuration with an owner, a version, tests and a review date?
  • Does it check the state of the record, or only who is calling?
  • Are its logs kept where the agent cannot change them?
  • What happens to an action when the gateway is down or the approver is away?

Comonad does not sell a gateway. We design and build this layer in your environment, from the controls you already run, and it stays with you.

A worked example

This example is synthetic. It does not describe a client. A customer-service agent can propose refunds. Its owner in finance has set a per-refund limit for the agent.

The agent proposes a refund within its limit. The gateway checks that the agent is registered and linked to the task, that refunds are in its scope, that the order and customer match the task, that the order has not already been refunded, and that the amount is within the limit. It obtains a short-lived credential for this one call, passes the request on and records the decision and the result. No person is involved.

The agent then proposes a refund above its limit. The scope and state checks pass, but the approval check does not. The gateway holds the action, sends the approver the order, the amount, the reason and the limit, and tells the agent that the action is pending. If the approver declines, or does not respond, the action is refused and the refusal is recorded. At no point could the agent have approved its own proposal, because the approval decision is not made in the model.

How this appears in our approach

On our approach page, the action gateway is the step between the agent and your systems, where identity, least privilege, approval and validation are enforced. It sits in every AI agent integration we build, using the identity provider, API gateway and workflow tools you already run where they fit. The rules it enforces should be tested independently of the agent, on the same principle as verifying AI-written code. For the wider picture, see what enterprise agent engineering is and how to govern AI agents in production.

How Comonad helps

If you want an action gateway designed and built into the systems an agent will act on, using the identity, workflow and logging tools you already run, that is part of our enterprise AI agents service. We do not sell a gateway product.

Discuss an enterprise AI agent

Sources

Frequently asked questions

Is an action gateway the same as an API gateway?

No. An API gateway knows which application is calling. An action gateway also has to know which agent is acting, for whom, whether this action is within what was delegated, and whether the record is in a state where it is allowed. An API gateway can be one of its parts.

Do we need one if the agent only reads?

Yes, though the checks are lighter. Reading sensitive data still needs an identity, a scope and a record, and what an agent reads can carry instructions. Approval rarely comes into it until the agent can change something.

Can the model's own guardrails replace it?

No. NIST's tenet 07 says guardrails alone are insufficient, because the model takes instructions and data through one channel. Guardrails reduce risk. The gateway enforces limits that do not depend on the model behaving.

Where does the gateway sit with MCP?

A gateway in front of MCP tool servers is one way to enforce these checks. The protocol carries the call; it does not decide whether the call is allowed. The checks need to cover identity, scope, arguments, state, approval and the record whichever protocol is used.

Who owns the rules?

A named person in the function the agent works for, with security and risk consulted. The rules are code or configuration with a version, tests and a review date. Rules nobody owns go stale.

Discuss an enterprise AI agent

Tell us about the workflow, the systems the agent would act on and who would own its rules.

Discuss an enterprise AI agent