VaikoraVaikora

Vaikora › Blog › Product Updates

What a policy engine actually checks when an LLM agent calls a tool: the five decision points

Product Updates · Dec 1, 2026 · 4 min read

When an LLM agent calls a tool, four things can happen: the call is allowed, blocked, modified before it reaches the target, or held for human approval. Which outcome fires depends entirely on what the policy engine checks at the moment of the call. If nothing sits inline between the agent and the tool, the call executes unconditionally.

This article walks through the five decision points a policy engine needs to evaluate, in order, and explains what can go wrong if any of them is skipped.

Decision point 1: identity and context

Before evaluating the action, the enforcement layer needs to know who is acting. That means the authenticated agent identity, the session context (which workflow triggered this call, what permissions that workflow was granted), and whether the caller matches a known policy subject.

Without this, every subsequent check is applied to an anonymous request. You cannot write a meaningful rule against an identity you have not verified.

Decision point 2: action classification

The raw call needs to be classified against a taxonomy the policy engine understands. "Write to database" is not the same as "read from database", and "send external HTTP request" is not the same as "query internal API".

A concrete example: an agent is asked to summarize a customer record. The LLM decides the most efficient path is to run a SQL query and then write a cleaned version back to the same table. The intent was read-only. The action is a write. If the policy engine does not classify the action before execution, the write happens before anyone can intervene.

Decision point 3: content inspection

After classifying the action type, the engine inspects the payload. This is where data-loss risk actually lives. A tool call that is structurally permitted (read from CRM) can still carry a prompt-injected instruction in the response that the agent will execute next.

Content inspection at this point means checking for PII patterns, credential fragments, injection payloads, and anything else the policy forbids in transit. The inspection needs to happen on both the inbound prompt and the outbound tool response, not just one side.

Decision point 4: policy match and decision

With identity, action classification, and content inspection complete, the engine evaluates the request against the active policy set and returns one of four verdicts: allow, block, modify, or require-approval.

Deterministic evaluation matters here. Identical input should always produce identical output. If the same request produces different verdicts across calls, the policy is not enforced, it is approximated. Vaikora runs this evaluation inline at P50 8ms and P99 45ms, which keeps enforcement off the critical path for most agentic workflows running at normal throughput.

The modify verdict is worth spelling out because it is frequently overlooked. The engine can rewrite the payload before forwarding it. A call that contains a PII field the policy says must be redacted can have that field stripped and then forwarded, rather than being blocked entirely. That is a more precise control than block-or-pass.

Decision point 5: audit record

Every decision, including allows, needs to be written to an immutable record before the call completes. The record needs to contain enough information to reconstruct the decision: the original payload, the classification result, the content inspection findings, the matched policy, the verdict, and a timestamp.

If the audit record is written after execution, a failed or interrupted call leaves a gap. If the audit record can be modified after the fact, any investigation built on it is unreliable.

Vaikora writes each decision into a SHA-256 hash-chained audit log. Each entry is signed against the previous one, so any modification to the record is detectable. This matters when an incident requires you to prove what an agent did or did not do at a specific point in time.

What happens when a decision point is missing

If identity is not verified, policy rules cannot be scoped to specific agents or workflows. If action classification is skipped, write operations look identical to reads. If content is not inspected, injection payloads pass through unconditionally. If audit records are written post-execution, failed calls are invisible.

Each missing point is not an abstract risk. It is a specific class of incident that becomes undetectable and unrecoverable.

What to check in your current setup

Look at where your LLM agent calls tools today and ask whether anything sits inline before those calls execute. If the answer is "we have logging after the fact," you have visibility but not control. The two are not interchangeable.

Check whether your audit records include the original payload and the matched policy rule, not just a timestamp and an outcome. If you cannot reconstruct why a call was allowed, you cannot demonstrate that the allow was correct.

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