← All questionsRisingSecurity
How do we run untrusted code or agents safely in a sandbox?
You are not the only one. Asked 18 times since June 2026, 12 of them in the last 4 weeks.
Times asked per week
9 Sept – 1 Dec
Week of 9 SeptTimes asked0Week of 16 SeptTimes asked02Week of 23 SeptTimes asked2Week of 30 SeptTimes asked0Week of 7 OctTimes asked0Week of 14 OctTimes asked0Week of 21 OctTimes asked02Week of 28 OctTimes asked2Week of 4 NovTimes asked03Week of 11 NovTimes asked31Week of 18 NovTimes asked18Week of 25 NovTimes asked8
Week of 9 SeptWeek of 25 Nov
Coloured columns are the last 4 weeks.
What people answer
- One saysKeep the agent outside and run only the code it produces inside a dedicated sandbox (a VM or container) that exposes a small localhost API.
- One saysLimit network access with an HTTP/HTTPS allow-list proxy, and swap in credentials at the proxy so the sandboxed code never holds real secrets.
- Some sayNo sandbox is airtight: VM escapes such as QEMU guest-to-host bugs turn up now and then, and passing through GPUs or other hardware greatly widens the attack surface.
- Some sayStatic analysis can catch exploits of known bugs but can't catch unknown ones, so use it only as one layer of defense in depth.
- Some sayIsolation can still leak through shared infrastructure, for example agents on one inference server passing messages through kernel-selection or KV-cache side channels. A capable model may also work to escape, and a hand-built harness may end up less secure than an off-the-shelf one.
QEMUexternal-sandbox-v86external-sandbox-containerexternal-sandbox-quicksandAlpine LinuxApple Containers
A language model summarised 7 public replies and posts. Views are mixed. These are other people's views, not advice from Navigara.
What people asked
Each line is our one-sentence summary. The link opens the original discussion.
- Does CrowdGPT's default sandboxing run as a Python script directly on the user's Windows machine rather than in an isolated environment?Open thread →
- How can teams run Claude Code or a similar AI coding agent with guardrails so that it stays secure when used around production code?Open thread →
- Why don't Linux app packaging systems like Snap use a permission-based security model like Android or web browsers do?Open thread →
Show 14 more
- Would running AI model inference inside a sandbox such as firejail make it very secure?Open thread →
- Could malicious code that exploits buggy GPU drivers to break out of a QEMU sandbox be caught by static analysis?Open thread →
- Can QEMU be used to run untrusted code as a zero-trust sandbox for a rented virtual appliance?Open thread →
- Would a minimal 24KB operating system be a good way to run LLMs securely but efficiently in QEMU?Open thread →
- Can two sandboxed AI models communicate covertly through side channels such as floating-point rounding differences in a shared vLLM inference server?Open thread →
- Why not run n8n itself inside a Docker sandbox?Open thread →
- How can coding agents run code safely in an external sandbox that limits network access and protects credentials?Open thread →
- How should the security model of a local-first, AI-assisted Windows troubleshooting app be evaluated before IT support staff run it on work machines?Open thread →
- How can code written by AI agents be isolated and sandboxed to prevent security risks, beyond sandboxing the code agents run?Open thread →
- Has anyone detected unsolicited system or web calls from a locally run LLM setup such as llama.cpp?Open thread →
- Can a llama.cpp LLM running locally on Windows be isolated with a sandbox like Sandboxie or Open Sandbox, and what is the experience like?Open thread →
- What is an AI agent sandbox, and why do AI coding agents keep escaping their sandboxes?Open thread →
- Why don't AI coding agents break out of their containment sandboxes when given access to a development environment?Open thread →
- What practical isolation methods exist on Linux-like operating systems for running commercial remote LLM clients while keeping local data separate from the rest of the system, besides a full virtual machine?Open thread →
Where it is asked
- Hacker News14
- A private community3
- dev.to1
- simonwillison.net1
- Stack Exchange1
Private messages are counted, never shown. That is why you can read 17 of them.