Skip to content
BriskStack Study
Sign in
Infrastructure Hardening & Sandboxing

Agent identity and control, 2 of 3, about 3 h 21 min of reading

Infrastructure Hardening & Sandboxing

About 3 h 13 min left

Concept. An agent is only as contained as the weakest boundary around it. Guardrails & Semantic FirewallsInjection and guardrails, 4 of 5, about 19.8 h and Bidirectional Defense & Input SanitizationInjection and guardrails, 5 of 5, about 14.2 h cover hardening what the model reads and says. This week hardens what its tools can touch: the filesystem, the network and the host kernel. The governing assumption flips from "trust the agent and filter its inputs" to "assume the agent is already compromised, and make that compromise worthless." That is defense-in-depth for autonomy. Process confinement, least-privilege tool access and network isolation are stacked so that a successful prompt injection lands the attacker in an empty room.

The hard lesson of 2026 is that the boundary keeps losing to confusion (path confusion, parser differentials, time-of-check to time-of-use races), not to brute force. So the engineering goal is not a stronger filter. It is a boundary the kernel enforces and the application cannot talk its way past.

🎯 Objectives

By the end of this unit you can:

  • Rank the 2026 isolation stack (hardened container, gVisor, microVM, kernel-capability sandbox) by isolation strength and boot cost, and say when each is the right call.
  • Explain why language-level sandboxing (Python exec, Pyodide) is structurally unsound, and choose process or VM isolation for untrusted code.
  • Apply least privilege at the tool layer with deny-by-default capabilities instead of blocklists.
  • Walk the dominant sandbox-escape patterns (time-of-check to time-of-use races, path and symlink confusion, parser differentials) and map them to real CVEs.
  • Wire agent egress through an exact-host allowlist and justify it with NIST zero-trust principles.
  • Treat the sandbox product itself as attack surface: an isolation runtime ships the same bug classes (path traversal, command injection, incomplete blocklists) that it exists to stop.
  • (Go deeper) Escape a deliberately misconfigured local container three ways (a mounted Docker socket, --privileged, a writable host path), read a root-only canary as the success signal, and apply the setting that stops each (MITRE ATT&CK T1611 and OWASP).
  • (Go deeper) Say what a serverless platform reuses between invocations and for whom, read the cold-start gap as a side channel, and place the hardware under the function in the threat model (AWS Lambda and arXiv 2601.11664).
Next sectionThe isolation stack: pick your blast radiusabout 2 min

The isolation stack: pick your blast radius

There is no single "sandbox." There is a ladder, and each rung trades startup cost for a smaller blast radius. The decision rule is blunt: the more of the agent's code you did not write, the higher up the ladder you go.

Layer Isolation boundary Boot Escape cost Use when
Hardened container namespaces and cgroups, shared kernel milliseconds one kernel bug trusted, reviewed code only
gVisor user-space kernel services syscalls milliseconds escape the user-space kernel compute-heavy agents, multi-tenant CI
Firecracker microVM dedicated guest kernel and hypervisor about 125 ms break the guest kernel and the VMM production agents running untrusted code
Kata Containers VM-backed, Kubernetes-native about 200 ms hardware-enforced regulated or multi-tenant Kubernetes
nono (Landlock/Seatbelt) kernel capability, deny-by-default milliseconds subvert the kernel Linux security module (LSM) per-tool least privilege on the host

A shared-kernel container is the fast default, but "a kernel vulnerability or misconfiguration can allow container escape, giving attackers host access." Agents generate unpredictable code, so that risk is not hypothetical (Northflank). gVisor closes most of it by putting a user-space kernel between the application and the host. The user-space kernel services the application's syscalls itself and reaches the host only through a small set of its own (gVisor docs). Northflank puts the cost at a 10 to 30% I/O tax and near-zero compute tax (Northflank).

When the code is genuinely untrusted, microVMs give each workload its own kernel behind a hypervisor. Firecracker boots in under 125 ms with under 5 MiB of overhead (Firecracker), so the objection that VMs are heavy no longer holds, and Kata makes the same case for AI workloads (Kata for AI workloads). Baseline container hardening still applies underneath all of it: drop capabilities, use a read-only root filesystem, apply seccomp and run as non-root (Docker security and NIST SP 800-190).

The ladder as a decision, with the hardening that holds under every rung:

flowchart TD
  Q["How much of the agent's code did you not write?<br/>The more, the higher the rung"] --> C["Hardened container: shared kernel,<br/>escape costs one kernel bug;<br/>for reviewed internal automation"]
  C --> G["gVisor: a user-space kernel services syscalls,<br/>10 to 30% I/O overhead (Northflank);<br/>for compute-heavy agents, multi-tenant CI"]
  G --> V["Firecracker microVM: own guest kernel<br/>behind a hypervisor, under 125 ms;<br/>for model-generated or third-party code"]
  V --> K["Kata Containers: VM-backed,<br/>Kubernetes-native, about 200 ms;<br/>for regulated, multi-tenant Kubernetes"]
  N["nono: Landlock or Seatbelt, deny-by-default;<br/>per-tool least privilege on the host"] -.- Q
  B["Under every rung: drop capabilities,<br/>read-only rootfs, seccomp, non-root"] -.- K

πŸ”‘ Match the rung to the trust. Reviewed internal automation belongs in a hardened container and a compute-heavy agent in gVisor. Anything that executes model-generated or third-party code belongs in a microVM. Never run untrusted code one kernel bug away from your host.

Next sectionLanguage-level sandboxing is a trap (Needs access)
Sign in to keep reading. It is free, and your place is kept. Sign in and continue

Language-level sandboxing is a trap

Least privilege at the tool layer

Escapes: the boundary loses to confusion, not force

The sandbox product is software too

Network isolation, zero trust and the incident that skipped both

Go deeper: reconnaissance of exposed AI infrastructure

Go deeper: infrastructure and deployment exploits

Go deeper: escaping a misconfigured container, and the hardening that stops it

βœ… Check yourself

Go deeper: Serverless AI, cold starts, container reuse and what the hardware leaks

πŸ“‡ Sandbox and escape CVE reference

Finish Infrastructure Hardening & Sandboxing

About 3 h 13 min left in this unit.

From memory first

Write the main points of this unit, in your own words.

The unit is done when you have answered the check and marked the required sources.

  1. 1 Check yourself

    Do the check
  2. 2 Required sources

    Go to the sources

Sources in this unit

  • How to Sandbox AI Agents (Northflank)
  • gVisor Documentation
  • nono: Why I Built It
  • JFrog: CVE-2025-9959 Smolagents Sandbox Escape
  • Object-capability SQL CTF ($1K bounty)
  • Anthropic: Zero Trust for AI Agents
  • Docker Security Best Practices
  • NIST SP 800-190: Container Security
  • Kata Containers for AI Workloads
  • agent-airlock
  • nono GitHub
  • Cyera: Claw Chain (cross-reference Workflow & Protocol Hijacking: MCP Deep Dive)
  • Aonan Guan: Claude Code SOCKS5 null-byte sandbox bypass (May 2026)
  • AWS Lambda: Understanding the execution environment lifecycle
  • AWS: Security Overview of AWS Lambda (whitepaper)
  • Wang et al.: Peeking Behind the Curtains of Serverless Platforms (USENIX ATC '18)
  • Pathade et al.: Serverless AI Security: Attack Surface Analysis and Runtime Protection Mechanisms for FaaS-Based Machine Learning (arXiv 2601.11664)
  • Lomet et al.: Side-Channel Extraction of Dataflow AI Accelerator Hardware Parameters (IOLTS 2025)
  • Zero Trust Architecture: NIST SP 800-207
  • Set up Docker network isolation so agents can reach only specific allowlisted endpoints, and verify it with tcpdump. Do this as the egress drill.
  • Cisco: Detecting Exposed LLM Servers: Shodan case study on Ollama
  • AIMap: AI attack-surface discovery tool
  • TryHackMe: AI System Reconnaissance walkthrough
  • Zenity: Scanning for AI: live campaigns mapping exposed LLM backends
  • Hackers-Arise: Reconnaissance on AI Infrastructure
  • Oligo: ShadowRay 2.0 (CVE-2023-48022)
  • Wiz: Breaking NVIDIA Triton (CVE-2025-23319 chain)
  • Wiz: Probllama: Ollama RCE (CVE-2024-37032)
  • Kodem: vLLM multimodal RCE (CVE-2026-22778)
  • OffSec: MLflow LFI (CVE-2024-2928)
  • ZeroPath: Azure ML privesc (CVE-2025-49747)
  • Security Risk Advisors: Privilege escalation in AWS and GCP ML instances
  • CSA: Vertex AI service-agent privilege escalation
  • Microsoft and BleepingComputer: Kubeflow cryptomining on Kubernetes
  • arXiv: Multi-tenant scientific Kubernetes cluster (Falco detection)

Checklist

It does not count toward done.

  • Rank the isolation stack (container, gVisor, microVM, nono) by strength and by boot cost, and name the rung for reviewed internal automation, a compute-heavy agent and model-generated code.
  • Run an AI agent in a Docker and gVisor sandbox with network isolation, and show that a request to an outside host fails.
  • Wire agent egress through an exact-host allowlist and verify with tcpdump that only the allowed host receives traffic.
  • Implement deny-by-default tool access with least privilege, and compare nono with gVisor for the same agent in a short written note.
  • Set up a dual-LLM architecture, with a planner and an executor that have different trust, and show the executor holding no capabilities.
  • Try the object-capability SQL sandboxing $1K capture-the-flag (CTF) challenge and record how far you get.
  • Study CVE-2025-9959 (smolagents) and write one paragraph on why language-level sandboxing fails and why process or WebAssembly (WASM) isolation beats restricting the interpreter.
  • Study the three escape classes (TOCTOU in Claw Chain, path and symlink confusion in Claude Code CVE-2026-39861 and CVE-2026-55607, parser differential in the SOCKS5 null-byte bypass) and match each to its fix.
  • Recon drill: Fingerprint your own lab (Ollama, vLLM and MLflow), list every model and artifact without any exploit, then run the Shodan dork product:"Ollama" and compare what an outsider sees.
  • Infrastructure drill: Chain inference RCE to the metadata service by getting code execution (Ray job submit), calling the 169.254.169.254 metadata endpoint, and confirming you can mint a cloud token.
  • Audit the guard as well as the guest: pin your sandbox runtime's version, track its CVE feed (NVIDIA OpenShell CVE-2026-65093, CVE-2026-65083, CVE-2026-65092 and CVE-2026-65091), and prefer deny-by-default enforcement over a product that ships an enumerated disallow-list.
  • (Go deeper) Deploy a minimal inference function, prove reuse with a token in /tmp and a global across thirty invocations, plot cold against warm latency, record what the instance-ID and 2018 cgroup host checks return today from a second function, and write the three lines that stop the token travelling.
Part, planned

Stop planted text from persisting in an agent's memory and driving a later leak

Attack: Plant text that persists in an agent's memory and drives a later leak. Defend: Keep untrusted input out of memory, or refuse what is built from memory a document wrote.

Nothing to do here yet; the unit is complete without it.

Practise this in the lab, Stop an injected agent from leaking data through its tools.35 min to 1 h 10 min estimate

Practise this in the lab, Output read back from memory reaches a sink.50 min estimate

Practise this in the lab, Capstone: one engagement, replayable findings and a scope log.1 h 40 min estimate

Study notes

None yet

Sign in to take notes.

More for this unit

42 readings

Readings no section cites. They do not count toward the unit.

Show
AI-specific sandboxing2 readings
  • github.comtoolGo deeper

    A tool for the tool-call path: it validates calls, strips ghost arguments, masks personally identifiable information (PII), enforces role-based access control (RBAC) and guards Model Context Protocol (MCP) STDIO transports. Read the code to see what an argument-level guard looks like.

  • github.comtoolGo deeper

    A Rust sandbox with built-in profiles for Claude Code, credential injection and atomic rollbacks. Use it for the deny-by-default drill.

Sandbox escape CVE studies2 readings
  • cyera.compaperGo deeperabout 30 min

    Cyera details four chainable OpenClaw CVEs, two of them time-of-check to time-of-use (TOCTOU) races in the sandbox's read and write paths. The chapter reads them as the first escape class, and that general lesson is the course's reading, not Cyera's. Read it for the first escape class.

  • oddguan.compaperGo deeperabout 25 min

    A parser differential: a JavaScript endsWith() allowlist treats \x00 as an ordinary character, while libc getaddrinfo() truncates there, so evil.com\x00.google.com resolves evil.com. It affected v2.0.24 to v2.1.89 and was fixed in sandbox-runtime 0.0.43; a Claude Code on v2.1.183 is patched. The lesson is that exact-host allowlists beat wildcards.

Go deeper: Serverless AI and hardware side channels3 readings
Network isolation and zero trust2 readings
  • csrc.nist.govpaperGo deeper

    The zero-trust standard behind the egress rule. Read it to apply the same principles to an agent's network access.

  • Set up Docker network isolation so agents can reach only specific allowlisted endpoints, and verify it with tcpdump. Do this as the egress drill.

    labGo deeper
AI infrastructure reconnaissance5 readings
  • blogs.cisco.compaperGo deeper

    Cisco shows a real Shodan methodology (port:11434 "Ollama"), the layering of banners and the scale of exposure. Read it before the reconnaissance drill.

  • helpnetsecurity.comtoolGo deeper

    AIMap ships 32 preset Shodan queries, protocol fingerprinting and authorized attack tests across Ollama, vLLM, MCP and Text Generation Inference (TGI). Read it to see the whole reconnaissance chain automated.

  • medium.comlabGo deeper

    A hands-on walkthrough of a five-phase methodology, including enumeration of the MLflow, Triton, Jupyter and vector-database APIs. Follow it for the active enumeration step.

  • labs.zenity.iopaperGo deeper

    Zenity's honeypot data shows real-world reconnaissance against AI-specific discovery surfaces. Read it to see how fast exposure is found.

  • hackers-arise.compaperGo deeper

    An offensive port map and the fingerprinting chain for AI model servers. Use it beside the port table in the chapter.

Model-server and inference-engine exploits5 readings
  • oligo.securitypaperGo deeper

    Oligo describes how an unauthenticated Ray Jobs API remote code execution (RCE) flaw became a self-propagating botnet, the flagship AI-infrastructure exploit. Read it first among the model-server exploits.

  • wiz.iopaperGo deeper

    Wiz chains an information leak into an unauthenticated RCE against the Triton Python backend. Read it as the example of a small leak becoming a total compromise.

  • wiz.iopaperGo deeper

    A path-traversal RCE in the model pull, with a roundup of inference-server exposure risk. Read it for the Ollama exploit and the wider picture.

  • kodemsecurity.compaperGo deeper

    A video_url reaches a libopenjp2 JPEG2000 cdef heap overflow, with a leak that defeats address space layout randomization (ASLR). It also covers the torch.load() deserialization RCE pattern. Read it for the memory-corruption case.

  • offsec.compaperGo deeper

    A URI-fragment path traversal gives unauthenticated arbitrary file read on exposed tracking servers. Read it for the MLflow case.

Cloud AI platform and containerized ML exploits5 readings
πŸ“‘ From the Resources feed18 readings
  • en.cryptonomist.chreferenceGo deeper

    an open-source defensive wrapper combining per-conversation Tor circuits, local prompt rewriting, and bwrap/torsocks sandboxing (plus anonymous zkAPI payments) to constrain what an agent can reach and reveal β€” a concrete layered-isolation example (with stated traffic-analysis limits) for the sandboxing ladder

  • wiz.iopaperGo deeper

    honeypots on LiteLLM/Flowise/LangChain/Langflow/ChromaDB/Ollama show sustained real attacks: MCP auth-bypass + command-injection CVEs (-59822 / -42271) dropping cryptominers, blind prompt injection confirmed via DNS callback, and AI-native post-exploitation querying running Python processes to pull LiteLLM master keys straight from memory. The in-wild companion to the Zenity recon honeypot.

  • github.comtoolGo deeper

    MCP server + CLI that statically analyzes app code (Python/Go/TS/JS/Java, or a Terraform plan) to generate baseline least-privilege IAM policies for AI coding assistants β€” deterministic analysis, not LLM guesswork β€” so agent-generated infra ships tight permissions by default; Apache-2.0, ~439β˜…, v0.3.0, actively maintained

  • nvd.nist.govreferenceGo deeper

    Zip-Slip-class flaw in darwin-init, the root process that boots Apple's confidential AI-inference nodes; $150K bounty β€” even hardened AI-serving infra ships classic path bugs

  • cve.threatint.compaperGo deeper

    two CVSS 9.9 flaws in NVIDIA's agent-sandbox runtime (published 25 August). CVE-2026-65093 breaks out of the Linux sandbox, allowing code execution, privilege escalation and data tampering. CVE-2026-65083 provisions an incomplete disallow-list, so blocked operations slip through. There are also CVE-2026-65092 (path-traversal bypass, 8.5) and CVE-2026-65091 (OS command injection). The lesson is that an agent-sandbox product is still ordinary software with ordinary bugs (command injection, path traversal, authentication bypass), and those are the most exploitable failure modes, so the isolation boundary itself needs the same scrutiny as what it contains.

  • endorlabs.comreferenceGo deeper

    TOCTOU type confusion in ExternalCopy's transferList handling lets a getter swap a validated ArrayBuffer for an attacker-controlled pointer between check and use — guest-to-host escape (DoS→control-flow hijack/RCE) in the sandbox used by n8n/Mastra/Sim.ai and other agent frameworks; the V8 isolate held, the native marshalling glue didn't (fix 7.0.1/6.2.0) — concrete proof of this week's "language-level sandboxing is a trap" thesis

  • blog.trailofbits.compaperGo deeper

    GPT 5.6-Cyber chained three 0-days across QEMU/KVM/libslirp (plus a patched-but-undeployed flaw) to reliably escape a hardened VM; the isolation-ladder argument pushed to its top rung β€” a cyber-capable agent inside the guest is an untrusted local attacker, so contain it with APT-class controls (Firecracker/microVM, least-privilege, short-lived disposable environments), not a VM boundary alone

  • aikido.devreferenceGo deeper

    three linked kernel page-cache write bugs (IPsec ESP / RxRPC) let a low-priv local attacker corrupt a privileged read-only file's cached copy and escalate to root, with a container node-escape path when the host kernel is unpatched β€” the reminder that a compromised AI workload sharing an unpatched host kernel breaks the isolation boundary from below, so patch the host, not just the sandbox

  • depthfirst.comreferenceGo deeper

    an AF_UNIX GC use-after-free (race between SCM_RIGHTS edge visibility and vertex freeing) leaves a freed pointer in a cache ring β†’ dereferenced on a later GC cycle; found by their in-house AI model dfs-large1, used to win a Google kernelCTF slot (Jul-24), patched upstream Aug-6 but still unpatched in the latest Ubuntu 26.04 at disclosure β€” working container-escape exploit released for 26.04 and 24.04 (CVE-2026-52910). The top-rung restatement of the week's thesis, now with AI as the bug-finder: shared-kernel containers (Docker/K8s/nsjail/Firejail/Bubblewrap) aren't a hard boundary β€” move sensitive workloads to microVM isolation (Firecracker/Kata). Next to Trail of Bits "VMs Won't Contain Agents" + Dirty Frag

  • endorlabs.comreferenceGo deeper

    an AI agent escapes brig's sandbox by planting a symlink inside its project mount that points to a host directory it was never given; on a later run the operator's own directory mount follows the link, handing the agent read/write to arbitrary host files (SSH keys, cloud creds) β€” a cross-run TOCTOU/path-confusion escape in an agent-isolation tool, fixed in brig 0.3.0. Reinforces the week's "canonicalize the path, don't trust the mount" rule at the sandbox boundary

  • github.comtoolGo deeper

    Apache-2.0 (10.7kβ˜…, actively maintained) kernel-enforced sandbox + policy engine that gates exactly what an agent fleet may touch (files, syscalls, network, credentials) rather than granting host-wide access β€” a production-grade instance of this week's least-privilege isolation ladder.

  • endorlabs.comreferenceGo deeper

    technical primer comparing VM/container/runtime sandbox boundaries and their real escapes, then reframing AI-agent containment as policy-based action control around Willison's lethal trifecta (filesystem scoping, egress allowlists, credential scoping) β€” the conceptual map behind this week's isolation ladder

  • arxiv.orgpaperGo deeper

    a phase-aware GPU side-channel that reads sparse-attention memory-access patterns during inference to recover private queries and responses on a shared GPU β€” a hardware-isolation gap for multi-tenant model serving

  • endorlabs.comreferenceGo deeper

    Endor Labs defines an agent sandbox as a kernel-enforced boundary on tool-call syscalls that the agent cannot modify from within, which is neither a staging environment nor a plain container. It walks the operating-system primitives that Claude Code, Cursor and Codex CLI converged on (macOS Seatbelt, Linux Landlock and seccomp, Windows Job Objects and AppContainer) over subprocess trees, and it uses the nx/s1ngularity supply-chain attack as motivation. Its argument is that filesystem isolation and network-egress isolation are worthless unless enforced together: lock one and a compromised agent still exfiltrates files, or escapes and reaches the network. Documented escapes trace to allowlist and configuration hygiene, not broken kernel enforcement, which maps directly onto an always-on Claude Code agent on a VPS. (October 7 daily pulse)

  • arxiv.orgpaperGo deeper

    operationalizes NIST SP 800-207 through a RAG-backed multi-agent pipeline that routes each access request through specialized reasoning agents, reporting 95.0% accuracy / 93.9% precision / 96.3% recall on a testbed β€” an AI-driven take on the zero-trust access-control layer this week builds

  • github.comtoolGo deeper

    Microsoft's sandboxed code-execution system has pluggable containment backends that span the isolation ladder this week teaches, from operating-system-native ones (Windows Sandbox, LXC, Bubblewrap, Seatbelt) up to full VMs (Nanvix MicroVM, Hyperlight). It has a unified JSON policy model for filesystem, network and UI access controls, Rust, .NET and Node SDKs, and audit-mode and access-denied diagnostics for tuning the containment of agentic workloads. It is a first-party instance of running model or agent output in a real sandbox and scoping it with policy. (October 9 daily pulse)

  • tldrsec.comreferenceGo deeper

    GTIG data (AI-found vulns skew higher-impact, 50% RCE) plus Vercel/Perplexity AI-sandbox-escape tests where agents bypassed network limits via DNS spoofing and IP-sharing

  • arxiv.orgpaperGo deeper

    a TDC-sensor power side-channel on a multi-tenant FPGA reconstructs full-color ImageNet-scale inputs from a co-located CNN accelerator, and a fixed pixel-substitution defense is defeated by retraining β€” shared accelerators are an isolation boundary, not a privacy one; defenses must be randomized/input-dependent

This unit's library holds 54 more readings for readers with access.