agents
latest
false
  • Getting started
    • About agents
    • Agents workspaces
    • Governance
    • Data residency and supported models
    • Limitations
  • Prerequisites
  • Building agents in Studio Web
    • Building an agent in Studio Web
    • Best practices
    • Prompts
      • Activities
      • Agents
      • Processes
      • Guardrails
    • Contexts
    • Escalations and Agent Memory
    • Evaluations
    • Traces
    • Agent score – Preview
  • Building agents in Agent Builder
UiPath logo, featuring letters U and I in white

Agents user guide

Last updated Apr 30, 2025

Guardrails

Guardrails provide a mechanism to control unexpected behaviors within tool calls deterministically. They allow developers to configure conditions for human intervention and ensure that escalations occur precisely when defined conditions are met.

Briefly, the role of guardrails is to:

  • Address unpredictable tool call inputs and outputs at runtime.
  • Reduce the need for human-in-the-loop (HITL) interventions for correction and validation tasks.
  • Enable developers to create custom rules at the individual agent/tool level.

How it works

You define guardrails for each agent tool, as follows:

  • There can be one or more guardrails per tool.

  • Each guardrail contains one or more rules and one action. Rules are evaluated against the inputs and outputs of the tool.

  • An action is triggered when all rules are met. The action can happen before and/or after tool execution.

Guardrails are displayed in the Properties panel for every type of tool (processes, activities, or other agents). The Guardrail builder is where you define the list of rules that trigger the guardrail and the action to be applied when all the rules are met.

At runtime, guardrails are checked from top to bottom in the order they appear in the list. You can reorder guardrails as necessary by a drag and drop action using the menu icon on the left.

Use the Enable guardrail for evaluations option to apply the selected guardrail during evaluation runs as well.

Configuring guardrails

To configure guardrails for a tool:

  1. Add any tool to your agent.
  2. Select the tool and open the Properties panel.
  3. Select Open guardrail builder.
  4. Set a guardrail name and description, then configure the rule and action types.
  5. Select Save. Tools with guardrails are marked with a shield icon.
Figure 1. An activity tool with guardrails applied
docs image

Rule types

The following rule types are available:

  • Always enforce the guardrail (default) – This guardrail always triggers the action regardless of input or output. It is applicable to the agent input (pre-execution), output (post-execution), or both (pre and post-execution).
  • String – This guardrail applies to available input and output fields. The rule is applicable to string fields, including nested JSON fields, and supports various operators (contains, starts with, ends with, equals, is empty, etc.)
  • Number – This guardrail applies to available input and output fields. The rule is applicable to number fields, including nested JSON fields, and supports various operators (contains, starts with, ends with, equals, is empty, etc.).
  • Boolean – This guardrail applies to available input and output fields. The rule is applicable to boolean fields, including nested JSON fields, and supports the Equals operator, with True or False values.
Action types

For each rule, you enforce the action to occur when all the rules are met.

The following action types are available:

  • Log – Sets a severity level for logging. This action is useful for sending custom events for dashboard monitoring
  • Filter – Removes selected fields from the input and/or output of a tool, as follows:
    • Inputs: Selected fields are not sent to the tool API request.
    • Outputs: Selected fields are not returned to the agent.
      Note: The quality of the agent may be impacted if critical information is filtered out.
  • Block – Prevents tool execution when conditions are met. When using this option, you must provide a reason for blocking. Blocking a tool can result in agent failure.
  • Escalate – Assigns an escalation to a user through a compatible escalation app.

Executing guardrails

After running the agent, the output panel displays:

  • The successful execution status.
  • The presence of guardrails in the trace.
  • The details of applied or skipped guardrails.

Using an escalation app for guardrails

The Escalate action requires a compatible action app. A template is available in the UiPath Marketplace under the following name: Agent Tool Guardrail Escalation App.

To make the app available for guardrails, take the following steps:

  1. Download the app template from Marketplace and import the .uip file into a new Studio project. For details, see Importing app projects in the Studio Web user guide.
  2. You can add new controls and events to the app, but do not change the underlying action schema. Altering the schema renders the app incompatible with guardrail escalations.
  3. Publish the app, as described in Publishing app projects.
  4. Go to Orchestrator and deploy the app in a shared folder, as described in Deploying app projects.

    Make sure the folder has serverless robots available, to prevent errors when running the escalation.

  5. Return to your agent and select the recently deployed app for your guardrails.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2025 UiPath. All rights reserved.