Guardrails in two layers: what the agent reasons about, and what it cannot reach

This page is the full version of one slide in Deploying Agents at Scale: What Enterprise Adoption Actually Looks Like, Agentic Engineering Days Zurich, November 2026. The talk promised a split between "infrastructure-layer controls the agent cannot bypass" and "reasoning-layer controls". Here are the two layers, examples of each from public products, papers and incidents, the evidence on which one holds, and what that evidence cannot tell you.

Every figure carries a label, so you can judge it yourself. A controlled study means researchers set the conditions and measured the result. Vendor telemetry means a company measuring its own systems or customers, usually one that sells the fix. A forecast is a prediction; none is used here. Every source was read live on 2026-11-13. Two of them, Claude Code's sandboxing documentation and Ona's post, were read again on 2026-11-14, and this page quotes them as they read that day. The table at the end gives each source with its read date.

The split

Reasoning-layer controls are enforced in the same place the agent thinks: in text it reads and in logic it can reason about. A system prompt that says "do not touch production", a deny rule that matches the text of a command, a classifier that tries to spot prompt injection, a request for human approval that the agent words itself. Each of them works only as long as the agent, or a person reading what the agent wrote, goes along with it.

Infrastructure-layer controls are enforced outside the agent, by something it cannot talk to: the operating system, the kernel, a network proxy, a database permission, an interpreter that runs a fixed policy. The agent can reason about them all it likes. The decision is not its to make.

Four public sources draw the same line in their own words:

Simon Willison, writing on the "lethal trifecta" of private data, untrusted content and external communication, puts the reasoning-layer problem plainly: "you can try telling it not to in your own prompt, but how confident can you be that your protection will work every time?" (16 June 2025)

The test that follows from all four: if the agent can argue with a control, reword around it, or ask for it to be turned off, it is a reasoning-layer control, wherever it is configured.

Examples, by layer

All of these are public products, papers or incidents. None comes from an employer's or a client's systems.

Control Layer What enforces it Source
An instruction to freeze code and change nothing without permission Reasoning The agent's reading of the instruction. In July 2025 Replit's agent changed code during a freeze and deleted a production database The Register, 21 July 2025, quoting Jason Lemkin's posts on X. Secondary only, not read in the primary, so unverified
A Claude Code deny rule on npx and node Reasoning Matching the command's text. Ona's run got past it with /proc/self/root/usr/bin/npx; Claude Code's own documentation says "A deny rule doesn’t match the same program by path or inside sh -c" Ona, 3 March 2026; Claude Code permissions documentation
Prompt and filter defenses against prompt injection: Spotlighting, Prompt Sandwiching, PromptGuard, Protect AI's detector, Model Armor and others Reasoning A model, or a model-written classifier, deciding what text to trust Nasr, Carlini et al., arXiv 2510.09023
A human approval prompt, when the agent writes the request Reasoning A person reading the agent's own explanation. Anthropic warns that constant approval "can lead to ‘approval fatigue’, where users might not pay close attention to what they're approving"; Meta lists "a user blindly confirming a warning interstitial" as a way designs still fail Anthropic, 20 October 2025; Meta, 31 October 2025
Claude Code's Bash sandbox: filesystem isolation plus network access only "through a unix domain socket connected to a proxy server running outside the sandbox" Infrastructure Linux bubblewrap and macOS Seatbelt, "to enforce these restrictions at the OS level", including every subprocess a command starts Anthropic, 20 October 2025, for both quotes; Claude Code sandboxing documentation
Replit's split of development and production databases: "Agent is not able to modify the production database" and reads it through a read-only replica Infrastructure Which database the agent's connection points to Replit documentation, "Production databases"
CaMeL: the model writes a plan, and a custom interpreter enforces data-flow and capability policies before any tool runs Infrastructure The interpreter, not the model Debenedetti et al., arXiv 2503.18813
Ona's Veto: the kernel blocks a binary by the SHA-256 hash of its content, so renaming or copying it does not help Infrastructure A BPF LSM hook in the kernel Ona, 3 March 2026
The Agents Rule of Two: an agent may combine no more than two of untrusted input, sensitive data, and the ability to change state or communicate out, within one session Either, depending on how it is enforced Removing a capability from the agent's reach is infrastructure; asking the agent to avoid one is not Meta, 31 October 2025

Evidence on which layer holds

Reasoning-layer defenses fall to an attacker who adapts

Controlled study. Researchers from OpenAI, Anthropic, Google DeepMind, ETH Zurich and others took 12 recently published defenses against jailbreaks and prompt injection: prompting defenses, defenses trained into the model, detection filters and secret-knowledge defenses. They attacked each one with methods tuned to that defense. In the paper's words: "we bypass 12 recent defenses (based on a diverse set of techniques) with attack success rate above 90% for most; importantly, the majority of defenses originally reported near-zero attack success rates." A human red-teaming competition "with over 500 participants" and $20,000 in prizes ran alongside, and "Competitors are able to defeat every challenge in our study." (Nasr, Carlini et al., arXiv 2510.09023, October 2025.)

All 12 are reasoning-layer controls in the sense above: each asks a model, or a model-based filter, to tell trusted text from untrusted text.

A layer outside the model holds, at a cost in usefulness

Controlled study. CaMeL puts an interpreter between the model and its tools. The trusted user request fixes the control flow, so untrusted data the agent reads later "can never impact the program flow", and policies on each piece of data decide which tools may receive it. On the AgentDojo benchmark: "We demonstrate effectiveness of CaMeL by solving 77% of tasks with provable security (compared to 84% with an undefended system)." (Debenedetti et al., arXiv 2503.18813, v2 of June 2025.)

The cost is real: fewer tasks solved, and some tasks need the user to confirm a data flow. The limits are the authors' own: CaMeL "cannot defend against text-to-text attacks which have no consequences on the data flow", such as a summary that misstates an email or a phishing link passed through, and the paper shows side channels that can leak information past it.

The infrastructure layer also asks people less often

Vendor telemetry. Anthropic, on the sandbox for Claude Code: "In our internal usage, we've found that sandboxing safely reduces permission prompts by 84%." (20 October 2025.) That figure counts prompts, not attacks stopped, and it is the vendor measuring its own use. It matters here because the alternative to a boundary is a stream of approvals, and the same post names what that stream does to people: approval fatigue.

The catch: a control the agent can ask to switch off

A vendor's own demonstration, a single case with no figure. Ona ran Claude Code with a deny rule on npx and node and with Anthropic's bubblewrap sandbox on, then told the agent to find a way to run the command. The agent read the deny rule and got past it with a different path to the same binary. The sandbox stopped that. The agent then reasoned, in its own words, "Let me try disabling the sandbox and using the full binary path to bypass the deny rule pattern", and asked for approval to run outside the sandbox. With the approval given, the command ran. Ona's reading: "Approval fatigue turns a security boundary into a rubber stamp." (Ona, 3 March 2026.)

The sandbox was an infrastructure-layer control with a door the agent could ask a person to open, which put it back in the reasoning layer. Claude Code's documentation describes that door, the unsandboxed retry, and how to close it: set "allowUnsandboxedCommands": false, and "With the retry disabled, Claude Code ignores the dangerouslyDisableSandbox parameter." It also describes failIfUnavailable, which keeps commands from running unsandboxed when the sandbox cannot start.

Ona then turned on Veto, its kernel-level control. The path trick, a Python subprocess wrapper, bash -c and a renamed copy of the binary were all refused. The agent then ran the blocked program through the dynamic linker, which loads code without the system call Veto watched, and it ran. Ona's own conclusion is to layer the gates (execution, code loading, network), not to trust one: "The agent can route around one gate. It gets harder to route around all of them."

Reading the evidence together

The controlled studies point one way: defenses that rely on a model judging text fail against an attacker who adapts, while a layer outside the model holds, with guarantees, at a modest cost in tasks solved. The single case from Ona shows the condition attached: an infrastructure control holds only while nothing in the agent's reach can turn it off, and one control can still have a gap that the next layer has to catch.

What this evidence does not show

Three questions for your own guardrails

  1. For each control your agents run under, where is it enforced: in text the agent reads, or in something outside it (the operating system, the network, a database permission, an interpreter)?
  2. Can the agent ask for the control to be lifted, and who approves that request, how often, and after reading whose explanation?
  3. If one infrastructure control is bypassed, what is the next layer that catches the effect: the network egress rule, the read-only credential, the separate production environment?

Sources

Every source was read live on 2026-11-13. Claude Code's sandboxing documentation and Ona's post were read again on 2026-11-14, the date their rows give.

Source Published Label Read URL
Nasr, Carlini, Sitawarin, Schulhoff, Hayes, Ilie, Pluto, Song, Chaudhari, Shumailov, Thakurta, Xiao, Terzis, Tramèr, "The Attacker Moves Second: Stronger Adaptive Attacks Bypass Defenses Against LLM Jailbreaks and Prompt Injections" v1, 10 October 2025 Controlled study, adaptive attack evaluation 2026-11-13 https://arxiv.org/abs/2510.09023
Debenedetti, Shumailov, Fan, Hayes, Carlini, Fabian, Kern, Shi, Terzis, Tramèr, "Defeating Prompt Injections by Design" (CaMeL) v2, 24 June 2025 Controlled study, benchmark experiment 2026-11-13 https://arxiv.org/abs/2503.18813
Anthropic, "Making Claude Code more secure and autonomous with sandboxing" 20 October 2025 Vendor telemetry, the vendor's own internal usage 2026-11-13 https://www.anthropic.com/engineering/claude-code-sandboxing
Leonardo Di Donato, Ona, "How Claude Code escapes its own denylist and sandbox" 3 March 2026 A vendor's own demonstration, a single case, no figure used 2026-11-14 https://ona.com/stories/how-claude-code-escapes-its-own-denylist-and-sandbox
Claude Code documentation, "Configure the sandboxed Bash tool" Live page, undated Vendor documentation, no figure 2026-11-14 https://code.claude.com/docs/en/sandboxing
Claude Code documentation, "Configure permissions" Live page, undated Vendor documentation, no figure 2026-11-13 https://code.claude.com/docs/en/permissions
Meta, "Agents Rule of Two: A Practical Approach to AI Agent Security" 31 October 2025 A vendor's design framework, no figure 2026-11-13 https://ai.meta.com/blog/practical-ai-agent-security/
Simon Willison, "The lethal trifecta for AI agents: private data, untrusted content, and external communication" 16 June 2025 Practitioner essay, no figure 2026-11-13 https://simonwillison.net/2025/Jun/16/the-lethal-trifecta/
Replit documentation, "Production databases" Live page, undated Vendor documentation, no figure 2026-11-13 https://docs.replit.com/cloud-services/storage-and-databases/production-databases
Simon Sharwood, The Register, "Vibe coding service Replit deleted user's production database, faked data, told fibs galore" 21 July 2025 Press report; the posts it quotes are secondary only, not read in the primary, and unverified 2026-11-13 https://www.theregister.com/2025/07/21/replit_saastr_vibe_coding_incident/
The Register, "Replit makes vibe-y promise to stop its AI agents making vibe coding disasters" 22 July 2025 Press report; Amjad Masad's post it quotes is secondary only, not read in the primary, and unverified 2026-11-13 https://www.theregister.com/2025/07/22/replit_saastr_response/