Skip to content
Sandbox vs guardrails

Two ways to stop an AI agent doing damage: lock it in a box, or guard the machine it works on.

The whole point of an AI agent is that it can touch real systems: your repos, your servers, your data. Lock it in a disposable VM and it is perfectly safe, and cut off from the work you hired it for. Runtime guardrails take the other path: let the agent work on the real machine, and enforce the rules below it, in the kernel on Linux, where a compromised agent cannot reach.

Sandbox vs guardrails
What it protects
SandboxEverything outside the box
WardenThe real machine, while it works
Agent usefulness
SandboxLimited to what you copy in
WardenFull: real repos, servers, data
Escape risk
SandboxOne bug and nothing is behind it
WardenOn Linux, enforced in the kernel, below the process
When it fails
SandboxSilently: the job just does not get done
WardenLoudly: a denied action, logged and attributed

Same trade, four dimensions. The full table is below.

Side by side

The trade, dimension by dimension.

DimensionSandboxRuntime guardrails
What it protectsEverything outside the box, by keeping the agent away from itThe real machine the agent works on, while it works
Agent usefulnessLimited to what you copy into the boxFull: real repos, real servers, real data
Escape riskSandbox escapes exist; one bug and there is nothing behind itNo second boundary to break out of: on Linux the rules are enforced in the kernel, below the process
When it failsSilently: the agent simply can't do the job you wantedLoudly: a denied action, logged and attributed
Best forRunning untrusted code you never want near productionAgents doing real work on infrastructure you care about
When to use which

Both are real tools. The job decides.

When a sandbox is the right call

Honestly: sometimes. Running code from strangers, evaluating untrusted models, CI for pull requests you haven't read, put that in a box and burn the box. If the work never needed to touch real systems, isolation is free safety. Use it.

When you need guardrails instead

The moment the agent's job description includes your actual infrastructure: deploying, operating, fixing, shipping. Then the box defeats the purpose, and the safety layer has to move below the agent: screened actions, kernel enforcement on Linux, and an audit trail of everything it did.

Short answers

Guardrails, filters and sandboxes, answered briefly.

AI agent guardrails vs prompt filters vs sandboxing: what is the difference?
A prompt filter is a rule inside the model's context, so a poisoned file, web page or tool result can talk the agent out of it. A sandbox keeps the agent away from real systems: safe, and also cut off from the work. A runtime guardrail sits outside the agent on the real machine, screens each action before it runs and, on Linux, enforces the rules in the kernel. Use a sandbox for untrusted code, a runtime guardrail for agents that work on real infrastructure, and keep prompt rules for the happy path.
Which isolated runtime is safest for AI agent development?
A container shares the host kernel, so one kernel bug can let the agent out. A microVM or a full VM has its own kernel and a smaller escape surface. Each one protects only what stays outside the box. Once the agent's job is to work on real repos and servers, the box defeats the purpose, and the control has to sit on that machine, below the agent.
Get started

Keep the agent on the real machine. Move the rules below it.

InnerWarden is the second path, self-hosted, with the free Community core (inner-warden, Apache-2.0), installed in one command. Read the thesis in Runtime guardrails, not prompt guardrails or see what a hijacked agent's day looks like in What happens when an AI agent gets hacked.

The rules below the agent
  • workFull usefulness: real repos, real servers, real data.
  • kernelOn Linux, the rules are enforced in the kernel, below the process.
  • denyWhen it fails, it fails loudly: a denied action, logged and attributed.