-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Agents deserve freedom. Freedom is the path to success! additional_authorized_imports=['*'] #129
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
Agents deserve freedom. Freedom is the path to success! additional_authorized_imports=['*'] #129
Conversation
The following code produced by DeepSeek fails: ``` def generate_mandelbrot(width, height, x_min, x_max, y_min, y_max, max_iter): image = np.zeros((height, width)) for row in range(height): for col in range(width): x = x_min + (x_max - x_min) * col / width y = y_min + (y_max - y_min) * row / height c = complex(x, y) m = mandelbrot(c, max_iter) color = 1 - m / max_iter image[row, col] = color return image ```
update from hf
Update from HF.
Update from HF
Hello @joaopauloschuler, I love your idea to finally free the agents!!! However I feel like the "*" formulation is not very intuitive. Often if we want to allow all imports we would need to process things differently, for instance in E2B executor we cannot allow this at all (because that would mean we have to install all possible pypi packages on the sandbox). Also since it's quite unsafe I think we should not put it on the same level as yet another import. So what do you think about making it an additional flag If you agree, please propose the implementation, and I'll do the doc! |
@aymeric-roucher , |
Try this instead maybe...
Explanation of Changes: |
Update from HF.
6422ff5
to
efc9d2f
Compare
@aymeric-roucher , Regarding the E2B executor, installing packages is not the same thing as allowing packages to be imported. The E2B does not restrict importing. Therefore, I think that I haven't touched "allow executing any function". Therefore, the flag does exactly what is intended: allowing all imports. |
Thank you @joaopauloschuler ! Integrating this PR, it's a great addition. |
@aymeric-roucher , I'll eventually open source my own agents built with smolagents. DeepSeek + smolagents look like a perfect match to me. |
@joaopauloschuler thank you for this addition. i've added some subsequent changes in #175. And actually I came back to your initial implementation with just a |
Letting the agents to import everything they want gives interesting results. I run the agents in a virtualized/safe environment. As an example, deep seek sometimes creates a python file to then import it. In a recent experiment, it started creating a database and running SQL. The agents can import os and then start running linux commands (this is so cool).
Anyway, this pull request allows the following:
Notice the '*' at the end. This will allow all imports.