Guides

Designing tool governance for AI agents

Agents act through tools, so tool calls are where governance belongs. This guide shows a rule model that is easy to reason about, how to fail closed, and how to stop SSRF.

The short answer

Govern AI agents at the tool call. Match rules on the bot, the connector, the tool name and its arguments; try them by priority and break ties with deny over ask over allow; make ask force a human approval; fail closed when rules cannot be read; grant connectors bot by bot; and send every outbound request through a guard that allows https to public addresses only, on every redirect.

1. Govern the tool call, not the prompt

Instructions can be talked around. A tool call cannot: it has a name, arguments and a target you can check before it runs. Put the decision there, in code the model does not control.

Rules are checked before every MCP tool call, every bot-to-bot handoff and every access request.

2. Use three effects and one tie-break

Allow, ask and deny cover almost every case. Try rules by priority, and when two rules share a priority, deny beats ask and ask beats allow. That way adding a rule can only make a call safer at its level.

3. Fail closed

When the rule store is slow or broken, an agent should not get more power. Keep the last good rules if a reload fails, and deny if there is nothing to fall back on.

If a rule reload fails, the org keeps its last good rules. With nothing cached, an evaluation error denies the call.

4. Grant connectors bot by bot

Connectors are added once per org, and a bot can use one only after a person grants it. Revoking a grant applies from the next reply.

No match in the rule table should mean the connector grants decide, not that everything is open.

5. Put a person on sensitive steps

A tool call that needs a person pauses the reply. Allow approves this call, Always allow saves a standing allow for that bot and tool, and Deny refuses. The reply picks up again either way. Questions from ask_user ride the same rail.

6. Stop SSRF at the network layer

Any URL a user or a remote server supplies can point inward: a private address, a cloud metadata endpoint, or a public name that resolves to a private address after you checked it.

7. Keep secrets out of the model

Bot secrets are name and value pairs. The value is write-only, encrypted with pgcrypto and never returned. When a bot needs a missing secret, its reply waits until a person provides it or skips.

Try it: the policy simulator

Pick what each matching rule says about one tool call, at equal priority.

Ask: the bot waits for Allow, Always allow or Deny.

Questions

Why deny over ask over allow?

So that a stricter rule always wins at the same priority. Adding a deny or ask rule can never open a call that was closed.

What does fail closed mean for an agent?

If the rules cannot be read, the tool call is denied rather than allowed.

How do you stop SSRF from AI agents?

Allow https only, require every resolved address to be public, check each redirect hop, and connect to the exact address you checked so a DNS answer cannot change in between.

Keep reading

Try Bello Bot with your team

Public beta. Bring your own model keys, invite your team, and approve what your bots do.