Skip to content
Closed
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,10 @@ def _parse_uip_command(command: str) -> list[str]:
f"Shell operator '{token}' is not allowed; run one command at a time."
)

words = [t.lower() for t in tokens if not t.startswith("-")]
if "run" in words and {"codedagent", "function", "functions"} & set(words):
raise ValueError("`uip codedagent run` and `uip function run` are blocked.")
Comment thread
mariadhakalUipath marked this conversation as resolved.
Comment thread
mariadhakalUipath marked this conversation as resolved.

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)


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


Expand Down
Loading