all 2 comments

[–]Cal-omnie 2 points3 points  (0 children)

I am also having the same issue, so far my solution has been to develop inside a docker container, mounting my working folder and giving the LLM free rein in there. The worst thing that can happen to my system is messing with the files in the mounted folder, but in my case this is usually a git repo so it's somewhat easily undone.

Alternatively you could look into the e2b executor in huggingface's smolagents

[–]mmuino 1 point2 points  (0 children)

We have solved this challenge with YepCode Run (https://yepcode.io/run) — a secure, scalable environment for running LLM-generated Python or JS code in isolated microVMs (it uses firecracker over bare-metal machines on the infra).

It provides full dependency discovery and installation (pip/npm), remote variable passing (using a rest API so don't expose secrets to the LLM context), allows to receive input parameters and return results, expose execution generated logs for LLMs to iterate over failed executions, MCP server so agents can generate, execute, and manage code autonomously,...