Skip to content

Comments

fix: improve integration genome#94

Merged
cristipufu merged 1 commit intomainfrom
fix/integration_guid_part2
Feb 20, 2026
Merged

fix: improve integration genome#94
cristipufu merged 1 commit intomainfrom
fix/integration_guid_part2

Conversation

@cristipufu
Copy link
Member

No description provided.

@cristipufu cristipufu self-assigned this Feb 20, 2026
Copilot AI review requested due to automatic review settings February 20, 2026 14:38
@cristipufu cristipufu requested a review from a team as a code owner February 20, 2026 14:38
@cristipufu cristipufu force-pushed the fix/integration_guid_part2 branch from e38c9f2 to cc18a91 Compare February 20, 2026 14:42
@cristipufu cristipufu merged commit e95df58 into main Feb 20, 2026
24 checks passed
@cristipufu cristipufu deleted the fix/integration_guid_part2 branch February 20, 2026 14:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the integration genome documentation that guides developers in building framework integrations for the UiPath runtime. The changes add comprehensive coding principles, expand best practices, and correct a typo in error contract documentation.

Changes:

  • Fixed spelling typo in error contract example comment (InvaliGraphReference → InvalidGraphReference)
  • Added extensive "Coding Principles" section with 6 core principles for integration development
  • Expanded documentation with security patterns, error categorization, message mapping, and agent caching strategies
  • Corrected project path reference in .cursorrules (goob_ai → uipath)

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
src/uipath/runtime/errors/contract.py Fixed typo in comment example (InvaliGraphReference → InvalidGraphReference)
INTEGRATION_GENOME.md Major expansion of integration development guide with coding principles, security patterns, serialization best practices, error handling, storage configuration, and reference implementation strategies
CLAUDE.md Reformatted reference integrations section into a structured table with tier and capability information
.cursorrules Corrected project path from old name (goob_ai) to current name (uipath)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# SECURITY: Validate path is within working directory (Coding Principle 6)
cwd = os.path.abspath(os.getcwd())
abs_file_path = os.path.abspath(os.path.normpath(self._module_path))
if not abs_file_path.startswith(cwd):
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path validation in load() uses abs_file_path.startswith(cwd) to enforce that the agent file stays under the working directory, which is unsafe for preventing path traversal. An attacker who can influence self._module_path can choose a path like /home/app2/agent.py when cwd is /home/app, which still passes the prefix check but points outside the project, allowing arbitrary modules to be loaded from outside the intended directory. Use a proper directory-containment check (e.g., based on normalized common paths rather than raw string prefixes) to ensure the loaded file truly resides within the working directory.

Suggested change
if not abs_file_path.startswith(cwd):
try:
common_path = os.path.commonpath([cwd, abs_file_path])
except ValueError:
# Different drive or otherwise incompatible paths – treat as invalid
common_path = ""
if common_path != cwd:

Copilot uses AI. Check for mistakes.
```python
cwd = os.path.abspath(os.getcwd())
abs_file_path = os.path.abspath(os.path.normpath(file_path))
if not abs_file_path.startswith(cwd):
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The security example under "Validate Agent Paths Against Working Directory" also relies on abs_file_path.startswith(cwd) to restrict agent files to the project directory, which is not a safe containment check. A path such as /home/app2/agent.py will still start with /home/app when cwd is /home/app, so an attacker controlling file_path can bypass the intended restriction and load code from outside the project tree. This guidance should be updated to use a robust directory containment check (e.g., based on normalized common paths) so downstream integrations do not copy an exploitable pattern.

Suggested change
if not abs_file_path.startswith(cwd):
if os.path.commonpath([cwd, abs_file_path]) != cwd:

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant