Skip to content

feat(guardrails): give post-execution guardrails only the files the output references [AL-611] - #1144

Draft
apetraru-uipath wants to merge 1 commit into
mainfrom
feat/al-611-output-file-guardrails
Draft

apetraru-uipath wants to merge 1 commit into
mainfrom
feat/al-611-output-file-guardrails

Conversation

@apetraru-uipath

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

Copy link
Copy Markdown
Contributor

Draft until uipath-platform 0.2.36 is on PyPI. Then the floor moves to uipath-platform>=0.2.36 and the skipped wire test switches on.

What changed?

Post-execution guardrails get only the files the output references (AL-611).

  • Agent output scans agent_result and sends only the registered files it references.
  • After each LLM call the check scans the tool-call arguments of the last message, e.g. the file passed to end_execution.
  • Both apply to every validator. Before, both sent the run's whole attachment registry:
    • Input uploads were judged again as if the agent had produced them, which gave IP false positives.
    • With inputs first under the 5-file cap, the produced files could be dropped.
  • Agent and LLM pre-execution still send the whole registry. Tool checks keep their behaviour on the same mechanism.

Three-way resolution:

  • None: text only, or the payload could not be scanned. The backend falls back to text.
  • []: files apply and there are none. A Files-only guardrail passes without judging the text.
  • A list: the files to inspect.

The 400 retry still drops the references, and a 400 on [] propagates.

Output-file verification now registers the references Orchestrator verified, so the agent-output check can resolve files from tools that don't register attachments. It does nothing without a job key.

Known limit: that verification runs only when output files are enabled for the agent, i.e. it has a Create File tool and is not conversational. Without it, a file from a tool that doesn't register attachments isn't sent at agent output.

Version 0.18.33.

How has this been tested?

  • New tests:
    • Terminate and LLM-post attachment cases, plus a terminate subgraph run test where Block names the flagged file.
    • The three-way attachment_refs returns.
    • The output-file registry.
    • A full-graph scripted run (create-file then end_execution): turn 1 sends [], turn 2 sends the file, and agent output sends only the created file, not the input.
    • A wire test for "attachments": [], skipped until platform 0.2.36.
  • Full suite 3738 passed, 1 skipped. ruff, ruff format and mypy are clean.
  • Local end to end (Studio Web Debug, local robot with this branch and the SDK branch, local Agents with its PR, a logging proxy on /validate), with an IP guardrail at Agent scope, Files, Text and an uploaded protected input file:
    • On main, agent output sent the input and the output, and the run was blocked: a false positive.
    • On this branch, only the output file was sent and the run passed.
    • At LLM scope, the create-file turn sent [] and passed with no provider call, and the end_execution turn sent the file and was blocked with "Flagged files: code_sample.txt".

Related (AL-611)

🤖 Generated with Claude Code

…utput references [AL-611]

The guardrail at agent output and the guardrail after each LLM call used to
receive every file in the run's attachment registry. Input uploads were judged
again as if the agent had produced them, which gave the Intellectual Property
guardrail false positives, and with inputs first under the five-file cap the
files the agent actually produced could be dropped.

Each guardrail node now takes one attachment source. The agent-output check
scans the agent result, and the post-LLM check scans the tool-call arguments of
the last message. Each sends only the registered files they reference. The
pre-execution checks at Agent and LLM scope still send the whole registry, and
the tool checks keep their behaviour on the same mechanism. The scan walks the
payload in document order, so the files written first are the ones kept under
the cap.

Resolution now returns one of three answers. None says nothing about files: the
guardrail is text only, or the payload could not be scanned, and the backend
falls back to the text. An empty list says files apply and there are none, so
a files-only guardrail passes without judging the text. Otherwise the list
holds the files to inspect. The scope is read before the empty-registry
shortcut. The 400 retry still drops the references, and a 400 on an empty list
propagates.

The output-file verification node also registers the references Orchestrator
verified, so the agent-output check can resolve files from tools that do not
register their attachments. Without a job key nothing was verified and nothing
is registered.
That verification runs only when output files are enabled for the agent. When
it is off, a file from such a tool is not in the registry at agent output, so
the check sends an empty list for it, as the full-registry send did before.

A test pins that an agent-output check in Files scope with no referenced file
puts an empty attachments list on the wire. It is skipped until the installed
uipath-platform sends empty lists, which starts with 0.2.36.

The version moves to 0.18.33.

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

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant