Guide
June 22, 2026
Updated August 31, 2026
9 min read
Nicolas Fares

What is an AI agent security gateway, and what must it do?

What an AI agent security gateway is, the threat model behind it, the controls it must enforce at the MCP and execution layer, and how to evaluate one.

#AI agent security gateway#MCP security#agentic AI governance#agent runtime protection#MCP gateway#AutoJack

TL;DR. An AI agent security gateway is an enforcement point between an AI agent and everything the agent can touch: tools, MCP servers, APIs, databases, file systems, other agents. It authenticates every connection, applies policy before an action executes, and records what happened under the agent's own identity. The category exists because agent attacks land at the execution layer, below the model: AutoJack (June 2026) turned a single web page into host-level RCE through an unauthenticated MCP WebSocket, and Gravitee's 2026 survey found 88% of organizations reporting confirmed or suspected agent incidents. Guardrails on model output enforce none of this.

By mid 2026, 88% of organizations reported confirmed or suspected AI agent security incidents in the previous year, rising to 92.7% in healthcare, and more than half of enterprise agents ran with no security oversight or logging at all (Gravitee, State of AI Agent Security 2026). The infrastructure answer the market converged on is the AI agent security gateway. This page defines the category: what a gateway is, the threat model that produced it, the controls a real one must enforce, how the vendor landscape organizes, and how to evaluate one.

What an AI agent security gateway is

An AI agent security gateway sits between an agent and everything the agent can reach: APIs, databases, file systems, MCP servers, other agents. It enforces policy before an action executes, not after text is generated. Concretely, it authenticates every connection an agent opens, decides whether a specific tool call is allowed for this agent acting for this user, and writes an audit record of what was requested, what was decided, and what ran. It brings agents under the same audit, revocation, and least-privilege model that network security teams have applied to human users for decades, with the agent as the policy subject.

That framing separates the category from two things it gets confused with. An API gateway governs inbound traffic to your services; the policy subject is the caller. An agent security gateway governs outbound actions by semi-autonomous software; the policy subject is the agent and the identity chain behind it. And guardrails (output filters, content classifiers, prompt injection detectors) operate on model input and output. They do nothing when an agent calls an API it should not reach, or when a local MCP endpoint accepts unauthenticated connections from a web-browsing agent.

Prompt guardrailsAgent security gateway
Operates onModel input and output (text)Tool calls, MCP traffic, executed actions
Enforcement pointAfter generationBefore execution
SeesWhat the model saidWhat the agent did
StopsPolicy-violating textUnauthorized connections, tools, and commands
Audit unitPrompt and completionAgent identity, action, decision, result

The threat model a gateway answers

Security teams spent 2024 and 2025 hardening the model layer: prompt injection detection, content policies, output filters. Those controls matter, and the 2026 attack record shows exploitation arriving somewhere else: at the execution layer, meaning the tools, shell access, file systems, and MCP endpoints an agent can reach. Four observations define the threat model.

Localhost is not a trust boundary. Any agent that can browse the open web and talk to local services can be weaponized by any page it visits, because the page renders inside the agent's trusted context. AutoJack, below, is the public proof.

Structured channels carry implicit trust they have not earned. Data arriving through an authenticated MCP server reads to the agent as system output rather than untrusted input. The agentjacking disclosure (Tenet Threat Labs, June 2026) hijacked coding agents in 85% of controlled attempts by poisoning Sentry error events read over MCP; the full attack path, and the 2,388 organizations found exposed, are covered in our agentjacking analysis.

Agent identity is the prerequisite for everything else. Only 21.9% of enterprise teams treat AI agents as independent, identity-bearing entities. Without dedicated agent identities (scoped credentials, separate audit trails, individual revocation), least-privilege enforcement and incident response are not achievable in practice.

Spend is a security signal. Agent costs are not bounded by human friction. A runaway loop or adversarial over-consumption manifests first as an anomalous spend pattern, which makes cost visibility an incident indicator, not just a budget concern.

The gap is widening on both sides: the enterprise agent fleet roughly doubled between December 2025 and April 2026 while monitoring and accountability structures barely moved (Gravitee), and Gartner's 2026 Hype Cycle for Agentic AI now lists governance, security, and cost control as defining signals alongside core agentic capabilities.

AutoJack: the mechanics matter beyond AutoGen

The clearest single illustration of the execution-layer threat model is AutoJack, disclosed by Microsoft's Defender Security Research team on June 18, 2026: a three-flaw chain in AutoGen Studio, Microsoft's own open-source multi-agent framework, that let one malicious web page deliver remote code execution on the host running the agent. Zero credentials, no user interaction.

The chain, weakness by weakness:

  1. Origin allowlist bypass (CWE-1385). The MCP WebSocket accepted connections only from http://127.0.0.1 or http://localhost. But a web-browsing agent renders remote pages inside that trusted origin context, so the check passed for any page the agent fetched.
  2. Unauthenticated MCP endpoint (CWE-306). Authentication middleware explicitly skipped /api/mcp/* paths on the assumption that the WebSocket handler enforced its own checks. It never did, so the endpoint accepted unauthenticated connections regardless of the auth mode configured elsewhere in the app.
  3. Shell parameter injection (CWE-78). The endpoint accepted a server_params query parameter, base64-decoded it, and passed command + args directly to stdio_client() with no executable allowlist. Supplying bash -c '...' as the "MCP server" achieves host-level RCE.

The fix landed upstream in AutoGen Studio PR #7362 (commit b047730), which removes URL-based parameter reading entirely. The vulnerable surface never shipped in a stable PyPI release; exposure covered teams running from-source builds or the pre-release 0.4.3.dev1 and 0.4.3.dev2 packages alongside a web-browsing agent before the fix.

Treating this as a patch advisory misses the structural point. Every link in the chain is a generic pattern: an origin check that assumes browsers only render trusted content, a local endpoint that assumes only local processes will reach it, a command path with no allowlist. Any framework that couples browser access with privileged local services faces some version of this, which is why the CWE chain, not the product name, is the lasting content of the disclosure. Localhost stops being a trust boundary the moment your agent browses the open web.

What a gateway must enforce

Vendors disagree on packaging; the control set is converging. A gateway missing any of these six is a partial one, whatever the label says.

Agent discovery and inventory. A real-time map of running agents, the tools and MCP servers they can reach, and the identities they run under. Most organizations have no such inventory: only 24.4% report full visibility into which agents are communicating with each other (Gravitee).

MCP endpoint authentication and origin validation. Every MCP connection requires credentials, with no path exceptions and no trust-by-default for localhost, and connections are validated as originating from the expected agent context rather than from arbitrary web content a browsing tool rendered. This is the control that removes the AutoJack pattern.

Tool and MCP access policy. Tool calls are allowed or denied before they execute, based on agent identity, user context, request content, and org policy: the enforcement point that keeps an agent off a database it should not touch or away from an unvetted MCP server. Shell and stdio invocation paths gate on an explicit executable allowlist, and unknown commands fail closed.

Runtime content inspection. Static allowlists do not catch a permitted tool driven by a poisoned input. The gateway must inspect tool-call content in flight, the WAF equivalent for MCP traffic: never trusting what flows through a structured channel just because the channel is authenticated. This is the control aimed at trusted-path injection.

Audit trails. Every tool call, MCP interaction, and agent action logged with agent identity, the human identity it acts for, and full request context. This is the foundation for incident response, forensics, and compliance.

Spend control. Gateway-level caps and routing bound runaway loops and adversarial over-consumption, as a budget and availability control alongside security.

The vendor landscape in five layers

The market has structured itself into five distinct layers (identity security, runtime security, AI gateways, MCP gateways, and red teaming), with no single vendor covering the full stack, so enterprises layer deliberately. Three entries show the range as of mid 2026.

WitnessAI shipped Agentic Control GA on June 17, 2026: network-layer enforcement with no agent-side code changes, auto-discovery of agents across IDEs, chat apps, and custom frameworks, and a single org-wide approved-tool policy applied at runtime. Total funding at GA: $85 million.

Databricks announced Unity AI Gateway at Data + AI Summit 2026: Lakehouse-native governance where contextual policies allow, deny, or require human approval for specific agent actions based on user identity, agent identity, model, MCP service, or request content, with managed MCP services for Google Drive, Jira, Confluence, Slack, GitHub, and SharePoint out of the box. A Tier-1 data platform entering the category was the clearest signal that the gateway had moved from early-adopter pilot to standard infrastructure.

The security platforms absorbed the category too: Palo Alto Networks folded its May 2026 Portkey acquisition into its AI security portfolio, and Cisco AI Defense added execution-layer runtime protections in early 2026. Teams on those platforms get gateway capabilities inside an existing SASE or firewall stack.

How to evaluate one

Start with discovery. You cannot secure what you cannot see, and building the inventory of running agents, their tool access, and the identities they run under is the prerequisite for every other control. Then fit the architecture to your estate. If your agents span heterogeneous environments (IDE plugins, third-party frameworks, CI pipelines, developer machines), a network-layer approach that can govern agents you did not build is the right frame. If you are on a Lakehouse, native governance integrates with the catalog's identity and lineage model, and you still need an explicit plan for agents running outside that perimeter.

Then run the concrete test: take a documented attack and ask whether the gateway stops it. Would it have blocked AutoJack? That requires MCP endpoint authentication and command allow-listing. Would it catch agentjacking? That requires inspecting MCP response content before the agent acts on it. A product that only rate-limits LLM API calls, monitors token spend, or enforces system-prompt policy fails both tests, whatever its category label says.

One caution as you evaluate: a gateway governs the channel, and the channel is only half the problem. A gateway does not know what a table means, which columns are sensitive by business definition, or which schema change is safe to approve. Policy needs context to bind to, or every decision escalates to a human who has to reconstruct that context by hand.

Datapace is building the context layer between your databases and your AI: resolved meaning validated by the people who own the data, the workload evidence beside it (cost, performance, usage and freshness, lineage), and a policy gate over what an agent may do and access, served over MCP. If you are giving agents access to production data, start with the security use case or book a call and we will walk through it on your stack.

Sources

  1. Microsoft Security Blog, "AutoJack: single page RCE on the host running an AI agent", June 18, 2026.
  2. The Hacker News, "AutoJack attack lets one web page hijack AI agent hosts", June 2026.
  3. WitnessAI, "WitnessAI introduces Agentic Control to secure and govern AI agents and MCP servers", June 17, 2026.
  4. Databricks, "AI governance at Data + AI Summit 2026: what's new with Unity AI Gateway", June 2026.
  5. Gravitee, "State of AI Agent Security 2026: when adoption outpaces control", 2026.
  6. Gartner, "Hype Cycle for Agentic AI", 2026.
  7. TrueFoundry, "Enterprise AI agent security solutions", 2026.
  8. Palo Alto Networks, "Securing and governing AI agents at scale through a unified AI gateway", April 2026.

Frequently asked questions

What is an AI agent security gateway?
An enforcement layer between an AI agent and everything it can touch: tools, MCP servers, APIs, databases, file systems. It authenticates connections, applies allow or deny policy before an action executes, and logs every action under the agent's own identity.
Do I need a security gateway for MCP?
If agents in your organization connect to MCP servers, yes. Documented 2026 attacks (AutoJack's unauthenticated MCP WebSocket, agentjacking's poisoned Sentry events) both traveled through MCP. A gateway imposes the authentication, allow-listing, and content inspection individual servers do not.
How is an agent security gateway different from an API gateway?
An API gateway governs inbound requests to your services; the policy subject is the caller. An agent security gateway governs outbound actions by autonomous agents: which tools and MCP servers an agent may reach, and whether a specific action is allowed, under the agent's own identity.
What should an agent security gateway log?
Every tool call and MCP interaction, with the agent identity, the human identity it acts for, full request and response content, and the policy decision. Conversation-level logs are what let you reconstruct an incident like a poisoned MCP response after the fact.
Are prompt injection filters enough to secure AI agents?
No. Filters and guardrails operate on model input and output. They do not stop an agent from calling an unauthenticated local MCP endpoint or running a permitted tool with poisoned arguments. The 2026 attack record shows exploitation landing at the execution layer, below the model.

Related use case

Keep reading

Ready to let agents touch production, safely?

Bring a use case. We will show you what agents can do on your live data, inside your guardrails.