-
Notifications
You must be signed in to change notification settings - Fork 44.5k
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
add mode for python execution #3713
add mode for python execution #3713
Conversation
divide docker mode and venv mode for python execution
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
This is a mass message from the AutoGPT core team. For more details (and for infor on joining our Discord), please refer to: |
if this is committed "as is", it would make sense for auto-gpt to run inside a separate environment - i.e. using chroot or ideally using a dedicated "autogpt" user. That way, there's another layer of security added when it comes to $HOME The same restriction should then apply for execute_shell commands obviously. |
Thank you for the excellent feedback on my request. While using venv provides some minimum security, adding a new account seems like a much safer idea. |
I did copy that advice into the source tree and opened a corresponding PR: |
Cool! I will also consider implementing rules for executing code based on user permissions. |
there are already some hard-coded heuristics to detect if agpt is running inside docker - I suppose the "separate user" idea could be implemented via a corresponding env file setting, and that would simply require autogpt to run as the user "autogpt", and if it doesn't, disable executive functions - if anybody disagrees, they can edit the env file and opt out obviously |
I understand your point, I think the "separate user" idea should be implemented in a separate pull request because it may have implications for other commands. Thanks for inform it! |
sure, they won't accept multiple features in a single PR anyway Also see: |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #3713 +/- ##
==========================================
- Coverage 62.67% 62.27% -0.41%
==========================================
Files 74 74
Lines 3400 3430 +30
Branches 495 501 +6
==========================================
+ Hits 2131 2136 +5
- Misses 1120 1143 +23
- Partials 149 151 +2
☔ View full report in Codecov by Sentry. |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Does venv provide the same degree of sandboxing as docker? |
No. |
Since venv does not provide the same degree of sandboxing as docker, they are only interchangeable if the user knows what they are doing and have purposefully disabled the workspace restriction. |
Instead of merging this, I'd like to assure you that we are working on an improvement to the CLI that should make it a lot easier to run Auto-GPT (with docker).
|
divide docker mode and venv mode for python execution
Background
To run execute_python_file, which is currently built into autogpt, user needs to install docker and create docker-image separately, which you feel is unnecessary and unreasonable. (I watched multiple issues because of this, for example #92 #1896 )
It is likely to be a difficult task for beginners or those who are not familiar with Docker use.
Changes
Therefore, in python execution, the venv mode and the Docker mode were separated and implemented so that the user could choose how to execute the code in the .env file.
Documentation
Relevant information is annotated in code as comments
Test Plan
Same environment, I tested docker mode(legacy) and venv mode and they work same.
PR Quality Checklist