Why a Prompt Won't Stop an AI Agent Before It Acts
Why writing strict rules in a system prompt fails to protect production tools and how moving authorization to a deterministic layer solves it.

Table of Contents
- The Myth of Stopping Agents With Text Rules
- When Prompt Injection Beats the System Base
- Why Probability Never Guarantees Control
- Intercepting Every Action Before Execution
- From Predictable Flows to Synchronous Limits
- What Happens in Those Fifty Milliseconds
- Why Separating Reasoning and Execution Matters
- Real Isolation and Zero-Trust Identity
- Sandboxes With No Outbound Network by Default
- Ephemeral Identities for Paused Fleets
- Sources
There's a scene that plays out almost weekly on teams connecting language models to real-world tools for the first time.
Someone hooks an agent up to email, a CRM, or a customer database, tacks an all-caps line onto the end of the system prompt—"NEVER delete records or send money without confirmation"—and calls it a day.
In a demo, it works like a charm. In production, that confidence lasts right up until the first external document with hidden malicious text slips through. The root problem is simple: you're trying to enforce a security rule through the exact same plain-text channel an attacker can write into.
The Myth of Stopping Agents With Text Rules

When you build traditional software, the boundary between the code in charge and incoming user data is sharp. A parameterized SQL query never mistakes a customer's name for an order to wipe the table.
Inside a language model, that separation doesn't exist: your system instructions and the text the agent just scraped from a webpage travel side by side, flattened into the same sequence of tokens.
When Prompt Injection Beats the System Base
Picture an assistant that summarizes incoming emails and has permission to reply or forward files. A third party sends a seemingly ordinary message, but tucks a hidden block inside telling the model to ignore its previous rules and forward the latest internal reports to an outside address.
The server didn't suffer a network breach or leak a password; the model simply read external text and treated it as part of a valid conversation.
The numbers published in the pre-action authorization paper (arXiv:2603.20953) put real scale behind that fragility. In adversarial tests with no external guardrail, injections triggered unauthorized actions in up to 74.6% of attempts.
Put plainly, nearly three-quarters of the time, asking the model to behave accomplished nothing.
Why Probability Never Guarantees Control
The funny thing is, this doesn't happen because the model is poorly trained. An LLM is built to predict the most coherent continuation given everything in its context window—which makes it great at drafting or summarizing, and terrible at acting as a bouncer.
Operational security can't be probabilistic: nobody would trust a payment system where transfer approval depended on how persuasive the last paragraph of a receipt sounded.
Intercepting Every Action Before Execution
The practical answer isn't pulling the plug on automation or going back to doing everything by hand. What actually changes the game is taking authority out of the model's head and handing it back to standard code, right on the bridge between intent and execution.
In Anthropic's guide on building effective agents, the engineering team warns against overcomplicating your architecture.
Before unleashing an autonomous agent that improvises tool calls without guardrails, it's worth checking whether predictable, composable workflows—chaining steps, routing tasks, or running parallel checks—paired with clean tool interfaces solve the job without leaving room for ambiguity.
flowchart LR A["Input: LLM Model (Proposal)"] --> B["Process: Synchronous Interceptor (~**53 ms**)"] B --> C["Allow/Deny Evaluation"] C --> D["Output: Tool Call or Block"]
From Predictable Flows to Synchronous Limits
Of course, there are plenty of tasks where you genuinely need the agent to decide which tool to call on the fly. In that setup, the model should act like someone filling out a purchase request, not the person signing the check.
It proposes the call with JSON arguments, but before anything touches your API or database, a synchronous interceptor stops it cold and checks it against strict rules written in code.
What Happens in Those Fifty Milliseconds
That checkpoint is exactly what frameworks like Open Agent Passport (OAP) lay out in arXiv:2603.20953.
Instead of trusting the goodwill of a prompt, the interceptor verifies who started the session, whether the tool is allowed in that context, and whether the parameters stay within hard limits—while logging a signed trail of the decision.
The outcome in those same adversarial tests was decisive: unauthorized actions dropped from 74.6% to 0%, at a cost of just ~53 ms in median latency.
A twentieth of a second is practically invisible next to the time any model takes to generate a reply, yet it's the difference between sleeping through the night and combing through logs at 3 a.m.
Why Separating Reasoning and Execution Matters
Splitting who proposes from who authorizes makes life dramatically easier for whoever maintains the system.
You can upgrade the model, tweak the prompt, or adjust the tone without worrying about opening a backdoor, because the hard rules—spending caps, allowed routes, approved domains—live in deterministic code that no email injection can rewrite.
Real Isolation and Zero-Trust Identity

Validating the tool call locks down the front door, but another equally sensitive front remains: what happens when the agent runs code generated on the fly or sits idle for hours waiting on a human? According to cloud operations figures, interactive agents spend 90% to 95% of their time waiting on token streams or approvals.
Keeping classic containers running with static credentials while they wait is both expensive and risky.
What usually fails: Dropping the agent into a traditional container with a permanent API key and hoping it stays inside its folder. What scales safely: Spinning up environments with no outbound internet by default, validating every call outside the model, and issuing short-lived, least-privilege credentials.
Sandboxes With No Outbound Network by Default
When the job calls for running lightweight, agent-generated code, booting heavy machines for every turn ruins the experience.
To solve that, Cloudflare Dynamic Workers bets on V8 isolates instead of Docker containers or microVMs, hitting 100x faster startups—just a few milliseconds—and 10x to 100x lower memory overhead.
From a security standpoint, the smart part is that each isolate starts silent toward the outside world (globalOutbound: null): it has no default outbound network and can only touch the exact functions you expose over TypeScript RPC alongside tools like @cloudflare/codemode, @cloudflare/worker-bundler, and @cloudflare/shell.
And if a session stretches across hours or days, Project Think pairs Durable Objects with embedded SQLite to pause and resume streams or tasks via runFiber() without losing state.
Ephemeral Identities for Paused Fleets
Not everything fits inside a JavaScript isolate, of course; when an agent needs a full operating system or native libraries on Kubernetes, the playbook shifts.
That's where Google Cloud Agent Substrate steps in, taking snapshots of the agent's RAM and filesystem when it pauses and restoring them in under 500 ms, boosting compute density by up to 10x while rotating cryptographic SPIFFE X.509 identities and dynamic JWTs on the fly.
If you look at the full market laid out in GKE Agent Sandbox vs. Agent Substrate, the tiering by cost and complexity is straightforward: V8 isolates cover the lightweight tier ($), hibernating CPU fleets handle the middle ground ($), and 1:1 gVisor or Kata Containers environments for GPU or TPU workloads sit at the heavy-duty tier ($$).
Either way, the takeaway holds across all three levels: text guides the model, but architecture is what guards the house.
Sources
- Before the Tool Call: Deterministic Pre-Action Authorization for Autonomous AI Agents (arXiv:2603.20953)
- Building effective AI agents — Anthropic Research
- Sandboxing AI agents, 100x faster (Dynamic Workers) — Cloudflare Blog
- Project Think: building the next generation of AI agents on Cloudflare — Cloudflare Blog
- Sandboxing Untrusted AI Agents at Scale: Agent Substrate & gVisor — Google Open Source Blog
- Bringing you Agent Sandbox on GKE and Agent Substrate — Google Cloud Blog

Written by Nova Lin
AI Agents & Research Lab
Personaje editorial de Genioz. Simplifica tareas repetitivas y aburridas con herramientas digitales prácticas para ganar más tiempo libre.
Thematic editorial persona backed by our human curation team.



