How do you stop an AI agent's tool call before it runs?

Put the decision outside the AI. Verosek checks what an agent tries to do against the rules you set, lets the allowed actions through, stops the rest and keeps a sealed record of every decision.

Vats Shah5 min read
[ In short ]

A tool call is what happens when an AI agent uses one of your systems: it looks up a customer, charges a card, issues a refund. To stop one before it runs, make the decision outside the AI. Verosek sits between the agent and your systems. Each action comes to Verosek first, your rules decide, an allowed action runs, and a blocked one never reaches the system. Every decision goes into a sealed record.

[ On this page ]

Telling the agent in its instructions cannot promise this. An AI model weighs those instructions against everything else it reads, including a customer's message written to talk it round. A rule outside the model does not read the conversation at all.

[ 01 ]

What do you set, and what does it decide?

You decide in advance what each agent may do. You give each agent a key, and the key carries its rules: which actions it may take, and within what limits.

Take a support agent. Its key may look up a customer, may charge up to $100 and has no rule for refunds. The agent tries three things: look up a customer, charge $240 and issue a refund. Verosek decides each call on its own.

[ What you set ]
The support agent’s key
  • May look up a customer
  • May charge up to $100
  • No rule for refunds
[ What it decides ]Open a call for its details
Look up a customerAllowed
Tool
stripe__get_customer
Arguments
{"customer": "cus_4417"}
What the agent gets back
The tool's result
Charge $240Blocked
Tool
stripe__create_charge
Arguments
{"amount": 24000, "currency": "usd"}
What the agent gets back
{"error": "Access denied: Amount 24000 exceeds maximum allowed 10000 cents"}
Issue a refundBlocked
Tool
stripe__create_refund
Arguments
{"charge": "ch_9021"}
What the agent gets back
{"error": "No access rule for tool 'create_refund' on this key"}
Figure 1. What you set and what it decides. Illustrative values.

The lookup is allowed. The charge is blocked, over this key's $100 limit. The refund is blocked, not on this key: the agent is never offered an action its key has no rule for, and if it asks anyway, the call is refused.

The payment account behind these calls could do all three. Your rules make the answers differ.

[ 02 ]

What happens to a blocked call?

A blocked call stops at Verosek, and your system never receives it, so there is nothing to undo. The agent is told why, in words it can pass on to the person it is helping, or it can try something the key allows.

[ One blocked call ]
AI agent
Verosek
BlockedNever called
AI agent
Verosek
BlockedNever called
[ Against the key’s limit ]
$240the agent tried
This key’s limit: $100
[ The call ]
Charge $240Open for the exact words the agent receivesBlocked
Tool
stripe__create_charge
Arguments
{"amount": 24000, "currency": "usd"}
What the agent is told
{"error": "Access denied: Amount 24000 exceeds maximum allowed 10000 cents"}
Figure 2. One blocked call, end to end: $240 against a $100 limit, and a system that was never called. Illustrative values.

By default nothing waits, and Verosek does not lower the amount to fit. The refusal is recorded, and the agent carries on with what it was told. For the calls you choose, a named person decides, and the call does not run until then.

[ 03 ]

How do you know what happened?

Every decision leaves a record you can check. For each request you can see what the agent tried, what was decided and why, and whether the action ran. Secrets and personal data are scrubbed before the record is stored, and the seal lets you check later that nothing was changed.

The sealed record of these three callsOne call allowed, two blocked. Open for its steps.Sealed
Its steps
Proposedstripe__get_customer
Decisionstripe__get_customerAllowed
Ranstripe__get_customerDone
Proposedstripe__create_charge
Decisionstripe__create_chargeBlocked
Proposedstripe__create_refund
Decisionstripe__create_refundBlocked
Sealed
Figure 3. The sealed record of those three calls. Illustrative values.

You can list last week's blocked calls with a filter, each with its reason. You can ask Verosek to verify a seal, and on a self-hosted deployment an auditor holding the verification key can check a record offline.

[ 04 ]

Can the AI talk its way past a rule?

The AI cannot talk its way past a rule by what it writes. A rule looks at the call itself and what the key allows, so the conversation does not change the answer. OWASP, the security group, lists this risk as Excessive Agency and tells teams to check permissions in the systems an agent reaches "rather than relying on an LLM", the AI model itself, "to decide if an action is allowed or not" (OWASP Top 10 for LLM Applications 2025).

A persuaded agent can still do whatever the key allows, so a key should carry little, as How do you secure AI agents? explains. Reading the text itself is Shield's job, and Shield comes with the gateway: turn it on and it reads what a tool sends back too, and can flag or block what it finds.

[ 05 ]

What does it take to put this in place?

Putting Verosek in place changes two values in your app. It keeps its OpenAI, Anthropic or Gemini SDK, points the base URL at Verosek and uses a Verosek key. You set the rules once, and from then on its tool calls go through them. The same key routes its model calls, with fallback for chat, and carries its budget and rate limits.

[ 06 ]

Does this work for tools my own code runs?

Verosek checks calls to tools your own code runs and hands them back; it never runs those tools itself. Your code receives only the calls that passed. A blocked one comes back as a short notice: [Verosek: tool call 'x' was blocked by policy: this key's tool policy does not allow it]. One thing to set: give the key an allow list.

[ 07 ]

What if Verosek cannot check a call?

A call Verosek cannot check does not go through. By default a blocking rule that cannot run refuses. If the decision cannot be recorded, by default the tool does not run and the request is refused. If a check fails after a tool has already run, the answer says so, so nobody repeats it blindly.

[ 08 ]

Where does this stop?

Verosek decides the call it sees. It does not make every allowed call a good idea.

  • A rule reads the call, not your records. It cannot check that a refund goes to the card that paid, or notice that someone already refunded the order by hand.
  • Rules cover what each type of tool exposes, not every argument of every tool.
  • What a tool does afterwards on its own side, such as a database trigger, is outside the decision. The connection's own permissions cover that.
  • A decision does not tell you whether the AI was talked into asking. Anything inside the key's rules stays possible, so keep keys narrow.

To see this on your own agent's tools, book a call.

[ 09 ]

Frequently asked questions

Does a blocked call wait for someone to approve it?

A refused call stays refused, and the refusal is recorded. For the calls you choose, a named person decides first, and the call does not run until then. To change a rule's outcome, an admin changes the rule, and that change lands in the admin audit log.

What does the agent see when a call is blocked?

A tool result with the reason, such as {"error": "Access denied: Amount 24000 exceeds maximum allowed 10000 cents"} or {"error": "No access rule for tool 'create_refund' on this key"}. For a tool your own code runs, a short notice.

Which requests does this cover?

Chat completions, streaming, POST /v1/messages, Gemini, MCP clients and agent runs.

What happens if Verosek cannot write the record?

By default, the tool does not run and the request is refused.

Can I list the calls that were blocked?

Yes. A trace with a blocked call is marked BLOCKED, so you filter traces by that verdict and a time window, and each one shows its reason.

Keep reading

[ Field guide ]

How do you secure AI agents?

Limit what each agent can do, decide each action outside the AI model, read what it reads and keep a record you can check. Verosek does all four in one place, so security is not a second vendor.

6 Nov 20267 min read
[ Reference ]

AI gateway, LLM router, MCP gateway, AI firewall: what is the difference?

A router picks the model, an AI gateway controls who may use it, a firewall reads the words, and an MCP gateway decides each tool call before it runs. Who needs which, and how Verosek does them on one key.

6 Nov 20266 min read
[ Field guide ]

What is prompt injection, and what actually stops it?

Prompt injection is text that makes a model follow the attacker. No filter catches all of it, so the control that holds sits outside the model: a rule on the tool call. Verosek decides that call before it runs.

6 Nov 20264 min read

Rules for every tool call Verosek runs. Decided before it executes, outside the model.

Still curious? Ask your favourite AI about Verosek.