The fail-closed policy engine
How every tool call, handoff and access request is decided before it runs, and why a broken rule store means no.
Bello Bot checks org rules before every MCP tool call, bot-to-bot handoff and access request. Rules are tried by priority, lowest first, with deny before ask before allow on ties, and the first match decides. With no match, grants decide. If rules cannot be loaded and nothing is cached, the call is denied.
How it fits together
Policy evaluation for one tool call, step by step. Every box is a check in the Bello Bot code, not a promise in a prompt.
What a rule can match
- A rule has a name, an effect (allow, ask or deny), a priority, and optional matchers: one bot, one connector, a tool name glob, an argument match and a rooms-only flag.
- In a tool glob or argument glob, * matches any run of characters and everything else is literal.
- An argument match takes a path such as $.repo and a glob. The value at that path must match the glob.
- Connector tools are named after the connector and the tool, joined by two underscores, such as github__create_issue. The connector name is lowercased and anything that is not a letter or digit becomes an underscore.
How the decision is made
- Rules are tried by priority, lowest number first. At equal priority deny beats ask, and ask beats allow. The first matching rule decides.
- A tool call that matches no rule is allowed by policy, but a bot can only use a connector that a person has granted it, so grants are the default gate.
- An ask rule allows the call but forces the approval card, even for a tool that is set to run on its own.
- If a person edits the arguments on an approval card, the edited call is checked against the rules again before it runs.
Failure modes
- Each server keeps an org's rules for 30 seconds. Saving a rule clears that cache at once, and other servers pick up the change within 30 seconds.
- If a rule reload fails, the org keeps using its last good rules instead of dropping them.
- If the rules cannot be loaded and no last good copy is cached, the call is denied with the reason policy evaluation failed.
- Rules belong to an organization. A personal workspace with no org has no rules to apply.
Changing rules safely
- Only org owners and admins can create, change or delete rules.
- Admins can test a tool call against the current rules, and replay a draft rule over the org's last 200 tool calls to see what it would block, unblock or send for approval before saving it.
Related reading
- Try the policy rule simulator
- Fail-closed policy engine, defined
- Deny, ask, allow starter policy
- Security controls, from the code
- Copyable policy templates
- AI agent governance glossary
- Free governance tools
From the blog
Questions
Why deny when the rules cannot be read?
An outage should block risky calls, not wave them through. A failed reload keeps the last good rules, and only with nothing cached does every call deny.
Does a rule apply to handoffs between bots?
Yes. Rules run before every MCP tool call, every bot-to-bot handoff and every access request.
How fast does a rule change take effect?
At once on the server that saved it, and within 30 seconds everywhere else.
Keep reading
Policy rule simulator
Write rules, describe one tool call, and see which rule decides and why.
Fail-closed policy engine
A fail-closed policy engine denies an AI agent action whenever it cannot evaluate its rules.
Designing tool governance for AI agents
A practical guide to governing AI agent tool calls: rule matching, deny over ask over allow, failing closed, per-bot grants and network guards against SSRF.

Deny-ask-allow starter policy
A copyable starter policy for AI agent tool calls: deny destructive tools, ask before writes and allow reads, built for the Bello Bot policy engine.
More architecture deep dives
SSRF and the network guard · The local device engine bridge · The outcome-only email gateway
Try Bello Bot with your team
Public beta. Bring your own model keys, invite your team, and approve what your bots do.