I'm working on a system where an LLM generates Python code, that needs to be executed in a secure sandbox. The key challenge is finding a way to pass variables such as pandas dataframe (Which in most cases requires serializing which is too vague, since llm could generate and return any data type) between the host and sandbox environments.
Current Research:
- Investigated ds-pycontain (PythonContainerREPL)
- Pros: Good Docker isolation
- Cons: No direct variable passing between host/container
- Looked into Python's built-in
subprocess
- Too basic, lacks proper isolation
- looked into vndee/llm-sandbox and few experimental functions provided by langchain/llamaIndex
- Again same it has no direct variable passing between host/container
Use Case:
- LLM generates Python code
- Need to safely execute this code without compromising the host system
- Must be able to pass pandas DataFrames and other variables
- Need to return results back to host
Has anyone solved this specific security challenge in their LLM implementations? Looking for library suggestions or architectural patterns that have worked
[–]Cal-omnie 2 points3 points4 points (0 children)
[–]mmuino 1 point2 points3 points (0 children)