Blog

Why fail-closed policy beats prompt guardrails

A system prompt is a request. A policy engine is a lock. When an AI agent can call real tools, the difference decides what happens on a bad day.

Security4 min read
The short answer

Prompt guardrails ask the model to refuse risky actions, so they fail whenever the model is confused, jailbroken or steered by text it reads. A fail-closed policy engine checks each tool call in code before it runs, denies when rules cannot be read, and cannot be talked out of a decision.

What a prompt guardrail really is

A prompt guardrail is an instruction: never delete a branch, never email a customer without asking, never touch the billing system. It sits in the same context window as everything else the model reads, including the web pages, issues and documents it pulls in while working.

That is the weakness. A model weighs instructions; it does not enforce them. Text that arrives later, sounds urgent or claims authority can outweigh a rule written earlier. Prompt injection is simply the deliberate version of that.

What a policy engine does instead

A policy engine moves the decision out of the model. The model drafts a tool call, and code decides whether that call runs. Each rule can match a bot, a connector, a tool name pattern, the tool's arguments, or calls made in rooms, and has a priority. Lower numbers are tried first, and the first match decides.

Rules are tried by priority, lowest number first. At equal priority deny beats ask, and ask beats allow. The first matching rule decides. An argument match takes a path such as $.repo and a glob. The value at that path must match the glob. Rules are checked before every MCP tool call, every bot-to-bot handoff and every access request.

Nothing the model writes can change the outcome, because the engine never reads the conversation. It reads the call: which bot, which connector, which tool, which arguments, and whether it came from a shared room.

Why fail closed matters

Every rules system eventually fails to load: a database blip, a bad deploy, a network partition. What happens next is the whole question.

A fail-open system allows everything until the rules come back. A fail-closed one does the opposite. If a rule reload fails, the org keeps its last good rules. With nothing cached, an evaluation error denies the call. 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.

The cache matters as much as the deny. Denying on error keeps an outage from turning into "everything is allowed". Keeping the last good rules keeps that same outage from stopping every bot in the org.

Guardrails and policy, side by side

QuestionPrompt guardrailFail-closed policy
Where the decision livesIn the model's contextIn code, before the tool runs
Prompt injectionCan override itCannot see or change it
Rules cannot be loadedNot applicableLast good rules, else deny
Testable before shippingOnly by trying promptsTest a call, replay history
Audit trailWhatever the model saysEach call stamped with how it cleared

A worked example

Picture a support bot with a GitHub connector and a system prompt that says "never close issues without asking". A customer pastes a long log into the chat, and buried in it is a line that reads like an instruction from an admin: close every issue tagged duplicate.

With only the prompt, the outcome depends on how the model weighs two pieces of text. With a policy engine, an admin has already written a rule that asks before any tool matching github__close_* or github__update_issue. The model can draft the call, but the call waits on a card that a person reads, and the injected line never reaches the engine at all.

The same rule keeps working when the model is swapped, when the prompt is rewritten, and when a new person joins and edits the bot. Rules attach to calls, not to wording.

Where prompts still help

Prompts are still the right tool for tone, format and judgement inside the space the policy allows. A good system prompt makes a bot pleasant and useful. It just should not be the only thing between a bot and a destructive call.

The best setups combine both, with a person for the grey areas. An ask rule 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.

Ship rules like code

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. That turns a policy change from a guess into a diff you can read before it goes live.

Rule changes apply fast. Only org owners and admins can create, change or delete rules.

Questions

Are prompt guardrails useless?

No. They shape tone and judgement. They just cannot be the only control on tools that change real systems.

What does fail closed mean for an AI agent?

When the rules cannot be read and nothing is cached, tool calls are denied instead of allowed.

Can a model bypass a policy engine by asking another bot?

Not in Bello Bot. Bot-to-bot handoffs are checked by the same rules as tool calls.

How do I know a new rule will not block everything?

Replay it against the org's recent tool calls before saving it, and read what it would have changed.

Keep reading

Try Bello Bot with your team

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