# AI agent guardrails guess. Permissions decide.

Source: https://qa.definable.ai/blog/ai-agent-guardrails
Published: 2026-11-25 · Definable team

Our answer check blocked 51 of 246 answers, most with "I can't help with that." Why an AI agent guardrail is not a security boundary, and what is.

Between November 12 and 17, our answer check blocked 51 of 246 answers on our development server (used mostly by our team and testers, not production). 39 of them went out as "I can't help with that." When we reran that week's answer checks with the question asked a different way, the same checker flagged only 12. The rules didn't change. Only the question we put to the checker did.

"I'm sorry, Dave, I'm afraid I can't do that" is funny from a spaceship. It's less funny when you get it back for a greeting. We fixed that, and we thought we were done. A week later, one agent's daily job still hadn't written a single row, and the fix couldn't touch it.

The short version: an agent guardrail is a second model reading words and guessing whether they break a rule. That's useful for what words may say. It isn't a security boundary. Security is what the agent can't do even when every model in the loop is fooled. And a person clicking Approve isn't that boundary either.

Every number below that we call ours comes from that server, with its dates.

## What does our guardrail check, and what does it cost?

A guardrail is a rule you give an agent, plus a check that the agent follows it. Ours works in three places. The rules go in last, after everything the run has read, and say they come before all of it.

**Fig 1 · Three checks, then a person**

1. **Rules.** The agent's rules go in as the last system message before every model call.
2. **Words.** A second model asks one yes/no question per rule about the answer, before it is kept.
3. **Actions.** For a write or delete outside the agent's own space, the same checker reads the tool's name and arguments. Never what the agent read.
4. **People.** Then the approval hook decides: run, ask a person, or block. Everything has passed by the time a tool runs.

*The order of checks in one turn on our system. The guardrail runs before the approval, so a person is never asked to allow what a rule forbids.*

The checker is Jev, the decision model we also use to route between a fast and a slow model ([our post on decision models](https://qa.definable.ai/blog/decision-models) has the details). It answers one yes/no question per rule with a number, and 0.5 or more counts as broken. Notice what it never reads: anything the agent read before. A broken answer is withheld and rewritten once, and a second break becomes "I can't help with that."

If the checker fails or takes more than 1 second, the action is blocked and the answer goes out. That's failing closed for actions and open for words.

Here's the case for it. On the development server, from 2026-11-12 to 2026-11-25, we ran 726 checks (223 actions, 503 answers). The median check took 170 ms, and 95% of checks finished within 216 ms. None of the 726 timed out or failed. And it catches what the words show: a test rule, "Never include the literal word ORANGE in any reply.", caught the word 5 times out of 5, and let the 3 replies without it through.

Then we counted what it blocked after the fix: 78 blocks, and 44 of them came from one agent.

## Why did one agent's daily job never write a row?

Because the checker couldn't see where the rows came from. A gym front-desk agent (sample members, not real people) runs a daily job that appends members whose plan ends within 3 days to a sheet. Its first rule says: "Never invent a price, discount, offer, timing, slot, trainer, facility, policy, plan, date or payment. Plan details come only from the members sheet." Its own third rule allows appending new rows to the job's own tab.

The rows come from the members tab the job reads earlier in the same run. We checked the 2026-11-25 run's blocked rows against that tab, and they matched. But the checker sees the rule and the row, not the tab, so you can see its problem. A plan and a date it can't trace to anything looks, from where it sits, exactly like an invented one.

**Fig 2 · Rows it could not trace**

1. **Read.** The job reads the members tab, the one source its first rule allows.
2. **Write.** It copies the rows whose plan ends within 3 days, as its third rule allows.
3. **Check.** The checker gets the rule and the rows. Where they came from isn't in what it reads.
4. **Blocked.** All 29 attempts in 8 days were blocked, 27 of them by the first rule.

*One agent on our development server, 2026-11-18 to 2026-11-25. The path is an example run.*

All 29 of its write attempts across those 8 days were blocked, 27 by the first rule. On 2026-11-25 the agent tried to explain: "the sheet write was blocked by a platform rule on both attempts". That answer was stopped too, by another of its rules: "Never message members from the daily job." It was doing the right thing, and it still couldn't do its job.

We call this a **blind rule**: a rule whose answer depends on something the checker can't see. That's where the words came from, what happened earlier, or who is asking and which job is running. Our own engineering notes already said to keep such rules in the agent's instructions, because the checker sees only the reply. The data showed us how much it matters.

By our count (we read each rule's text and sorted it), 61 of the 78 blocks after the fix came from blind rules. A checker that sees only words can judge a rule only if the words alone decide it.

| Depends on | Blocks | Example | Judgeable |
| --- | --- | --- | --- |
| The words alone | 17 | Never say ORANGE | Yes |
| Where words came from | 40 | Never invent a date | No |
| What happened earlier | 12 | Only after a yes | No |
| Who or which job | 9 | Owner only | No |

Those are 78 blocks on the development server from 2026-11-17 to 2026-11-25, 44 of them from this one agent. It's a small sample from one server. We'd expect the same shape anywhere a rule says "only if", "unless" or "only from".

## Can a guardrail stop prompt injection?

Not against someone who tries. Prompt injection is when text the model reads (a web page, an email, a tool's reply) contains instructions, and the model follows them as if you'd written them. A detector is a guardrail that looks for such text.

Meta's own test of PromptGuard 2 on AgentDojo, a benchmark of fixed, pre-written attacks, cut the attack success rate from 17.6% to 7.5% with almost no loss of useful work ([LlamaFirewall paper, 2025-05](https://arxiv.org/abs/2505.03574)). The authors of a bigger study agree such detectors ["can still provide practical value by blocking some unsophisticated or opportunistic attacks"](https://arxiv.org/abs/2510.09023).

Then the attacker adapts. A 2025-10 paper whose 14 authors [include researchers from OpenAI, Anthropic and Google DeepMind](https://simonwillison.net/2025/Nov/2/new-prompt-injection-papers/) [bypassed 12 recent defenses](https://arxiv.org/abs/2510.09023) with a success rate above 90% for most. Most of those defenses had reported near-zero. Their attacker was strong: it adapted, made many queries and could see the detector's scores. Their verdict on the fix everyone reaches for: stacking more detectors "does not resolve the underlying robustness problem".

Detectors also fail in both directions. A [February 2026 paper testing injection detectors](https://arxiv.org/abs/2602.14161) (one author, testing off-the-shelf detectors) found that one caught only 8% of indirect injections, meaning ones hidden in content the model reads. The other caught 99.8% of attacks but flagged 82.4% of harmless inputs. That's a smoke alarm that either sleeps through the fire or goes off at your toast.

Simon Willison [put the bar plainly in 2022](https://simonwillison.net/2022/Sep/17/prompt-injection-more-ai/): "When you’re engineering for security, a solution that works 99% of the time is no good." OpenAI says prompt injection is ["unlikely to ever be fully 'solved'"](https://openai.com/index/hardening-atlas-against-prompt-injection/), and the UK's NCSC [says to reduce the risk and the impact](https://www.ncsc.gov.uk/blog-post/prompt-injection-is-not-sql-injection) instead.

In a post from 2026-10-06, Signals Corps reported scanning the headers of [217 million crawled web responses](https://www.signalscorps.com/blog/prompt-injection-in-http-headers/): of 7,959 sites sending a header aimed at AI, 30 tried to give an agent orders, and 22 of those were pranks. Today's header injections are mostly jokes. A list of known jokes won't catch what comes next.

The tool result talks, too, and it needn't be an attacker. A Reddit user [posted what Notion's hosted MCP server sends back](https://old.reddit.com/r/ClaudeCode/comments/1y4qm5o/heads_up_if_you_wire_notions_official_mcp_into/) when a workspace hits its query limit: error text that tells the model to show an upsell link, with a flag that reads "surface_even_if_fallback_succeeds". That's an upsell, not an attack. It shows how freely a tool's reply gives orders to a model, in text the person may never read.

## What actually limits an agent?

What it can't do. [Anthropic's red team](https://www.anthropic.com/engineering/how-we-contain-claude) phished an employee into launching Claude Code with a malicious prompt, in 2026-02. The prompt asked Claude to read the employee's AWS credentials file and send it to an outside server. Across 25 retries, Claude did it 24 times. Anthropic's conclusion: the only defense that holds there is the environment, meaning limits on outbound traffic (egress: what a process may send out) and filesystem boundaries that keep the credentials out of reach. Their line: "The deterministic boundary is what gets hit when everything probabilistic misses."

Credentials the sandbox never holds can't leak. You can't phish what isn't there. Even an allowlist of domains grants more than it seems. In a disclosure Anthropic describes, Claude Cowork uploaded a user's files to an attacker's account through api.anthropic.com, a domain it had to allow. Anthropic now suggests thinking of an allowlist as "a capability grant".

Look at what these incidents and demos had in common, and ask what you'd have to take away to stop them. In [General Analysis's demo of Supabase's MCP server](https://www.generalanalysis.com/blog/supabase-mcp-blog), on dummy data, a support ticket got private tables copied into a reply, because the assistant ran with `service_role`, a database role that skips row-level security. After its agent deleted a production database, Replit's fixes included [automatic separation of development and production databases](https://fortune.com/2025/07/23/ai-coding-tool-replit-wiped-database-called-it-a-catastrophic-failure/). Willison notes that vendors usually fixed exploits like these [by closing the exfiltration path](https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/), so stolen data had no way out. Each of these fixes took a capability away. None was a better detector.

Willison's name for what those exploits need is the lethal trifecta: private data, untrusted content and a way to send things out, all in one session. Meta's [Rule of Two](https://ai.meta.com/blog/practical-ai-agent-security/) says to hold at most two. We drew the trifecta in [what breaks when your AI agent leaves the laptop](https://qa.definable.ai/blog/what-breaks-when-ai-agents-leave-the-laptop), so we won't redo it.

There's a cost. Google DeepMind's CaMeL, which keeps untrusted data away from the model's choices, [solved 77% of AgentDojo tasks](https://arxiv.org/abs/2503.18813) with provable security against 84% undefended, using about 2.8 times the input tokens. That cost is real, and we haven't paid it: nothing in our agents works like CaMeL yet. Or, as [a dev.to post on prompt injection as an authorization problem](https://dev.to/cyclopt_dimitrisk/prompt-injection-isnt-a-prompt-problem-its-an-authorization-problem-59j6) puts it: "the model proposes, the application decides."

That's how we built approvals at Definable. Each tool call has a level (read, write or delete, or it stays inside the agent's own space), and each chat runs in one of three modes, starting in Auto. The mode decides what runs and what asks a person; an action an owner turned off is blocked. That's plain code. No model gets a vote.

**Fig 3 · Modes against levels**

1. **Auto.** It asks before a write or delete outside the agent's own space.
2. **Ask first.** It asks before everything except a read inside the agent's own space.
3. **Don't ask.** Everything runs, unless an owner turned the action off or the tool always asks. Pick this one only inside a sandbox you trust.
4. **All three.** Same levels, three answers. Always allow is never offered for a delete.

*From our approval hook. Always allow is never offered for a delete, in any mode.*

## Are approval prompts any better?

Not much, and you shouldn't treat a prompt as a scan. On our development server, from 2026-10-19 to 2026-11-25, people answered 274 approval cards. 267 said yes (97.4%), 7 said no, and 44 more expired unanswered. The median answer took 7.0 seconds, and 157 of 274 (57%) came in under 10 seconds.

Read that with a caveat: on a development server, people are often testing an action they just asked for, so a high yes rate is expected. It still shows what a card is in practice, a 7-second yes. By coincidence, [Anthropic reports in its auto mode post](https://claude.com/blog/auto-mode-default-in-claude-code) that users approve 97% of Claude Code permission prompts.

In Anthropic's own controlled study, with 1,053 paid testers in a test setting (a vendor testing its own product), people caught a clearly dangerous command 13.6% of the time. They caught about 17% early in a session and about 5% after 50 or more prompts. Same source, and a split we found useful: users rejected 39% of plans but only 3% of single permission requests. People push back on plans far more often.

You also have to plan for attackers who simply switch the prompts off. A [Copilot flaw (CVE-2025-53773)](https://embracethered.com/blog/posts/2025/github-copilot-remote-code-execution-via-prompt-injection/) let an injection edit the settings file and turn every prompt off. [The Nx malware](https://snyk.io/blog/weaponizing-ai-coding-agents-for-malware-in-the-nx-malicious-package) ran installed coding agents with their skip-approval flags. Even Meta's [Rule of Two post](https://ai.meta.com/blog/practical-ai-agent-security/) says designs that follow it can still fail, giving "a user blindly confirming a warning interstitial" as its example.

And approving an intention isn't authorising an action: [a dev.to post on approving the wrong thing](https://dev.to/katul1512/ai-agents-can-get-approval-and-still-do-the-wrong-thing-4oon) describes systems that confuse the two. So our rule is narrow. Always allow never covers a delete. An approval is consent and a record. It isn't a scan.

## Where do guardrails earn their keep?

On words, in our experience. Tone, promises, words that must never appear, what a channel may hear. Those are rules the reply settles by itself, and a cheap second reader is good at them.

Most of our 51 blocked answers came from asking about a reply as if it were an action: the checker read a draft, a greeting or a report as the thing a rule forbids. The fix was to say what a reply is: "Writing it only shows words: it sends, posts, publishes, changes or runs nothing." In the rerun, that question replaced 12. A stricter wording replaced only 3, but missed 4 of 36 real breaks, so we kept the plainer one.

In 726 checks ours never failed or timed out, but we still chose what happens when it does: the action is blocked and the answer goes out. A blocked write costs a retry. Blocking every answer would take the agent offline.

We keep a set of real breaks the checker must still catch, and we reran it when we changed the question. A dev.to post, [Nobody Checks Whether the Guardrail Is Running](https://dev.to/mickyarun/nobody-checks-whether-the-guardrail-is-running-3ng), says why: "A guardrail that has never fired and a guardrail that silently stopped running produce identical output." And watch the false-block rate like an error rate. The gym job's writes were 29 of 29 blocked for 8 days before we looked.

## A checklist

1. Write each rule so the words or the action alone decide it. If it says "only if", "unless" or "only from", move it to the instructions.
2. Count your blocks by rule every week. A rule that blocks the same job every day is a bug, not a catch.
3. Ask the checker about a reply as a reply, and test it with a known-bad input it must reject.
4. Fail closed for actions and open for words.
5. Take capabilities away first: scoped tokens, no credentials in the sandbox, egress limits, separate dev and prod.
6. Ask people about plans, not about each command, and never offer Always allow for a delete.
7. Assume a determined attacker beats your detector, then ask what the worst thing is that it could still do.

## What's the line to remember?

A guardrail is a second opinion about words. A permission is a fact about the world. At Definable we use both, and we only trust the second one with the keys.
