Python library for safely running AI-generated code
Top 84.2% on sourcepulse
AgentRun provides a secure and efficient way to execute AI-generated Python code, targeting developers integrating LLMs into their applications. It simplifies the process of allowing LLMs to write and run code, enhancing their capabilities for tasks like data analysis and complex calculations, while mitigating security risks.
How It Works
AgentRun leverages Docker for isolated execution environments and RestrictedPython for code safety. It automatically manages dependencies, resource limits, and timeouts within a sandboxed container. This approach ensures that potentially malicious or resource-intensive code generated by LLMs cannot harm the host system or consume excessive resources.
Quick Start & Requirements
agentrun-api
, copy .env.example
to .env.dev
, and run docker-compose up -d --build
. Access via http://localhost:8000/v1/run/
.pip install agentrun
. Requires a running Docker container.Highlighted Details
requests
.Maintenance & Community
The project is maintained by tjmlabs. Further community or roadmap information is not detailed in the README.
Licensing & Compatibility
The project appears to be licensed under the MIT License, allowing for commercial use and integration into closed-source projects.
Limitations & Caveats
Dependency installation time can be a bottleneck, especially for packages with many sub-dependencies or when caching is not utilized. The effectiveness of resource limits depends on Docker's configuration and the underlying host system.
8 months ago
1 day