Skip to content

feat(guardrails): send an empty attachments list when a step has no files [AL-611] - #1939

Merged
apetraru-uipath merged 1 commit into
mainfrom
feat/al-611-empty-attachments
Oct 12, 2026
Merged

apetraru-uipath merged 1 commit into
mainfrom
feat/al-611-empty-attachments

Conversation

@apetraru-uipath

@apetraru-uipath apetraru-uipath commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What changed?

evaluate_guardrail(..., attachments=[]) now sends "attachments": [] instead of dropping the field. None still omits it.

  • Why: the Agents backend (AL-611) uses the explicit empty list to tell "files apply but there are none to inspect" apart from "files do not apply". A Files-only guardrail sent [] passes without a provider call, while an absent list keeps the text fallback.
  • The folder-key header and the 60 s timeout stay keyed on a non-empty list, because nothing is fetched for an empty one.
  • Version: uipath-platform 0.2.36, with the platform and uipath lock files refreshed. uipath-core and uipath are unchanged.

uipath-langchain starts passing [] in UiPath/uipath-langchain-python#1144 (draft, waiting for this release).

How has this been tested?

  • test_guardrails_service.py:
    • attachments=[] sends "attachments": [], with no folder header and the default timeout;
    • an absent argument still omits the key.
  • The uipath-platform suite passes. ruff, ruff format and mypy are clean.
  • End to end on the local robot with the langchain branch and local Agents: the create-file turn's request carried "attachments": [] and was passed without a provider call.

Related (AL-611)

🤖 Generated with Claude Code

…iles [AL-611]

evaluate_guardrail now sends "attachments": [] when the caller passes an
empty list, instead of dropping the field. The Agents backend uses this to
tell "files apply but there are none to inspect" apart from "files do not
apply". A files-only guardrail can then pass without checking the text,
while None still omits the field and keeps the text fallback for older
callers.

The folder-key header and the 60 second timeout are still sent only for a
non-empty list, because no file is fetched when the list is empty.

Bumps uipath-platform to 0.2.36 and refreshes the platform and uipath lock
files.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The implementation matches the documented semantics and includes focused regression coverage.

0 open findings

What changed in this PR

Updates guardrail request serialization to distinguish omitted attachments from an explicitly empty list.

Changes:

  • Sends "attachments": [] when callers provide an empty list.
  • Preserves existing header and timeout behavior for non-empty attachments.
  • Adds regression tests and bumps uipath-platform to 0.2.36.
File Description
packages/​uipath/​uv.lock Refreshes the platform package version.
packages/​uipath-platform/​uv.lock Updates locked package metadata.
packages/​uipath-platform/​tests/​services/​test_guardrails_service.py Tests empty-list serialization, headers, and timeout behavior.
packages/​uipath-platform/​src/​uipath/​platform/​guardrails/​_guardrails_service.py Preserves explicitly empty attachment lists in requests.
packages/​uipath-platform/​pyproject.toml Bumps the package version to 0.2.36.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@apetraru-uipath
apetraru-uipath merged commit 7b351ac into main Oct 12, 2026
133 of 147 checks passed
@apetraru-uipath
apetraru-uipath deleted the feat/al-611-empty-attachments branch October 12, 2026 11:01
apetraru-uipath added a commit that referenced this pull request Oct 13, 2026
…low-code does [AL-599]

#1144 (AL-611) gave the low-code resolvers a three-way answer: None says
nothing about files (text-only scope, or a payload that cannot be scanned),
[] means files apply and none were found, a list names the files. With #1939
the service now sends an explicit [] on the wire, which lets a Files-only
guardrail pass without a provider call.

referenced_attachments and discover_attachments returned [] when the payload
could not be scanned, so on a Files-scoped guardrail a broken payload would
have passed without its text being judged. They now return None in that case.
The decorator evaluator passes an explicit [] through when discovery found
nothing, and BuiltInGuardrailValidator.run treats attachments=None as "say
nothing" (bare call) and [] as "files apply, none found" (explicit [] only
when the scope explicitly includes files).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants