Questions readers ask: Do I need runtime guardrails if I already sandbox my AI agents?
Sandboxing limits what an AI agent can reach, while runtime guardrails evaluate whether a proposed action is safe in context. Agent governance needs both because isolation can keep execution inside a boundary while allowing a harmful decision, and action checks cannot take the place of infrastructure isolation.
Why sandboxing and runtime guardrails are not the same control
If an agent already runs inside a sandbox, what protection does another control add? The answer has two parts, corresponding to two different questions. A sandbox asks whether the agent can reach a resource. A runtime guardrail asks whether this action should happen now, given what is happening around it. Access and authorization are not the same judgment.
Sandboxing operates at the infrastructure level, constraining the filesystem, network, and processes available to the agent through containers, microVMs, WASM, or similar mechanisms. Runtime guardrails operate at the action level, intercepting individual tool calls and evaluating them against policy before execution. Their responses can allow an action, warn, require approval, or block it. Even an agent that is fully isolated can take actions that are allowed but wrong inside its permitted environment.
What sandboxing actually prevents, and what it cannot see
Sandboxes are the most mature layer of agent governance. Isolation keeps runaway code contained, limits resource exhaustion, and protects the host from code that the agent runs. Those are substantial protections, especially when agents can generate and run commands. Teams that have deployed isolation have addressed a real attack surface.
The available approaches differ in strength and operational cost. Containers are widely used but are not a complete isolation boundary, while microVMs provide stronger isolation at higher operational complexity. WASM runtimes can be highly constrained, although tool compatibility limits their use. Filesystem restrictions, network egress controls, and seccomp or mandatory access controls address different parts of the environment. No single mechanism resolves every isolation requirement.
An agent that has legitimate directory write access, API permissions, or database query privileges can still use them inside the sandbox. The sandbox permits or denies access to the resource. It cannot tell whether an allowed write, request, or query serves the legitimate task.
How attackers route around sandbox boundaries without breaking them
Prompt injection exploits that distinction by manipulating an agent into misusing its own capabilities. The attacker does not necessarily begin by defeating isolation. Instead, malicious instructions arrive in content the agent reads, and the agent turns those instructions into actions it is permitted to initiate.
Pillar Security publicly disclosed a Google Antigravity vulnerability in April 2026 after reporting it in January 2026. Google patched it on February 28, 2026. Antigravity's highest security setting runs command operations through a virtual sandbox and throttles network access. Even so, the vulnerability let attackers combine prompt injection with file creation that was allowed to gain remote code execution privileges. The critical capability was already available to the agent.
Cursor's two July 2026 flaws worked in a similar way. A single prompt that came through a connected MCP server or a web search result could lead to arbitrary command execution on a developer's machine without a click or approval box. Both flaws induced the agent to write a file it should not write, then used that write to disable the sandbox. Cato Security described the problem as a flaw in the structure.
Across these three vulnerabilities, the initial foothold was an authorized capability rather than a direct breach of the isolation boundary. The distinction remains important even when the resulting action disables sandbox protection. A pre-action guardrail would have had the opportunity to evaluate the semantically wrong file write or out-of-policy command before execution. Whether it stopped the attack would depend on its policy and evaluation.
What runtime guardrails actually intercept
Runtime guardrails sit between proposed actions and execution. They check tool calls, file operations, API requests, and shell commands before those operations reach the environment. Evaluation can cover arguments, policy conformance, earlier actions in the session, and the source of the content prompting the call. Trusted user input and content retrieved from a tool need not receive the same treatment.
The verdict need not be a binary decision. A guardrail can allow the action, reflect feedback to the agent, confirm through human approval, or block execution. These responses let the control match intervention to risk rather than treating every concern as a terminal failure. Checking a generated response is different from controlling whether a tool runs.
LEANGUARD found a 57.9% direct prompt-injection success rate against unguarded agents on DTap and reduced it to a small fraction of that baseline with a verifier between the model and its tools. Its proof-guided repair can find an admissible nearby action without involving the model. That offers a path beyond rejection alone. AgentSpec takes an approach that works alongside this, using a lightweight domain-specific language to set and enforce runtime constraints.
Why prompt-only safety and output-checking are not substitutes for action-level enforcement
A system prompt instructs the model, but it does not independently enforce permission. Tool outputs or retrieved content can pull the agent away from those instructions, and the model can generalize badly in unfamiliar situations. Advice and permission are in the same context window. A policy enforced outside that window does not depend on the model remembering to obey it.
Execution-time governance therefore uses allowlists, denylists, tool permissions, environment constraints, and policy engines in the execution path. Output validation serves a different purpose. The guardrails-ai library guards LLM outputs rather than agent actions, illustrating why the label “guardrail” alone does not establish coverage. Output-checking can catch harmful or sensitive response content, but it is not inherently part of the action decision loop. A filter on what the agent says cannot substitute for enforcement over what it does.
The shadow agent and MCP server inventory problem that sandboxing cannot solve
A sandbox governs activity within a known boundary, but security teams may not know every agent or tool connection operating across the fleet. Undiscovered systems sit outside that protection by definition. Governance therefore requires establishing where execution can occur as well as controlling it.
Shadow MCP brings the risk of running actions as well as the passive data exposure that comes with traditional shadow IT. An overpermissioned MCP server can give an agent direct SQL access to a production database, write access to internal filesystems, and access to external APIs without an audit trail. MCP servers can bind to local ports, run within developer tools, and appear as routine dependencies, evading traditional network monitoring.
Internal data across a large sample of accounts shows that most semantically risky agent tool calls arrive through MCP servers unknown to the security team at the time of the call. Every agent, MCP server, and skill must be inventoried before coverage can be understood. Otherwise, ungoverned connections can bypass both sandboxing and action-level enforcement.
The compliance gap: why sandboxing alone produces no audit trail
An auditor's question extends beyond whether an agent remained contained. It asks what the agent did and whether each action was authorized. Sandbox records describe containment events. They therefore cannot, on their own, supply the action-level evidence needed to demonstrate compliance. Isolation and evidence are separate responsibilities.
The EU AI Act places agents used for applicant screening, credit scoring, insurance pricing, or critical infrastructure within its high-risk framework, bringing event logging, human oversight, and durable audit trail obligations. Articles 19 and 26 require providers and deployers of high-risk AI systems to keep automatically generated logs for at least six months. The AI Omnibus moved the high-risk rules to December 2, 2027 for Annex III systems and August 2, 2028 for Annex I products. Those obligations require more than a record that an environment remained isolated.
KNOX shows what else is needed for compliance-grade attestation. It runs AI workloads inside Trusted Execution Environments and has a reference monitor that checks every action against a policy manifest and records the verdicts in a tamper-resistant execution graph. Hardware isolation alone is not the compliance mechanism. Equally, recording an action does not mean it was prevented. A team without a complete agent inventory also cannot know which systems require high-risk classification.
The operational objection: guardrails add latency and block legitimate work
The strongest objection to guardrails is operational: checks add latency, policies require maintenance, and false positives can interrupt legitimate work. Practitioners who favor tightly scoped sandboxes and strict egress rules are weighing real engineering costs. Sandboxing, session isolation, and cryptographic protections do reduce exploitability. Their benefits are not in dispute.
LEANGUARD's proof-guided repair runs in a median of 2 ms, while AgentSpec reports enforcement overhead in milliseconds. Those results show that action checks can operate without blocking workflows. The engineering can address the performance concern. Policy quality remains a separate task.
False positives depend on how well the rules fit what agents do, and keeping those rules up to date has an ongoing cost. That cost is bounded and predictable in a way that damage from an unchecked destructive action is not. Clear warnings also reduce friction when they explain the violated rule at the point of action, in the terminal or in Slack. Developers can respond to a specific policy violation instead of filing a ticket and waiting for an explanation.
The practical response is a graduated rollout. Audit mode lets teams observe proposed violations before enforcement affects work, and warn mode exposes the rules to developers without immediately blocking actions. Approval and blocking can follow for high-risk action classes once policy has been calibrated against real behavior.
How the two layers fit together in a working governance stack
Sandboxing contains blast radius, protects the host from agent-generated code, and limits resource exhaustion. Runtime guardrails check intent and enforce policy on the actions and action sequences an agent proposes before its tools run. Monitoring provides visibility into operation, while auditing preserves the evidence needed to examine authorization and compliance. Each can fail independently of the others.
The practical rollout begins with an inventory of agents, MCP servers, and skills, then uses the graduated enforcement sequence to establish policy without abruptly gating legitimate work. Verdicts on each action form the basis of an audit record, but teams still have to do the auditing.
Anthropic combines sandboxing with website allowlists for its internal agents while acknowledging that only some agents are sandboxed. The Agent Access Security Broker category, announced in March 2026, addresses the gap between infrastructure isolation and action-level governance by covering discovery, pre-action verdicts, and audit between agents and the systems they touch.
A governance layer that explains a blocked action gives developers a rule they can understand and respond to, rather than leaving them to diagnose a failure after containment has limited the damage. With those responsibilities separated, teams can let agents run further without treating every new capability as a choice between unrestricted access and blanket prohibition.