VaikoraVaikora

Vaikora › Blog › Product Updates

LLM policy enforcement: four decisions every gateway has to make before an action reaches execution

Product Updates · Nov 30, 2026 · 4 min read

Before an LLM agent sends a request to a model or calls an external tool, four things must be decided: is this action allowed, is the content safe to pass, does the caller have the right scope, and does the payload need to be modified before it moves. If any of those decisions happen after execution, they are not enforcement. They are logging.

This article walks through each decision point, what can go wrong when it is missing, and how a deterministic policy engine handles it inline.

Why "after the fact" does not count as enforcement

Detection after execution has real value for investigation. It has no value for stopping an action. An agent that exfiltrates a database row, sends an unauthorized API request, or passes PII to a third-party model endpoint has already done the thing before any post-hoc alert fires.

The only enforcement that actually blocks an action is enforcement that sits inline between the agent and whatever it is about to call. The gateway intercepts the request, evaluates it against policy, and returns allow, block, modify, or require-approval before the downstream call is made. That is the execution model Vaikora uses: every agent action hits the policy engine before it reaches the LLM or tool.

Decision 1: scope and identity

The first check is whether the calling agent is permitted to take this category of action at all. This is not the same as IAM. IAM controls what a credential can do at the API level. A runtime policy engine controls what a specific agent, in a specific role, with a specific task context, is allowed to request.

A concrete example: a customer service agent may hold a valid API key for your CRM. IAM says the key is authorized. Runtime policy says this agent is not permitted to call the record-delete endpoint under any prompt. The key passes. The action is blocked.

Without this layer, IAM and RBAC control the blast radius only at the credential level. Any agent that shares a credential can reach everything that credential can reach.

Decision 2: content inspection

Once scope clears, the content of the request is inspected. This covers outbound prompt payloads (what the agent is sending to the model), tool call arguments (what parameters are being passed to an MCP tool), and response content (what the model sends back before the agent acts on it).

Content inspection checks for:

The inspection result feeds directly into the allow/block/modify decision. If a payload contains a Social Security Number and policy says no PII crosses this boundary, the gateway either strips the field (modify) or blocks the call entirely, depending on the rule.

Decision 3: modify or require approval

Not every policy violation is a hard block. Some actions need a human in the loop before they proceed. A gateway that only supports allow and block forces you to choose between stopping everything that looks risky and passing everything that is not clearly prohibited.

The require-approval path holds the action in queue and routes it to a reviewer. The agent waits. When the reviewer acts, the gateway either releases or drops the request. This is the right model for high-value, low-frequency actions where the cost of a false positive block is high but automated allow is not acceptable.

The modify path is simpler: the gateway rewrites the payload before it moves. Strip the PII field, redact the credential, replace the disallowed parameter value, then forward. The agent never sees the difference. The audit log records both the original and the modified form.

Decision 4: tamper-evident record

Every decision, including allows, needs to produce a record that can survive a dispute. A log that can be edited after the fact is not useful for incident response or compliance. The record needs to be ordered, attributable, and verifiable.

Vaikora writes every policy decision into a SHA-256 hash-chained audit log. Each entry includes the input, the policy rule that matched, the decision taken, and the timestamp, and is chained to the previous entry so any deletion or modification breaks the chain. That is what makes the log useful in an investigation rather than just a file on disk.

Putting it together

The four decisions are sequential: scope check, content inspection, modify or hold if needed, write the record. At P50 the full chain runs in 8ms. At P99 it runs in 45ms. That latency budget is small enough that it does not change the operational behavior of the agent.

What to check next: for each AI agent in your environment, trace one sample action through these four decision points manually. If any of them currently happens after execution or not at all, that is the gap to close first. The enforcement point is not the last step in a deployment. It is a prerequisite for the deployment being safe to run.

See Vaikora enforce policy on your AI

Open-core AI runtime control. Self-host the MIT gateway free, or run the hosted Control Plane.

Get a demo Self-host the gateway

More from the Vaikora blog