Replies: 1 comment
-
|
Hi @mramendi, thanks for raising this! You're absolutely right that generated code can behave unpredictably, and sandboxing is a key part of mitigating potential risks. Regarding your specific concern about infinite loops like smolagents/src/smolagents/local_python_executor.py Lines 386 to 405 in 19eec13 Additionally, there's a broader cap on the total number of allowed operations ( That said, these are heuristic-based limits and not a substitute for a full resource-isolated execution environment (like using Docker or E2B), so there's always room for improvement. We're continuously exploring ways to make the sandbox more robust. Thanks again for your careful reading of the code and for pointing this out! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
We all know models can halucinate weirdly when generating code, and the idea behind https://github.com/huggingface/smolagents/blob/main/src/smolagents/local_python_executor.py is to sandbox that code so it does not do anything dangerous.
However, it seems to me, as far as I could understand the code, that a simple
while True:loop would not be caught. There does not seem to be a timeout, resource hogging limit, or anything like that.Am I misreading this or is this a real area for improvement?
Beta Was this translation helpful? Give feedback.
All reactions