Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to add CURL or REST API support for this creating #23

Open
snps-mahavadi opened this issue Feb 10, 2025 · 2 comments
Open

Any plans to add CURL or REST API support for this creating #23

snps-mahavadi opened this issue Feb 10, 2025 · 2 comments

Comments

@snps-mahavadi
Copy link

Thanks for the great project, It just works.
Do you have any plans to add CURL or REST support for llm-sandbox ?
How do we block or enforce security guardrails to ensure the LLM generated code is not generating/executing dangerous code inside the container. I see security.py file, Can you add README points on how to use it?

@vndee
Copy link
Owner

vndee commented Feb 10, 2025

Hey @snps-mahavadi, thanks for your questions!

  • This project already wraps multiple layers (Docker, k8s) with Python to interface with their REST APIs. Adding another REST API layer would increase complexity. Please clarify the specific use cases that require a REST API service, as implementing this would need a dedicated API server.

  • Security implementation is still in progress. The current security.py is a placeholder and I am still thinking what is the best way to do this. The challenge is designing a flexible system that can:

    • Handle multiple programming languages with varying security requirements
    • Start with basic syntactic code scanning and default language-specific configurations
    • Allow users to customize security rules and inject their own checkers

Suggestions are always welcome!

@loorisr
Copy link

loorisr commented Mar 2, 2025

@snps-mahavadi if you want a CURL API you can use https://github.com/khoj-ai/terrarium

@vndee for security for python, maybe you could use https://restrictedpython.readthedocs.io/en/latest/?

Also you could run the docker image with:

  • network_disabled: True
  • cap_drop : ALL
  • security_opt: [ no-new-privileges=true]
  • read_only: True (and a tmpfs for file operation ?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants