fix(exec): disable command guard in full access

This commit is contained in:
chengyongru
2026-08-24 11:44:00 +08:00
committed by chengyongru
parent b1cadf53c5
commit 09d3bd76c9
3 changed files with 50 additions and 11 deletions
+12 -8
View File
@@ -470,14 +470,18 @@ class ExecTool(Tool):
+ _WORKSPACE_BOUNDARY_NOTE
)
guard_error = self._guard_command(
command,
cwd,
restrict_to_workspace=access.restrict_to_workspace,
workspace_root=workspace_root,
)
if guard_error:
return guard_error
# Full access is an explicit trust decision. Keep the application-level
# command guard aligned with the selected access mode instead of
# continuing to block commands after workspace restriction is disabled.
if access.restrict_to_workspace:
guard_error = self._guard_command(
command,
cwd,
restrict_to_workspace=True,
workspace_root=workspace_root,
)
if guard_error:
return guard_error
if self.sandbox:
if _IS_WINDOWS: