Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ def _parse_uip_command(command: str) -> list[str]:
f"Shell operator '{token}' is not allowed; run one command at a time."
)

if tokens[:2] in (["codedagent", "run"], ["function", "run"]):
raise ValueError(f"`uip {' '.join(tokens[:2])}` is blocked.")

return tokens


Expand Down
6 changes: 6 additions & 0 deletions tests/agent/tools/internal_tools/test_uipath_cli_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ def test_parse_rejects_shell_operators(command: str) -> None:
_parse_uip_command(command)


@pytest.mark.parametrize("command", ["codedagent run", "function run"])
def test_parse_blocks_local_run_commands(command: str) -> None:
with pytest.raises(ValueError, match="blocked"):
_parse_uip_command(command)
Comment on lines +58 to +61


# --- command examples stay aligned with the real CLI -----------------------


Expand Down
Loading