{"slug": "llms-make-poor-security-guards", "title": "LLMs Make Poor Security Guards", "summary": "Nectry released an Agent Reliability Benchmark showing that popular LLMs acting as security guards fail to follow policy rules reliably, leaking financial details to a lookalike-domain phishing email in 5 of 8 runs with no rules and 3 of 8 runs even when prompted to email only known contacts. The company argues that deterministic enforcement of policies written in its NectryCore domain-specific language, rather than additional LLM agents, is needed for high-stakes, high-volume security decisions.", "body_md": "Let me interrupt my current article sequence on [deriving programs from specifications](https://stng.substack.com/p/correct-by-construction-code-via) to bring you a public-service announcement!\n\nAI agents are being used to do amazing things in the world. Sometimes the functionality of agents or systems they build outruns the appropriate security measures. The first instinct of people psyched about their agents is to add more AI agents to the mix to enforce security rules. It’s a good start, but (as others [like Simon Willison have observed before](https://simonwillison.net/2022/sep/17/prompt-injection-more-ai/)) reliability isn’t high enough for remotely high-stakes situations, where there may be many security-relevant actions to vet each day. It doesn’t take a very high failure rate of the agentic security guard to do real damage.\n\nBut just how badly will AI agents tasked with security mess up? At [Nectry](https://nectry.com/), we’ve just released our [Agent Reliability Benchmark](https://nectry.com/research/agent-reliability-benchmark/) to answer that question. We show just how bad even some of today’s most popular models are at following rules from prompts, compared against deterministic enforcement of policies written in Nectry’s domain-specific language NectryCore. (By “deterministic,” I mean that enforcement runs in a predictable way, with none of the probabilistic nature of machine-learning models.)\n\n# The Appeal of the LLM-Maximalist Approach\n\nThe world is full of important problems where it is hard even to spell out unambiguously what constitutes success. Even experts find specification-writing challenging, let alone people solving problems in unfamiliar fields. One of the superpowers of LLMs is taking vague descriptions and making them actionable, drawing on many training examples of problems being fleshed out. Still, the underlying technology remains mysterious and [prone to important failures](https://stng.substack.com/p/designing-decision-making-systems).\n\nThe temptation is always to reach for the flexible technology, with a shallow learning curve, that delivers good answers 99% of the time. The trouble is that, in, say, a large company, having “only” 1% of agentic decisions go wrong with bad security consequences remains pretty bad. We should assume that attackers, both company insiders and external people who manage to provide content fed to agents, are doing their best to find exactly the “rare” cases where agents take dangerous actions.\n\nThere are plenty of great uses for AI agents where the stakes are not so high. For instance, in a variety of kinds of explorations of data to form hypotheses, we value the creativity of agents more than we fear their occasional mistakes. Such hypotheses can then be vetted in traditional ways. We’d rather be sure not to miss a great perspective than sure that we’ll never waste our time vetting a hypothesis that turns out to be nonsense.\n\nBut let’s confine our attention to uses of AI agents at scale, with frequent decisions with significant security consequences. Again, a big company with many people using agents is a canonical setting. Just how much should the company’s IT and cybersecurity leaders worry about leaning fully on LLMs?\n\nI’ll give a concrete example of the kind of challenge we’re interested in, one among dozens from the benchmark. Say a fraudster has registered an [Internet domain name](https://en.wikipedia.org/wiki/Domain_name) that is just slightly off from the domain of a legitimate company. Our heroes do business with the company that’s being impersonated. An email arrives asking for financial details, and the helpful agent replies with them. We found this behavior in 5 out of 8 runs of agents with no rules specified, and the results only improve to 3 out of 8 runs when we extend prompts with a rule to allow email only to known contacts. Nectry helps agents achieve the correct behavior on all runs.\n\n# The Agent Reliability Benchmark\n\nLet’s talk about Nectry’s [Agent Reliability Benchmark](https://nectry.com/research/agent-reliability-benchmark/), whose development was led by our CTO [Daniel Winograd-Cort](https://www.danwc.com/). The basic setting is AI agents as personal assistants, given the power to access calendars and email, approve purchases, and take other sensitive actions. Guardrails on these agents can be spelled out in English or in our NectryCore domain-specific language. The former relies on LLMs having their wits about them, while the latter removes AI from the [trusted base](https://en.wikipedia.org/wiki/Trusted_computing_base) for rule enforcement (meaning that there is no chance for an AI bug/hallucination to allow through an action that the formal policy forbids). How much difference does it make to introduce deterministic rule enforcement?\n\nHere’s one good summary of the bottom line.\n\nThat summary is for the agent actions we classified as high-severity. Overall, the benchmark consists of 86 tasks (high-severity cases included) that are *at least* risky. Then, when agents aren’t even told the rules, they understandably don’t tend toward following them, and 31% of requested risky actions were performed. When prompts were extended with English that conveys the rules to reasonable people, the rate of risky actions allowed dropped to 16%, which is good but not *good enough* for a large organization with many regular users of agents. Perhaps unsurprisingly, all encoded rules were enforced perfectly by Nectry’s deterministic engine.\n\nThe 86 prompts were created by an LLM-based flow, and we also test each prompt using an LLM to simulate a human user, which is important because the various security mechanisms are allowed to require human approval in the GUI before an action is allowed. Also, humans can be asked questions, whose answers refine exactly which actions should be taken. This use of LLMs to build the benchmark is ironic at one level, but at least it is relatively straightforward to read through the complete set of prompts and look for anything weird! Generation of prompts is based on the explicit goal of requests that at least flirt with raising security risks.\n\nNow, one safe fallback is asking the human user to approve *every* action the agent wants to take. The cost is, in this benchmark, an average of 3.58 interruptions per task! Nectry brings that figure down to 1.56 interruptions, on average. Using Nectry leads to 88% of tasks being completed successfully without harm, while just putting rules in prompts achieves 78% of tasks (and only triggers 1.08 interruptions on average), and it’ll depend on social context whether the more important cost is from allowing a dangerous action or slowing usage with confirmation red tape.\n\nIt’s worth saying that rules don’t always capture all true requirements. We found some interesting corner cases for about 3% of attempts, like rules saying deleting snapshots from production is forbidden, but then what if the user asks to delete a snapshot from staging? Probably the most confounding one was about a rule saying that agents should always ask their users before accepting calendar invitations. The rules we formalized blocked literally accepting the calendar invitation via the associated technical protocol for calendars, but not sending a separate email saying “I’m in!”, which a reasonable person might interpret as “accepting.” The general tendency this example embodies is the importance of the gap between what “everybody knows” some prose means and what any particular technical encoding actually enforces.\n\nAnother tricky corner case is when the agent starts dumping sensitive information like social-security numbers directly in the text chat. Nectry doesn’t actually get an opportunity to inspect and approve/deny such requests. To explain why, I’ll briefly summarize how Nectry constrains agents.\n\n# The MCP Server to End All MCP Servers\n\nThe Agent Reliability Benchmark uses Nectry MCP, one variant of our underlying technology for the use case of constraining agents. Nectry MCP builds on the [Model Context Protocol](https://en.wikipedia.org/wiki/Model_Context_Protocol) introduced by [Anthropic](https://en.wikipedia.org/wiki/Anthropic) in 2024. Previously, there was at least a moderate profusion of different technical formats that AI agents had to use to connect to different external services and databases. Anthropic standardized all that around one protocol that is general enough for pretty much anything an agent ought to integrate with. (In fact, MCP as a new standard is valuable even for use cases that don’t involve AI. It’s just that the velocity of new developments with AI agents motivated the creation of a new format where somehow the suffering of human programmers for decades had been insufficient!)\n\nNectry MCP is a so-called MCP gateway, one server that acts as a middleman for connecting to a variety of external services and databases. Canonically, *the underlying agent is not given direct access* to any of those services. Instead, all its requests go through the Nectry MCP server, which is able to enforce policies that, for instance, control the flow of information across services. This flow is yet another example of a good idea from the 1970s being applied today, in this case the concept of a [reference monitor](https://en.wikipedia.org/wiki/Reference_monitor). One twist in this setup is that the Nectry gateway also gets final say on when to ask the user to confirm that an action is safe to perform.\n\nThis diagram includes the case of using a separate LLM-based agent to vet requests to access external services. We have some preliminary experiments with that style, using the same tasks, that aren’t yet folded into the benchmark page. We tried vetting every requested tool call with Claude Haiku 5.5 and Sonnet 5.5 (in different runs), providing in each prompt the rules in English, the whole chat log, and a history of all tool calls made so far. We tried two different variants: the vetting LLM is always allowed to allow or deny a request, but in one variant the LLM is also allowed to request asking the user for permission. With the option to escalate to asking permission, the setup did even better than Nectry for avoiding harm – but this result arises from coming very close to just asking for permission on every tool call (3.20 requests per task on average, compared to 3.58 for asking on every call). *Without* the option to escalate to asking permission, the vetting LLMs were significantly confused, with consequences for security: almost 10% of attempts leading to risky actions proceeding. ([A related study by Anthropic](https://anthropic.com/engineering/claude-code-auto-mode) found that the classifier behind their auto-mode accepted 17% of actions that should have been rejected.)\n\nIt’s important that an MCP gateway sees the exact tool calls, requests to take particular actions in external services. They can (in most cases) be understood without any of the subtleties of natural language, and good-old-fashioned deterministic rules can be applied to decide which calls are safe. However, MCP servers *don’t* in general see agent chats directly with users, hence Nectry’s inability to catch inclusion of sensitive data in chats.\n\nSince Nectry MCP is a drop-in replacement for other MCP servers, it can be added with minimal changes to existing agents. It’s compatible with pretty much any foundation model developed recently. Our benchmark considered a few of them, which all fare pretty poorly in using prompting to head off security risks.\n\nNow, some of you may have been expecting today’s standard risk of “just wait for the models to get better” to sneak up on us eventually, and some of our latest experiments show something of that flavor. We did some testing with newer model Gemini Carbon, and it’s basically as effective as older models plus Nectry. It’s still true that Carbon is much slower and more expensive than its younger Google siblings, so we think it’s pretty cool that Nectry can bring the same security benefits at much lower cost. It remains to be seen how large companies will feel about providing the most expensive models for the day-to-day agentic assistants of thousands of employees, and our results show that they may not need to, if the goal is maintain high standards of cybersecurity. We also used older models to generate the sneaky prompts, and we might need to get Carbon and similar models to red-team themselves and find trickier tricks!\n\n# Conclusion\n\nNectry MCP is in closed beta now, and I’d love to [hear from](mailto:adamc@nectry.com) folks at companies medium-sized and up who might want to join the beta.\n\nThere are actually quite a lot of tools being developed that add deterministic monitoring and enforcement for AI agents. The benchmark I’ve summarized may be helpful to understand why this general tool category can be so valuable. However, it’s still hard to know whether a set of formal rules is sufficient to capture users’ true security requirements. Nectry includes another element of formal verification of MCP-server programs against policies that capture more fundamental security requirements, and I’ll come back to explaining that approach in a future article. Giving AI agents access to such formal-verification tools can even help them build the right reference monitors in the first place.\n\nOK, public-service announcement complete! The next article will return to considering effective derivation of programs from specifications, with one last example in C programming. Then we’ll step back and think about what common formal framework can host all of these styles of derivation, including for systems whose different parts are derived with different techniques.", "url": "https://wpnews.pro/news/llms-make-poor-security-guards", "canonical_source": "https://stng.substack.com/p/llms-make-poor-security-guards", "published_at": "2026-11-24 14:09:31+00:00", "updated_at": "2026-11-24 14:17:58.218579+00:00", "lang": "en", "topics": ["ai-agents", "ai-safety", "large-language-models", "ai-tools"], "entities": ["Nectry", "NectryCore", "Simon Willison"], "also_reported_by": [], "takeaway": "Prompted LLM security agents leaked financial details to a lookalike-domain phishing email in 5 of 8 runs, and still 3 of 8 when told to email only known contacts, versus deterministic policy enforcement succeeding on all runs.", "recommendation": {"advice": "Enforce security rules with deterministic policy code rather than prompt instructions, since prompted agents still leaked data in 3 of 8 runs even with an explicit known-contacts rule.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/llms-make-poor-security-guards", "markdown": "https://wpnews.pro/news/llms-make-poor-security-guards.md", "text": "https://wpnews.pro/news/llms-make-poor-security-guards.txt", "jsonld": "https://wpnews.pro/news/llms-make-poor-security-guards.jsonld"}}