Comparison

MCP Guard vs static allowlists and denylists

Allowlists and denylists are the first control every agent should have, and they should stay. They are exact and cheap, but they judge the shape of a call, not its context. A guard model covers the contextual cases rules cannot express. The two are layers, not alternatives.

3 min readLast updated

Checks run on our GPUs in Switzerland. Request payloads are not stored.Security

In 30 seconds

  • Rules are deterministic, free, auditable and instant. Keep them for known-bad and known-safe patterns.
  • Rules cannot see context: the same DELETE is fine on a scratch table and a disaster on production.
  • A guard model scores the call with its context, so it can catch what no rule anticipated, but it is probabilistic.
  • Layer them: hard rules first, the guard on everything the rules do not decide.

Code and dense tables are folded away. Open any of them on demand.

At a glance: MCP Guard vs static allowlists and denylists

MCP Guard compared with static allowlists and denylists, feature by feature
 MCP GuardStatic allowlists and denylists
DeterministicSame input, same scores; still probabilisticYes, fully
Cost$0.20 per 1,000 checksFree
Latency~15 ms on GPU, plus networkMicroseconds
AuditableScores and reason codesYes, the rule is the explanation
Understands context and intentYesNo
Catches unanticipated casesSometimes; that is its jobNo, only what was written down
MaintenanceThreshold tuningGrows with every new tool and incident
Can be wrongYes, in both directionsYes, when the rule is incomplete

The verdict

Keep your rules for everything you can state exactly, and put the guard behind them for the contextual long tail no rule anticipates.

What rules do well

An allowlist or denylist says exactly which tools, commands, paths, hosts or argument patterns an agent may use. It has properties no model can match:

  • Deterministic. A denied command is always denied.
  • Free and instant. A string match costs nothing.
  • Auditable. The rule is its own explanation, which reviewers and auditors like.
  • Not persuadable. No prompt can argue a regex out of its decision.

Combined with least privilege (credentials that simply cannot do the dangerous thing), rules remove whole categories of risk. You should never replace them with a model.

Where rules run out

Rules judge the shape of a call. Many dangerous calls have a perfectly ordinary shape:

  • DELETE FROM sessions WHERE created_at < now() - interval '30 days' is routine cleanup on a scratch database and a serious incident when the agent was connected to production and the user asked for a report.
  • send_email(to="partner@example.com", body=...) is fine when the user asked for it, and is data exfiltration when the recipient and body came from an instruction hidden in a document the agent just read.
  • refund(order_id, amount) is allowed, but not with an amount the customer never mentioned.

To catch these with rules you need to encode intent, provenance and environment into patterns. Rule sets that try grow long, brittle and full of exceptions, and they still miss the next variation. This is the gap OWASP's Top 10 for LLM Applications describes under excessive agency: the agent has legitimate permissions and uses them in a way nobody intended.

What the guard adds

MCP Guard reads the action together with the user's request, what triggered the action (the user, or a tool result), any constraints you pass ("staging only", "never email outside acme.com") and recent conversation. It returns a verdict and nine scores, including blast radius, whether the call looks injected, and whether the arguments are grounded in what the user asked.

That lets it flag calls that match no rule. It is also probabilistic: it will sometimes allow something it should not and ask about something harmless. That is why it sits behind the rules, not in place of them.

How to layer them

A simple order that works for most agents:

  1. Hard deny from rules: commands and targets that are never acceptable (rm -rf /, production credentials in a dev agent, unknown outbound hosts).
  2. Hard allow from rules, optionally: read-only calls you are certain are harmless, if you want to save the check.
  3. MCP Guard on everything else. Allow runs; ask goes to a human or a slower reviewer; block is refused.
  4. Fail closed. If the guard cannot be reached, fall back to ask or block for anything that writes, rather than letting it through. See fail-closed.

Feed incidents back into both layers: an exact pattern becomes a rule; a contextual miss becomes a labelled example and possibly a tighter threshold.

When rules alone are enough

If your agent has a small, fixed set of tools, all read-only or trivially reversible, rules plus least-privilege credentials may be all you need. The same holds when every write already goes through a human approval step. A guard earns its place when agents have write access to things that matter and make more calls than a human can review.

Frequently asked questions

If I have the guard, can I remove my denylist?
No. The guard reduces risk but does not guarantee safety. Keep deterministic controls for known-bad patterns; they are free and cannot be argued with.
Should allowlisted calls skip the guard?
Only if they are genuinely harmless in every context, such as reads of public data. A read of secrets followed by an outbound call is exactly the pattern where context matters.

Sources

Last updated . MCP Guard reduces the risk of harmful agent actions; it does not guarantee safety. Keep deterministic controls in place alongside it. Third-party names are used only to describe their products; we are not affiliated with them.