Skip to content

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

fix(workspace): resolve symlinks in workspace path before checking

Reinier van der Leer37ff26ec2c3d
diff --git a/autogpt/workspace.py b/autogpt/workspace.py
index 6fb0e3113e..724f8443e4 100644
--- a/autogpt/workspace.py
+++ b/autogpt/workspace.py
@@ -37,6 +37,7 @@ def safe_path_join(base: Path, *paths: str | Path) -> Path:
Returns:
Path: The joined path
"""
+ base = base.resolve()
joined_path = base.joinpath(*paths).resolve()
if CFG.restrict_to_workspace and not joined_path.is_relative_to(base):