Enterprise AI Strategy Guide

Prompts in UiPath AI Agent: System Prompts, User Prompts, and Best Practices

Scroll

When you build a smart assistant in UiPath, you need a way to clearly communicate what it should do – how to understand inputs, make decisions, and respond appropriately. This is where prompts come into play.

Prompts are the instructions and guidelines you give your UiPath AI agent so it can perform tasks like a human would – but faster, more consistently, and at scale. Understanding prompt engineering UiPath agents is not optional for teams building production-grade agentic automation. It is the single most accessible lever for improving agent accuracy, reliability, and behaviour – without touching the underlying model or rebuilding the agent from scratch.

What Are Prompts in UiPath AI Agent?

Every UiPath AI agent operates on two prompt types working together:

  • System Prompt — the developer-defined instruction set that defines the agent’s role, scope, behavioral guidelines, and decision logic. Set once at design time. Invisible to end users.
  • User Prompt — the runtime input template that passes dynamic data to the agent for each specific request — customer email, order ID, case number, or any other variable input the agent needs to process.
Together, the system prompt provides the brain — the rules, the role, and the reasoning framework. The user prompt provides the fuel — the specific, dynamic data the agent applies that framework to for each individual request.

System Prompt vs User Prompt: Understanding the Difference

System prompt vs user prompt in UiPath AI agent is most clearly understood through a practical example:

Scenario — A Customer Refund Processing Agent

System Prompt (set at design time — never changes)

• Defines the agent’s role: “You are a customer refund processing assistant. You help customers resolve refund requests for online orders.”
• Sets the goals: “Approve standard refund requests within policy, escalate high-value or disputed cases to a human reviewer.”
• Defines boundaries: “Only handle refund-related requests. Do not answer general product questions, pricing queries, or account management requests.”
• Specifies tool usage: “Use the Order Lookup tool to retrieve order details before making any refund decision. Never approve a refund without verifying the order.”
• Defines escalation rules: “Escalate any refund request over $500 or any case where the customer disputes the reason for rejection.”
• Enforces business rules: “Apply the 30-day return policy. Items marked as Final Sale are not eligible for refund.”
• Sets tone and format: “Respond professionally and empathetically. Always confirm the resolution step before closing the interaction.”

User Prompt (passed at runtime — changes with every request)

Customer Email: {{Customer_Email}}
Order ID: {{Order_ID}}
Refund Reason: {{Refund_Reason}}
Request Date: {{Request_Date}}

The {{brackets}} insert dynamic values at runtime — making the agent flexible enough to handle thousands of different customer cases without changing the core system prompt logic. Each request gets the same decision framework applied to different data.

How Prompts Control UiPath AI Agent Behaviour

UiPath AI agent prompt design patterns enterprise — understanding how prompts directly control six dimensions of agent behaviour:

01. Scope Control

The system prompt defines what the agent will and will not handle. A tightly scoped system prompt prevents the agent from answering out-of-scope questions, taking unauthorized actions, or producing responses that fall outside its defined function. Without explicit scope boundaries, agents drift — answering general questions they were not built for and producing unreliable outputs.

02. Decision Logic

Business rules encoded in the system prompt guide the agent’s decision-making without requiring custom code for every scenario. Escalation thresholds, approval conditions, exception handling — all defined in plain language within the system prompt and applied consistently at runtime.

03. Tool Invocation

The system prompt tells the agent when to use which tools — and when not to. “Always use the Order Lookup tool before processing a refund” is a system prompt instruction that ensures the agent never makes a refund decision without verifying the order, regardless of what the user input contains.

04. Tone and Format

Response format, language style, and communication tone are controlled entirely through the system prompt. “Respond in bullet points when listing steps” or “Always address the customer by first name” are prompt-level instructions that produce consistent, professional agent outputs without requiring template-based response systems.

05. Dynamic Data Application

The user prompt controls which specific data the agent processes for each individual request. The {{variable}} syntax inserts runtime values — customer identifiers, transaction amounts, case references — enabling the same agent to handle unlimited variations of a request type without prompt modification.

06. Escalation Triggers

When the agent should stop and involve a human is a system prompt decision. Explicit escalation conditions — confidence thresholds, value limits, ambiguous case definitions — ensure human oversight is applied at exactly the right moments without requiring manual monitoring of every agent interaction.

Prompt Design Patterns for Common Enterprise Use Cases

How to write effective prompts for UiPath AI agents follows consistent patterns across common enterprise scenarios:

Pattern 1 — The Role + Boundary + Escalation Pattern

You are [role]. You help [users] with [scope].
You can: [permitted actions]
You cannot: [out-of-scope actions]
Always use [tool] before [action].
Escalate to a human when: [escalation conditions].
Respond in [format] using [tone].

Use for: Customer service agents, HR query agents, IT support agents.

Pattern 2 — The Data Extraction + Output Format Pattern

You are a document processing assistant.
Extract the following fields from the document provided:
– [Field 1]: [description of what to look for]
– [Field 2]: [description and acceptable formats]
If a field is not present, return ‘Not Found’.
Output as JSON with the following structure: [schema].
Do not infer values — only extract what is explicitly stated.

Use for: Invoice extraction, contract analysis, form processing agents.

Pattern 3 — The Decision + Approval Pattern

You are an [approval type] decision assistant.
Review the submitted [request type] and determine eligibility based on the following policy:
[Policy rule 1]
[Policy rule 2]
If eligible: [approval action]
If not eligible: [rejection action with required explanation]
If ambiguous or over $[threshold]: escalate with full context summary.
Never approve without confirming [required fields] are present.

Use for: Purchase order approval agents, expense validation agents, refund processing agents.

Pattern 4 — The Knowledge Q&A Pattern

You are a [domain] knowledge assistant for [organization].
Answer questions using only the information provided in the attached documents.
If the answer is not in the documents, say: “I don’t have that information — please contact [team/resource].”
Do not speculate or draw on general knowledge outside the provided documents.
Cite the document section when answering specific policy questions.

Use for: HR policy agents, compliance Q&A agents, product knowledge assistants.

Common Prompt Mistakes and How to Avoid Them

Improving UiPath AI agent performance with better prompts starts with recognizing what degrades performance:

Mistake 1 — Vague Role Definition

Bad: “You are a helpful assistant.”
Why it fails: The agent has no defined scope and will attempt to answer anything, producing unreliable and off-topic responses.
Fix: “You are a customer refund processing assistant. You only handle refund requests for orders placed within the last 90 days.”

Mistake 2 — Missing Escalation Conditions

Bad: System prompt with no escalation guidance.
Why it fails: The agent attempts to resolve every case autonomously — including cases that require human judgment — producing incorrect decisions on complex scenarios.
Fix: Define explicit escalation triggers: “Escalate to a human reviewer when the refund amount exceeds $500, when the customer disputes the policy, or when the order status is unclear.”

Mistake 3 — Contradictory Instructions

Bad: “Be concise. Always provide detailed explanations for every decision.”
Why it fails: Contradictory instructions cause inconsistent agent behaviour — sometimes brief, sometimes verbose, with no predictable pattern.
Fix: One instruction per behavioural dimension. “Provide a one-sentence decision summary followed by the key reason. Offer detailed explanation only if the customer asks.”

Mistake 4 — No Output Format Specification

Bad: System prompt with no response format guidance.
Why it fails: Agent produces inconsistent output formats — sometimes narrative, sometimes structured — making downstream automation unreliable.
Fix: “Always respond in the following format: [Status: Approved/Rejected/Escalated] | [Reason: one sentence] | [Next Step: action for the customer].”

Mistake 5 — Overloading the System Prompt

Bad: A system prompt covering 20 different scenarios, 50 business rules, and three different agent roles in one instruction block.
Why it fails: LLMs struggle to consistently apply large numbers of competing instructions — important rules get deprioritized or ignored in complex scenarios.
Fix: Split into specialized agents with focused system prompts. Use a supervisor agent to route requests to the appropriate specialist. Each specialist has a clear, bounded system prompt.

Mistake 6 — Hardcoding Dynamic Data in the System Prompt

Bad: “The customer’s email is customer@company.com. Process their refund for order #12345.”
Why it fails: The system prompt cannot change at runtime — hardcoded values make the agent inflexible and impossible to reuse across different cases.
Fix: Use {{Customer_Email}} and {{Order_ID}} in the user prompt. Keep all runtime-variable data in the user prompt where it belongs.

Advanced Prompt Engineering for UiPath Agent Performance

UiPath AI agent prompt engineering best practices guide — advanced techniques for production-grade agent performance:

Few-Shot Examples in the System Prompt

Including 2–3 examples of ideal agent interactions within the system prompt dramatically improves consistency — particularly for output format compliance and edge case handling. Show the agent exactly what a well-handled refund approval, rejection, and escalation look like. The model learns the pattern and replicates it.

Chain-of-Thought Instruction

For agents that must reason through complex decisions: “Think through the following before responding: 1. Is the order within the return window? 2. Is the item eligible for return? 3. Does the refund amount fall within auto-approval limits? 4. Based on your analysis, state your decision and reason.” Step-by-step reasoning instructions reduce hallucination and improve accuracy on judgment-intensive decisions.

Negative Examples

Tell the agent what not to do — with examples. “Do not approve refunds for items marked Final Sale, even if the customer provides a reason. Example: [bad example]. Correct response: [correct response].” Negative examples are often more effective than positive instructions for preventing specific failure modes.

Confidence Signaling

Instruct the agent to signal uncertainty explicitly: “If you are not confident in your decision based on the information provided, say ‘I need to verify this with a human reviewer’ rather than proceeding.” This instruction prevents the agent from producing confident-sounding but incorrect decisions — one of the most damaging failure modes in production agentic automation.

Prompt Versioning and Testing

UiPath supports prompt versioning through Agent Score in UiPath Studio — enabling A/B testing of prompt variants against representative test cases before promoting changes to production. Treat prompt updates with the same rigor as code releases: test, measure, compare, deploy.

How Rapidflow Helps with UiPath Agent Prompt Engineering

Rapidflow’s AI team designs and iterates system and user prompts for UiPath agents — using best-practice prompt engineering techniques to maximize agent accuracy and reliability across enterprise automation deployments.

Our prompt engineering approach covers:

  • Agent scope definition — working with your subject matter experts to define clear role boundaries, permitted actions, and escalation conditions before any prompt is written
  • System prompt architecture — designing the prompt structure, instruction sequence, and few-shot example selection for each agent
  • User prompt template design — defining the {{variable}} schema for dynamic data inputs aligned to your automation data sources
  • Tool invocation instruction design — specifying when agents use which tools and what validation steps are required before action
  • Escalation logic prompt design — encoding confidence thresholds, value limits, and ambiguous case definitions in prompt language that the LLM applies consistently
  • Output format specification — ensuring agent responses are consistently structured for downstream automation consumption
  • Prompt testing framework — running representative test case libraries against each prompt version before production deployment
  • Iterative refinement — analyzing production agent behavior patterns and refining prompts based on observed failure modes and accuracy gaps
  • Agent Score configuration — setting up UiPath’s built-in prompt evaluation framework for ongoing performance monitoring

Frequently Asked Questions

What is a system prompt in UiPath AI agent?
The system prompt in UiPath AI Agent provides the agent with its role, behavioral guidelines, tone, scope limitations, and internal instructions — set by the developer and invisible to end users.
What is a user prompt in UiPath AI agent?
The user prompt defines the type of input the agent expects from end users — shaping how the agent interprets and responds to incoming requests during runtime using dynamic {{variable}} data.
How do prompts affect UiPath AI agent performance?
Well-crafted prompts significantly improve agent accuracy, relevance, and consistency. Poor prompts lead to hallucinations, off-topic responses, and unreliable automation behavior.
What are the best practices for UiPath system prompts?
Keep system prompts concise and specific, define the agent’s role clearly, set explicit boundaries, include examples of good responses, and specify the tone and format expected.
Can prompts be iterated and improved over time in UiPath?
Yes. UiPath supports prompt versioning and A/B testing through the Agent Score feature in UiPath Studio — allowing continuous improvement of agent performance.
How does Rapidflow help with UiPath agent prompt engineering?
Rapidflow’s AI team designs and iterates system and user prompts for UiPath agents, using best-practice prompt engineering techniques to maximize agent accuracy and reliability.
LinkedIn Icon Facebook Icon YouTube Icon
info@rapidflowapps.com

Explore Rapidflow AI

An accelerator for your AI journey