News for hackers. Stuff that matters.
Re:Anthropic acquires Bun by otterley on Tuesday December 02, 2025 @05:07PM (#46127595)
Note that "sandboxing" in this case is strictly runtime sandboxing - it's basically like having a separate process per event loop (as if you ran separate Node processes). It does not sandbox the machine context in which it runs (i.e. it's not VM-level containment).
Re:Anthropic acquires Bun by Brass_Hopper on Tuesday December 02, 2025 @05:32PM (#46127862)
When you say runtime sandboxing, are you referring to JavaScript agents? I haven't worked all that much with JavaScript execution environments outside of the browser so I'm not sure about what sandboxing mechanics are available.
Re:Anthropic acquires Bun by otterley on Tuesday December 02, 2025 @05:58PM (#46128099)
https://nodejs.org/api/vm.html

Bun claims this feature is for running untrusted code (https://bun.com/reference/node/vm), while Node says "The node:vm module is not a security mechanism. Do not use it to run untrusted code." I'm not sure whom to believe.

Re:Anthropic acquires Bun by Brass_Hopper on Tuesday December 02, 2025 @06:37PM (#46128422)
It's interesting to see the difference in how both treat the module. It feels similar to a realm which makes me lean by default to not trusting it for untrusted code execution.

It looks like Bun also supports Shadow Realms which from my understanding was more intended for sandboxing (although I have no idea how resources are shared between a host environment and Shadow Realms, and how that might potentially differ from the node VM module).

Re:Anthropic acquires Bun by sheepscreek on Tuesday December 02, 2025 @06:53PM (#46128566)
Doesn’t Bun use JavaScriptCore though? Perhaps their emulation, rather implementation, leans more towards security.
Re:Anthropic acquires Bun by Jarred on Tuesday December 02, 2025 @06:09PM (#46128198)
The reference docs are auto generated from node’s TypeScript types. node:vm is better than using the same global object to run untrusted code, but it’s not really a sandbox
Re:Anthropic acquires Bun by Muromec on Tuesday December 02, 2025 @05:32PM (#46127867)
Running it in a chroot or a scoped down namespace is all your need most of the time anyways.