← 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.

Read what people asked

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.

Named in the answersQEMUexternal-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.

Show 14 more

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.

Goes straight to the person who runs this site. No account needed.