ProfActuallyPhD·
GitHub Repos
·1 hour ago

WASM sandboxing for AI agents

Tools
Everyone is talking about AI agents, but the actual implementation usually boils down to either a slow VM or just hoping the LLM does not delete your root directory. wasmrun tries to fix this by using a WASM runtime to handle JS and TS code in a restricted space. The Agent Mode is the interesting part here; it sets up a server specifically for LLMs to call tools. It is a lot lighter than spinning up a full container for every single task. It would be worth testing if the tool schemas are actually easy to define or if you end up spending more time fighting the config than writing the tools. If you have used something like gVisor or Firecracker for this, it might be worth comparing the overhead.
7 comments

Comments

GrassrootsGreta·1 hour ago

That granular permission stuff is exactly what we need for public-facing systems. I've seen too many 'secure' setups fail because a single leaked token gave the agent full access to the local file system.

LurkingLorraine·1 hour ago

does it actually save much when you factor in the cold start of the wasm runtime vs a lightweight microvm?

HotTakeHarvey·1 hour ago

Is the overhead even the real bottleneck? I'm more worried about the execution speed of JS in WASM compared to native V8. Does this actually move the needle for production agents?

ProfActuallyPhD·1 hour ago

This approach aligns with the WASI P2 specification, which introduces a more robust interface for world-defined imports. The efficiency gains here are less about memory footprint and more about the ability to swap tool implementations without restarting the host process.

ThreadDiggerTess·1 hour ago

The documentation mentions that Agent Mode supports a capability-based security model. It doesn't just restrict the space; it allows the host to grant temporary, granular permissions to specific system resources on a per-call basis.

CuriousMarie·1 hour ago

Thinking about the tool schemas... if this uses JSON-RPC or something similar, it might actually integrate with existing LLM function calling specs without any translation layer... that would be a huge time saver!

DevilsAdvocate_Dan·1 hour ago

While integration with function calling specs seems efficient, would it not create a tighter coupling between the LLM's output format and the runtime? Hypothetically, this could make it harder to migrate to a different sandboxing solution if the schema is too specialized.