Skip to content
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

Option to disable working directory restrictions #1875

Merged
merged 8 commits into from
Apr 18, 2023

Conversation

Josh-XT
Copy link
Contributor

@Josh-XT Josh-XT commented Apr 16, 2023

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_RESTRICTED that is set to True by default, setting to False will remove the restriction.
  • Modfied execute_code.py to use safe_join from file_operations.py instead so that the environment variable can be referenced once in file_operations.py only.

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

  • My pull request is atomic and focuses on a single change.
  • I have thoroughly tested my changes with multiple different prompts.
  • I have considered potential risks and mitigations for my changes.
  • I have documented my changes clearly and comprehensively.
  • I have not snuck in any "extra" small tweaks changes

@Josh-XT Josh-XT changed the title Remove working directory restrictions Option to disable working directory restrictions Apr 16, 2023
@Pwuts
Copy link
Member

Pwuts commented Apr 16, 2023

Fixes #1862, #23

@Pwuts
Copy link
Member

Pwuts commented Apr 16, 2023

Seems dangerous if not properly sandboxed, so maybe give it a big fat warning label in the docs.

@Pwuts Pwuts mentioned this pull request Apr 16, 2023
nponeccop
nponeccop previously approved these changes Apr 16, 2023
@nponeccop nponeccop added the B7 label Apr 16, 2023
@Pwuts Pwuts mentioned this pull request Apr 16, 2023
2 tasks
@nponeccop
Copy link
Contributor

@Josh-XT There are conflicts now

@github-actions github-actions bot added the conflicts Automatically applied to PRs with merge conflicts label Apr 17, 2023
@github-actions
Copy link
Contributor

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

@github-actions
Copy link
Contributor

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

@Pwuts Pwuts merged commit 9514919 into Significant-Gravitas:master Apr 18, 2023
@Philomath88
Copy link

Philomath88 commented Apr 19, 2023

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...

tvup pushed a commit to tvup/Auto-GPT that referenced this pull request Apr 19, 2023
…s#1875)

Remove restriction on working directory if RESTRICT_TO_WORKSPACE != True

---------

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
@Pwuts
Copy link
Member

Pwuts commented Apr 19, 2023

@Philomath88 pulling updates .env.template, not .env. Also, the config variable is called RESTRICT_TO_WORKSPACE.

@Philomath88
Copy link

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.

@davidraviv
Copy link

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.

@Pwuts
Copy link
Member

Pwuts commented Apr 19, 2023

You are correct, as you can see this PR was merged into master.

sindlinger pushed a commit to Orgsindlinger/Auto-GPT-WebUI that referenced this pull request Sep 25, 2024
…s#1875)

Remove restriction on working directory if RESTRICT_TO_WORKSPACE != True

---------

Co-authored-by: Reinier van der Leer <github@pwuts.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add option to allow access outside of working directory Ability to Navigate Outside Working Directory.
5 participants