Enhance local Python executor security by blocking dunder calls by nnfrog · Pull Request #1551 · huggingface/smolagents (original) (raw)

and others added 5 commits

July 13, 2025 10:17

@nnfrog

updating the local_python_executor to prevent execution while Python code attempt to access dunder methods. A developer can authorize a dunder method the same way as he authorizes tools, for example: custom_executor = LocalPythonExecutor([]) custom_executor.send_tools({"getattribute":"getattribute","subclasses":"subclasses"})

@albertvillanova

@albertvillanova

@albertvillanova

@albertvillanova

albertvillanova

albertvillanova

@albertvillanova albertvillanova changed the titleEnhancing the local Python sandbox Enhancie local Python executor security by blocking dunder calls

Aug 1, 2025

@albertvillanova albertvillanova changed the titleEnhancie local Python executor security by blocking dunder calls Enhance local Python executor security by blocking dunder calls

Aug 1, 2025

albertvillanova

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})