Articles

Sandboxing, isolation and privilege separation

Isolation bounds what an agent can reach; privilege separation bounds what it may do.

Reading: 4 minAutomation & AI

Article cover: Sandboxing, isolation and privilege separation

An agent that calls tools runs with someone else’s credentials, and the text it reads is not written by you. Three words describe the controls that keep that from becoming an incident — and they are usually treated as one. A sandbox is the runtime the model and its tools are confined to; the allied deployment guidance states the whole idea in one line, calling for “sandboxing the environment running ML models within hardened containers or virtual machines (VMs)”. Isolation is what a boundary keeps apart. Privilege separation is how much authority each separated part is allowed.

The idea to keep is blunt: a model cannot enforce its own limits. Its output is untrusted data, and the boundary that contains it must live in code the model does not control.

Three boundaries, not one

Separate the three words by the question each answers.

  • Sandbox — what can it reach? The runtime boundary: filesystem, network, devices, other processes. The container or VM is the box; the hardening is what it denies by default.
  • Isolation — what must not mix? Keeping components apart that would corrupt each other: planning away from untrusted content, and high-value assets away from everything else. The same guidance applies it to the most valuable artefact of all — model weights — instructing defenders to “Aggressively isolate weight storage”.
  • Privilege separation — how much may each part do? Every component gets the least authority it needs, and no component holds authority another component is supposed to hold alone.

The controls reinforce each other but are not interchangeable: a process can sit in a hardened container and still be handed a credential that opens the whole estate.

The box, and what happens before the box

The sandbox is a runtime decision. The guidance pairs it with a pre-deployment habit that is easy to skip: never treat a downloaded model as safe code. “Do not run models right away in the enterprise environment”, it warns; inspect imported pre-trained models “inside a secure development zone” before trusting them.

That instruction is the sandbox idea before the runtime starts. Weights and loading code are software from someone else’s supply chain; the development zone is a box big enough to open the package in. Once the model is trusted, the runtime box limits the damage if that trust was misplaced.

Privilege separation inside a single agent

Separation is not only between the agent and the operating system. It can run inside one agent, between the model that plans and the model that reads.

The CaMeL defence, from the paper Defeating Prompt Injections by Design, builds on a pattern that “employs two LLMs: a Privileged LLM and a Quarantined LLM.” The privileged model sees the request and plans the actions; the quarantined model handles the untrusted material — file contents, web pages, tool output. Crucially, that second model “is stripped of any tool-calling capabilities”. The split is the security property: the component with tools never sees attacker-controlled text, and the component that reads attacker-controlled text cannot call anything. Neither half is dangerous alone.

Why the boundary must live outside the model

The guarantee collapses if the model is asked to police itself. The OWASP guidance is explicit that “Critical controls such as privilege separation, authorization bounds checks, and similar” must not be delegated “to the LLM, either through the system prompt or otherwise”, and that they must instead run “in a deterministic, auditable manner”. A system-prompt instruction is text the model may follow; it is not a boundary.

The same source gives the authority-side rule: “Limit the permissions that LLM extensions are granted to other systems to the minimum necessary in order to limit the scope of undesirable actions”, enforced at the downstream system. The deployment guidance agrees, telling operators to enforce access controls “employing the concepts of least privilege and defense-in-depth”. Privilege separation done properly is a property of the hooks around the model — never a hope about the model.

What isolation does not solve

Containment bounds reach; it does not produce intent. The CaMeL authors are careful about their own guarantee: even with the two-model split, “while the control flow is protected by the Dual LLM pattern, the data flow can still be manipulated.” Isolating the planner keeps the plan intact, but a poisoned value can still travel through it as a sabotaged argument. A box that limits where a process may reach says nothing about whether its arguments are sound.

So isolation is a floor, not a ceiling: it reduces blast radius and removes whole classes of failure, but it sits underneath the other controls — allow-lists, validation, approval — and does not replace them.

Level and prerequisites. L4 — the technical-security level of the area: it assumes the reader knows what an agent loop, a tool call and a permission are, and asks how the runtime and the authority around them are structured. Prerequisites: the L1–L3 sheets of this area (the model as a text generator, tool calling, retrieval and untrusted input) and, in this batch, the sheets on excessive agency and on separating the model, orchestrator and tool executor.

Where to go next

References

  • NSA/CISA and allied agencies — Deploying AI Systems Securely — sandboxing in hardened containers or VMs, the secure development zone, weight isolation, and least privilege.
  • Debenedetti et al. — Defeating Prompt Injections by Design (CaMeL) — the privileged/quarantined model split, capability-based control, and the control-flow/data-flow distinction.
  • OWASP — Top 10 for LLM Applications (LLM06 Excessive Agency) — privilege separation enforced outside the model, extension permissions, and least privilege.
Nodrius Field Kit — cover

Get the Nodrius Field Kit

Enter your email and we'll send you the complete Field Kit: eight technical resources in one download.

Your email address is sent to Nodrius and used to deliver the Field Kit to you by email. Marketing messages are separate and optional: the checkbox does not affect your download, and you are only added to our updates list if you tick it. Privacy Policy.

Privacy & cookies

This site does not use cookies, analytics or tracking, and it does not profile you. There is nothing technical to switch off, so Accept and Reject change nothing about how the site works: either choice lets you browse everything normally.

The only difference is what your browser remembers: two entries in local storage — your choice here, so this notice is not shown again, and a marker that the Field Kit offer has already been made — so the offer is presented once and not on every page. They contain no identifier, they are not shared with anyone, and the site sets no cookie for either.

What we do with your data
How your email address is used when you ask for a Resource, how long it is kept and which rights you have — in the Privacy Policy.
What the site stores in your browser
Two entries in local storage — your choice on this notice and whether the Field Kit offer has been shown — and no cookies, no session storage, no third-party content: in the Cookie Policy.