Agentic AI Security
AI Gateways: A Runtime Policy Layer for Model and Tool Traffic
Agents call models and tools directly unless something sits in the path. What an AI gateway should enforce at runtime, which OWASP guidance each function answers, and the limits of what a gateway can see.
An agent in production talks to two kinds of systems: models that produce its next step, and tools that carry that step out. In most first deployments, both connections run directly from the agent’s code, each with its own credential, rate limit and logging, or none. That can work for one agent, but it does not give a security team, a platform team or a budget owner a single place to see or change what dozens of agents are allowed to do.
The OWASP Top 10 for Agentic Applications, published in December 2025, calls, in its guidance on tool misuse, for “Policy Enforcement Middleware” (an “Intent Gate”) that treats “LLM or planner outputs as untrusted,” with a “pre-execution Policy Enforcement Point” that “validates intent and arguments, enforces schemas and rate limits, issues short-lived credentials, and revokes or audits on drift.” An AI gateway is the architectural form of that idea: a shared runtime layer that model and tool traffic passes through, and where the platform team enforces policy.
Seven functions, each answering documented guidance
| Gateway function | OWASP basis | What it depends on elsewhere |
|---|---|---|
| Authenticate the agent and the user it acts for | ASI02: authentication for each tool invocation; ASI03: per-agent identities and task-scoped tokens | An identity provider that issues agent identities |
| Route and restrict models and tools | ASI02: per-tool least-privilege profiles (tools); model restrictions are the author’s addition | A catalog of approved models and tools with owners |
| Validate tool calls against schemas and policy | ASI02: Policy Enforcement Middleware (“Intent Gate”) | Machine-readable policy per tool |
| Enforce budgets and rate limits | ASI02: “Adaptive Tool Budgeting” | Budgets set by owners of each service or team |
| Restrict outbound destinations | ASI02: egress allowlists | An allowlist with owners and review dates |
| Contain failures | ASI08: “blast-radius guardrails such as quotas, progress caps, circuit breakers” between planner and executor | Thresholds and a named on-call owner |
| Record every call | ASI02: the policy point “revokes or audits on drift” | An audit store the organization controls |
Source: OWASP Top 10 for Agentic Applications for 2026 (December 2025), entries ASI02, ASI03 and ASI08. The gateway mapping and dependencies are the author's.
Two of these functions deserve more detail because they are the ones a gateway does better than any individual agent.
Budgets. OWASP’s “Adaptive Tool Budgeting” applies “usage ceilings (cost, rate, or token budgets) with automatic revocation or throttling when exceeded.” An agent that loops on a failing task will keep calling tools and models until something stops it. A budget enforced at the gateway also holds when the agent’s own code has a bug.
Containment. ASI08 describes faults that propagate “across autonomous agents, compounding into system-wide harm.” A circuit breaker at the gateway can cut off a tool that is returning errors, or an agent whose call rate has spiked, before the fault spreads to the agents that depend on it.
Source: Author's diagram, based on the OWASP agentic guidance cited above.
What a gateway cannot see
A gateway enforces policy on the traffic that passes through it, and three things fall outside what it can enforce.
Local tools. Tools that run as local processes on a developer’s machine, such as MCP servers using the STDIO transport, never cross the network. A gateway that governs remote tools leaves them ungoverned, and they need their own controls: an inventory and managed configuration on the endpoint.
Direct calls. Any agent that holds a provider API key or a tool credential of its own can bypass the gateway. The gateway is only a control when credentials for models and tools live behind it, so that the only path to a model runs through it.
Meaning. A gateway can check that a tool call matches a schema, targets an allowed resource and stays within budget. It cannot reliably tell whether a well-formed request follows the user’s intent or an instruction injected three steps earlier. Content filters at the gateway add a layer of detection, but the deterministic checks, on identity, scope, schema, destination and budget, are the ones to rely on.
Decisions to make before deploying one
Fail closed or open. If the gateway’s policy store is unreachable, agents either stop or run without policy. For security policy, I would fail closed. For cost controls alone, some organizations will accept failing open for a short period, provided the provider’s own billing still records the spend.
Build, buy or use the platform’s. Cloud platforms now offer managed options; Amazon Bedrock AgentCore Gateway, for example, became generally available in October 2025 and is described by AWS as acting “as a single, secure endpoint for agents to discover and use tools”. Whichever option is chosen, the evaluation questions are the same: can it enforce per-agent and per-user identity, per-tool policy, budgets and egress rules, and can its audit records feed the organization’s own trail?
Who owns the policy. A gateway gives scattered decisions one place to be made. That only helps if the policy has owners: the security team for egress and identity rules, platform engineering for routing and resilience, and service owners for the budgets their teams spend.