AutoGPT
AutoGPT copied to clipboard
Option to disable working directory restrictions
Background
It is constantly unable to access files due to workspace working directory restrictions. An option is needed to remove the restriction on the working directory.
Changes
- Added new environment variable
WORKING_DIRECTORY_RESTRICTEDthat is set to True by default, setting to False will remove the restriction. - Modfied
execute_code.pyto usesafe_joinfromfile_operations.pyinstead so that the environment variable can be referenced once infile_operations.pyonly.
Documentation
Above.
Test Plan
Tested by making sure it was able to access files outside of the working directory with it set to false.
PR Quality Checklist
- [x] My pull request is atomic and focuses on a single change.
- [x] I have thoroughly tested my changes with multiple different prompts.
- [x] I have considered potential risks and mitigations for my changes.
- [x] I have documented my changes clearly and comprehensively.
- [x] I have not snuck in any "extra" small tweaks changes
Fixes #1862, #23
Seems dangerous if not properly sandboxed, so maybe give it a big fat warning label in the docs.
@Josh-XT There are conflicts now
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.
I have pulled the latest master but I can't see the WORKING_DIRECTORY_RESTRICTED variable in .env?
I am a noob... happy to buy you a coffee...
@Philomath88 pulling updates .env.template, not .env. Also, the config variable is called RESTRICT_TO_WORKSPACE.
Not sure how to buy you a coffee - there's no PayPal or equivalent in the docs:
If you can spare a coffee, you can help to cover the costs of developing Auto-GPT and help push the boundaries of fully autonomous AI! Your support is greatly appreciated Development of this free, open-source project is made possible by all the contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here.
On which branch should I work to use the new variable RESTRICT_TO_WORKSPACE?
I'm working on the stable branch as instructed in the README.md and I can't find the variable in the .env.template so I guess that the change is not yet merged to the stable branch.
You are correct, as you can see this PR was merged into master.