-
Notifications
You must be signed in to change notification settings - Fork 341
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
Arbitrary callable objects passed to the Executor #82
Comments
Hello @boristopalov, thank you for reporting this! Thus this cannot be used even by a malicously fine-tuned LLM to bypass import restrictions. |
Thanks for the response! @aymeric-roucher I understand that In my example, the code we pass in to the interpreter is When the interpreter evaluates |
@aymeric-roucher let me know if you think this is a valid concern/loophole. I would be happy to create a PR |
Hey team, first off thanks for this great project, I'll definitely be spending more time with it!
I was looking at the interpreter and found that you can pass in callable objects to the interpreter, which bypasses the restrictions imposed on importing modules. Here is a basic script that passes in a lambda that calls
os.remove()
:This works even though
os
is not in the whitelist of allowed modules. I think this would only be an issue if a user directly imports an unsafe module within the scope of where an instance ofCodeAgent
runs, i.e. the agent can pass in something likeos.remove()
into the interpreter without importingos
sinceos
is already in scope. I'm wondering if it would be worth it to add some additional checks. Let me know what you thinkThe text was updated successfully, but these errors were encountered: