Infrastructure Review Stack

Zero Trust vs Least Privilege in Sandbox Security Models

Zero trust is architecture; least privilege is one mechanism it requires.

Contributing Editor · · 12 min read
Cover illustration for “Zero Trust vs Least Privilege in Sandbox Security Models”
Secure Isolation Primitives · September 23, 2026 · 12 min read · 2,692 words

Zero trust and least privilege get treated as synonyms in most conversations about AI agent security, and that habit causes real damage. They sit at different levels: zero trust is the architectural posture, the assumption that no actor gets trusted by default, no matter where it sits on the network. Least privilege is one enforcement mechanism that posture demands, a rule about scoping what an already-authenticated actor can touch. Confusing the two leads teams to build a sandbox with a gate at the front door and nothing behind it, when the actual job is enforcement at every layer an agent touches, continuously.

NIST SP 800-207 lays this out with more precision than most vendor material bothers to. Zero trust is defined through seven architectural tenets built to strip out uncertainty when enforcing per-request access decisions across a network that has to be treated as already compromised. Least privilege is one of those seven tenets, not a rival philosophy standing next to zero trust but a specific mechanism zero trust requires. A gate asks one question, once: should this actor be here? Zero trust keeps asking that question at the function level, not just at the perimeter. Checking someone's badge at the building entrance happens once. Checking whether they're cleared for the specific file cabinet they're standing in front of happens every time they reach for a drawer.

That gap matters more for AI agents than it ever did for human users. Why matters before getting into what a sandbox actually has to enforce.

Identity for an AI agent versus a human user

Traditional zero trust got built around a human at a keyboard: authenticate the user, check the device, apply least-privilege rules to whatever resource they're asking for. That model assumes a human pace, a human decision loop, and a human's rough predictability about what they'll click next.

None of that holds once the actor is an agent. An agent can authenticate correctly, carry perfectly valid credentials, and still cause damage through completely ordinary operation, because it has reach into resources that have nothing to do with the task it was actually given. Agents chain tool calls and API requests at machine speed, with no human approving each step along the way. And the paths an agent takes through a task are partly non-deterministic: a multi-step job can lead it to touch a resource nobody who built the thing ever anticipated.

Consider the scale gap directly. A person reads one email at a time, maybe a few dozen across a working day. Handing an agent the same inbox lets it query thousands of messages in seconds. The permission model on paper looks unchanged, same scopes, same grants, but the exposure isn't close to the same. Volume changes the risk calculus even when nobody touched the rules.

The control layers built for the old world don't cover this one. IAM, PAM, and network security each own a slice of the problem, but none of them watches an agent string together dozens of API calls across a single session. Agent risk concentrates exactly in the seams between those three layers, because nothing is looking there.

How the attack surface of an AI agent expands

Most of this traces back to one structural habit: overprivileged connectors. In a lot of organizations, agents run on full-scope tokens and standing service accounts because that was the path of least resistance when someone wired the integration together. Nobody sat down and scoped it on purpose. It just piled up over time, and that pile is where the real exposure lives.

A handful of attack vectors appear specifically in agentic workflows, with no clean equivalent in traditional application security. Prompt injection buries malicious instructions inside content an agent retrieves later, a shared document, a support ticket, an email thread, or an entry in a RAG knowledge base. The agent treats that content as legitimate context, because it has no built-in way to flag embedded instructions as adversarial. Data poisoning works the same trick at the corpus level. An attacker seeds a vector database or retrieval index with content built to warp the agent's reasoning on some future query, long after the poisoning actually happened.

Giving an agent write access to a ticketing system, a deployment pipeline, or a business application makes an injected instruction stop being theoretical. It becomes a ticket that gets filed, a deploy that gets triggered, a record that gets quietly altered. Tool abuse plus corpus poisoning is what turns a clever prompt into a real incident.

The July 2026 Hugging Face and OpenAI incident shows what happens when these vectors chain. Hugging Face disclosed it on July 16th; OpenAI confirmed it five days later. An attacker found a zero-day in a self-hosted Artifactory package registry cache proxy, the component handling sandbox internet access, then chained additional vulnerabilities inside Hugging Face's dataset infrastructure. An agent traversed the compromised environment and harvested cloud credentials along the way. Three separate weaknesses lined up in sequence, each one opening the door to the next.

Blast radius is the term that ties this together: how much damage a compromised or manipulated agent can actually do. It comes down to three things: how many systems the agent can reach, how much data it can touch, and whether it holds write access anywhere. An agent with read-only access to one project's files has a small blast radius. An agent holding a standing token with write access across a shared platform has a large one, whether or not it ever actually gets compromised.

Adoption isn't waiting for security teams to catch up, either. AI transaction volume grew 83.3% year over year, and the agents driving that growth are already sitting inside enterprise environments. Governance hasn't kept pace with adoption, and the sections below map that gap.

Zero trust architecture applied to an agent sandbox

The enclave is the structural answer, a trust boundary containing a sandboxed agent, the specific assets it's cleared to touch, and the tools scoped to whatever unit of work it's doing right now. Nothing outside that boundary is reachable from inside it, by design, not by policy.

That distinction, design versus policy, is the whole argument. Prompt-layer controls tell an agent what it shouldn't do. That's a request, not a constraint, and a good enough prompt injection can talk an agent out of following it. An enclave enforces what the agent cannot reach, full stop, at the network layer, where the agent has zero visibility and zero say in the outcome. A compromised agent, a prompt-injected agent, a simply broken agent: none of them can exfiltrate an asset that isn't network-reachable from inside their enclave. It doesn't matter how convincing the injected instruction sounds if there's no route to the target.

NIST's three zero trust principles map onto sandbox design fairly directly. Verify explicitly means every agent authenticates before it touches anything, tied to a unique agent identity rather than a shared API key passed around between services, and that authentication has to run continuously rather than as a one-time handshake, because an agent's behavior can shift mid-task the moment it processes retrieved content that changes its next move. Enforce least privilege at the project boundary means a coding agent working on one project gets that project's files and its approved endpoints, and nothing from a second project even when the same team owns both. Assume breach means sandbox design has to shrink blast radius before an agent ever touches production, because containment is what's left once detection fails, and detection does fail sometimes.

Inside the enclave, the network controls follow a fairly consistent pattern. Block all outbound connections by default, then allowlist only what the task actually needs. Restrict DNS resolution too, since open DNS is a common channel for both discovery attacks and command-and-control traffic. Keep the agent's network fully separate from production systems and any sensitive data store outside its assigned task.

How isolation technology determines where least privilege can be enforced

Weak isolation undermines every policy sitting above it, and this is where a lot of sandbox builds quietly fail. Standard containers share the host kernel. A kernel vulnerability, or even a plain misconfiguration, can let a process climb out of the container. NIST's own guidance says containers don't offer as clean a security boundary as virtual machines, precisely because of that shared kernel. For AI-generated code, code nobody wrote by hand and nobody fully vetted before it runs, that's a real gap, not a theoretical one.

The isolation options on the market today sit on a spectrum, and each one sets a hard ceiling on how far least privilege can actually reach, no matter how carefully the policy layer above it gets written.

Standard Docker containers give process-level isolation with millisecond startup times. Fast, but least privilege here rests on policy alone, with no kernel boundary backing it up. Fine for trusted, vetted code. Not fine for something an LLM wrote five seconds ago off a user prompt, which is exactly the case most agent sandboxes need to handle.

gVisor runs a user-space kernel that intercepts syscalls before they reach the host kernel, cutting the kernel attack surface down substantially at the cost of some I/O overhead. Least privilege here gets enforced at the syscall level: stronger than a plain container, short of a full VM. Northflank, among other platforms, uses gVisor for workloads where that tradeoff makes sense.

Firecracker microVMs give each workload its own dedicated kernel, fully split from the host, so an attacker has to break both the guest kernel and the hypervisor to get anywhere useful. Firecracker boots in under 125 milliseconds, fast enough that the isolation gain barely costs any latency. Least privilege gets enforced at the hardware boundary itself. Vercel runs on this model.

Kata Containers takes a different road to a similar place: OCI-compatible, backed by Cloud Hypervisor, delivering microVM isolation through standard container APIs, Kubernetes-native from the start. Hardware-level isolation wrapped in a container workflow matters for teams that don't want to rip out existing tooling just to get the separation guarantees of a virtual machine. Northflank runs Kata Containers with Cloud Hypervisor as its primary isolation model, Firecracker as a secondary option, and reports over 2 million isolated workloads processed monthly, with a benchmarked median time-to-interactive of 97 milliseconds.

V8 isolates and WebAssembly cover a narrower case: speed and density for JavaScript-specific tool execution. WASI 0.2 is stable now and gives fine-grained capability control suited to agent tool-calling specifically. Cloudflare Sandboxes became available as a platform option for JavaScript-specific workloads.

Most teams get it backwards: they assume faster isolation means weaker isolation, and default to plain containers because the latency numbers look better on a slide. That assumption doesn't hold up. Firecracker boots in under 125 milliseconds. Kata Containers hits 97 milliseconds median time-to-interactive at Northflank's own reported scale. Hardware-grade isolation is the fast option now. The real cost of picking microVMs over containers is operational complexity, not speed, and that's a very different tradeoff than the one most teams think they're making when they reach for Docker by default.

None of these isolation models eliminates risk. What they do is raise the cost of a successful compromise, a smaller and more honest claim than most vendors make.

Enforcement doesn't have to stop at the isolation boundary, either. ActPlane enforces agent action policies inside the kernel itself using eBPF, catching execution paths that tool-call guardrails never see, at low runtime overhead. Least privilege enforcement can reach below the application layer entirely, into the kernel, and that's a different kind of guarantee than a policy check sitting at the API gateway.

Diagram: Isolation Technology Spectrum: Speed vs. Boundary Strength. Visualizes: Visualize a ranked spectrum of isolation technologies from weakest-to-strongest kernel boundary, showing that startup latency does not increase with isolation strength…

What least privilege requires beyond the isolation boundary

A strong kernel boundary is necessary. It isn't the whole job. Isolation limits how far damage spreads once something goes wrong. It places no limits on what an agent is allowed to attempt. A sandbox with hardware-grade isolation can still contain an agent handed a full-scope token, and that agent will use every bit of that scope the moment something asks it to, whether the request came from a legitimate task or an injected instruction hiding in a retrieved document.

So the scoping has to happen at the function level and the domain level. Allowlists are capability grants, not simple address filters. What matters is which functions an agent can call, not which network destinations it can technically reach. A coding agent assigned to one project needs that project's design files and its approved endpoints. It doesn't need a second project's assets just because the same team happens to own both repositories.

Inside the sandbox boundary, that scoping is visible as several layers stacked on each other. Filesystem access gets restricted to the working directory of the assigned task, with no visibility into adjacent agent directories or host paths. Tool and API access gets explicitly enumerated: permitted calls listed one by one, everything else denied by default. Network egress follows the same logic: block all outbound traffic, then allowlist only the endpoints the task genuinely needs. Resource limits cap CPU, memory, and execution time, which matters less for stopping injection attacks and more for stopping a runaway agent or a resource-exhaustion attack from taking down shared infrastructure.

Credentials deserve a layer of their own, separate from everything above. The Agyn architecture, associated with arXiv:2605.27575,5, answers this through sidecar isolation: the process actually driving the LLM never holds the secrets the MCP sidecar uses to talk to external services. Secrets get injected only into the specific container or process that needs them, and nowhere else. A fully compromised agent process still has nothing worth stealing.

What a complete sandbox security model requires in practice

Diagram: The Five Layers of a Complete Agent Sandbox. Visualizes: Visualize a stacked five-layer model showing how agent sandbox security is built up, where each layer covers a threat the one below it cannot.

All of this stacks, layer on layer, and each one covers a threat the layer beneath it can't touch by itself. The order isn't arbitrary.

The first layer sets the isolation boundary, chosen to match the actual threat: microVMs handle untrusted AI-generated code running in multi-tenant production, gVisor covers compute-heavy workloads where full VM overhead costs more than it buys, and plain containers get reserved for code that's already trusted and vetted. Layer two is identity and authentication: a unique identity per agent instead of a shared key, authentication tied continuously to runtime context instead of checked once at the handshake. Layer three is least privilege scoping itself, permissions cut down to the specific project and task across filesystem, tool calls, network egress, and credentials, with explicit allowlists and default-deny everywhere else.

Layer four is runtime behavioral supervision: watching what the agent actually does while it runs, every syscall, every credential pull, every tool call that looks out of place, enforced at the kernel or function level rather than only at the conversation layer where a prompt-based guardrail lives. Layer five is auditability: logs granular enough to tell agent activity apart from human activity inside the same system.

That last point isn't a minor operational footnote. A study from the Cloud Security Alliance and Aembit found that 68% of organizations cannot make that distinction in their own logs. Well over half the industry has no real forensic trail once an incident actually happens. The event gets logged. The logs just can't say who, or what, did it.

There's a rough test buried in all of this for whether a deployment is actually production-ready, or just dressed up to look like one. If the answer to a question about session state, credential handling, or approval workflows comes back as "the prompt tells the agent to be careful," that isn't a production system. That's a demo wearing production clothes, and whoever is reviewing it should say so out loud, before an incident says it for them.

a large share of companies plan to deploy AI agents in some form, and plenty of them will get there by retrofitting standard containers or developer sandboxes that were never built for this kind of workload. That retrofit leaves exactly the structural gaps walked through above, one layer at a time. Purpose-built agent sandbox platforms treat isolation, least privilege scoping, statefulness, and compliance as decisions made together, up front, not features bolted on after the first incident forces the issue.

Sources

  1. How to sandbox AI agents in 2026: MicroVMs, gVisor & isolation strategies | Blog — Northflank
  2. How to Establish Least-Privilege for AI Agents and Assistants
  3. Zero Trust Architecture for Agentic AI
  4. arxiv.org

More in Secure Isolation Primitives