←back to thread

MCP Run Python

(github.com)
173 points xrd | 3 comments | | HN request time: 0.667s | source
Show context
behnamoh ◴[] No.43718268[source]
So their method of sandboxing Python code is to spin up a JS runtime (deno), run Pyodide on it, and then run the Python code in Pyodide.

Seems a lot of work to me. Is this really the best way to create and run Python sandboxes?

replies(11): >>43718335 #>>43718770 #>>43718841 #>>43719300 #>>43719370 #>>43719672 #>>43719881 #>>43721408 #>>43722369 #>>43723869 #>>43726452 #
simonw ◴[] No.43719672[source]
I've been trying to find a good option for this for ages. The Deno/Pyodide one is genuinely one of the top contenders: https://til.simonwillison.net/deno/pyodide-sandbox

I'm hoping some day to find a recipe I really like for running Python code in a WASM container directly inside Python. Here's the closest I've got, using wasmtime: https://til.simonwillison.net/webassembly/python-in-a-wasm-s...

replies(5): >>43721214 #>>43722664 #>>43724984 #>>43725448 #>>43828320 #
1. 3abiton ◴[] No.43725448[source]
> I'm hoping some day to find a recipe I really like for running Python code in a WASM container directly inside Python.

But what would be the usecase for this?

replies(1): >>43725528 #
2. simonw ◴[] No.43725528[source]
Running Python code from untrusted sources, including code written by LLMs.
replies(1): >>43731970 #
3. 3abiton ◴[] No.43731970[source]
I see, the way I would approach is it by running a client on in a specific python env on an incus instance, with LLM hosted either on the host or another seperate an incus instance. Lately been addicted to sandboxing apps in incus, specifically for isolated vpn tunnels, and automating certain web access.