Deno Sandbox

deno.com

267 points by johnspurlock 5 hours ago


simonw - 5 hours ago

Note that you don't need to use Deno or JavaScript at all to use this product. Here's their Python client SDK: https://pypi.org/project/deno-sandbox/

  from deno_sandbox import DenoDeploy
  
  sdk = DenoDeploy()
  
  with sdk.sandbox.create() as sb:
      # Run a shell command
      process = sb.spawn("echo", args=["Hello from the sandbox!"])
      process.wait()
  
      # Write and read files
      sb.fs.write_text_file("/tmp/example.txt", "Hello, World!")
      content = sb.fs.read_text_file("/tmp/example.txt")
      print(content)
Looks like the API protocol itself uses websockets: https://tools.simonwillison.net/zip-wheel-explorer?package=d...
emschwartz - 5 hours ago

> In Deno Sandbox, secrets never enter the environment. Code sees only a placeholder

> The real key materializes only when the sandbox makes an outbound request to an approved host. If prompt-injected code tries to exfiltrate that placeholder to evil.com? Useless.

That seems clever.

johnspurlock - 5 hours ago

"Over the past year, we’ve seen a shift in what Deno Deploy customers are building: platforms where users generate code with LLMs, and that code runs immediately without review. That code frequently calls LLMs itself, which means it needs API keys and network access.

This isn’t the traditional “run untrusted plugins” problem. It’s deeper: LLM-generated code, calling external APIs with real credentials, without human review. Sandboxing the compute isn’t enough. You need to control network egress and protect secrets from exfiltration.

Deno Sandbox provides both. And when the code is ready, you can deploy it directly to Deno Deploy without rebuilding."

yakkomajuri - an hour ago

Secret placeholders seems like a good design decision.

So many sandbox products these days though. What are people using in production and what should one know about this space? There's Modal, Daytona, Fly, Cloudflare, Deno, etc

WatchDog - 29 minutes ago

If you achieve arbitrary code execution in the sandbox, I think you could pretty easily exfiltrate the openai key by using the openai code interpreter, and asking it to send the key to a url of your choice.

koolala - 3 hours ago

The free plan makes me want to use it like Glitch. But every free service like this ever has been burned...

Bnjoroge - an hour ago

Ignoring the fact that most of the blog post is written by an LLM, I like that they provide a python sdk. I dont believe vercel does for their sandbox product.

ttoinou - 5 hours ago

What happens if we use Claude Pro or Max plans on them ? It’ll always be a different IP connecting and we might get banned from Anthropic as they think we’re different users

Why limit the lifetime on 30 mins ?

dangoodmanUT - 2 hours ago

Love their network filtering, however it definitely lacks some capabilities (like the ability to do direct TCP connections to Postgres, or direct IP connections.

Those limitations from other tools was exactly why I made https://github.com/danthegoodman1/netfence for our agents

ATechGuy - 4 hours ago

> allowNet: ["api.openai.com", "*.anthropic.com"],

How to know what domains to allow? The agent behavior is not predefined.

nihakue - 5 hours ago

See also Sprites (https://news.ycombinator.com/item?id=46557825) which I've been using and really enjoying. There are some key architecture differences between the two, but very similar surface area. It'll be interesting to see if ephemeral + snapshots can be as convenient as stateful with cloning/forking (which hasn't actually dropped yet, although the fly team say it's coming).

Will give these a try. These are exciting times, it's never been a better time to build side projects :)

zenmac - 3 hours ago

>Deno Sandbox gives you lightweight Linux microVMs (running in the Deno Deploy cloud)

The real question is can the microVMs run in just plain old linux, self-hosted.

Tepix - 5 hours ago

If you can create a deno sandbox from a deno sandbox, you could create an almost unkillable service that jumps from one sandbox to the next. Very handy for malicious purposes. ;-)

Just an idea…

mrpandas - 4 hours ago

Where's the real value for devs in something like this? Hasn't everyone already built this for themselves in the past 2 years? I'm not trying to sound cheeky or poo poo the product, just surprised if this is a thing. I can never read what's useful by gut anymore, I guess.

snehesht - 4 hours ago

50/200 Gb free plus $0.5 / Gb out egress data seems expensive when scaling out.

MillionOClock - 3 hours ago

Can this be used on iOS somehow? I am building a Swift app where this would be very useful but last time I checked I don't think it was possible.

e12e - 5 hours ago

Looks promising. Any plans for a version that runs locally/self-host able?

Looks like the main innovation here is linking outbound traffic to a host with dynamic variables - could that be added to deno itself?

latexr - 2 hours ago

> evil.com

That website does exist. It may hurt your eyes.

ianberdin - 5 hours ago

Firecrackervm with proxy?

eric-burel - 2 hours ago

Can it be used to sandbox an AI agent, like replacing eg Cursor or Openclaw sandboxing system?

LAC-Tech - 3 hours ago

As a bit of an aside, I've gotten back into deno after seeing bun get bought out by an AI company.

I really like it. Startup times are now better than node (if not as good as bun). And being able to put your whole "project" in a single file that grabs dependencies from URLs reduces friction a surprising amount compared to having to have a whole directory with package.json, package-lock.json, etc.

It's basically my "need to whip up a small thing" environment of choice now.

EGreg - 2 hours ago

We already have a pretty good sandbox in our platform: https://github.com/Qbix/Platform/blob/main/platform/plugins/...

It uses web workers on a web browser. So is this Deno Sandbox like that, but for server? I think Node has worker threads.

bopbopbop7 - 2 hours ago

Now I see why he was on twitter saying that the era of coding is over and hyping up LLMs, to sell more shovels...

andrewmcwatters - 5 hours ago

[dead]