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.
Every UiPath AI agent operates on two prompt types working together:
System prompt vs user prompt in UiPath AI agent is most clearly understood through a practical example:
• 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.”
Customer Email: {{Customer_Email}}
Order ID: {{Order_ID}}
Refund Reason: {{Refund_Reason}}
Request Date: {{Request_Date}}
UiPath AI agent prompt design patterns enterprise — understanding how prompts directly control six dimensions of agent behaviour:
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.
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.
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.
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.
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.
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.
How to write effective prompts for UiPath AI agents follows consistent patterns across common enterprise scenarios:
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.
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.
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.
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.
Improving UiPath AI agent performance with better prompts starts with recognizing what degrades performance:
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.”
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.”
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.”
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].”
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.
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.
UiPath AI agent prompt engineering best practices guide — advanced techniques for production-grade agent performance:
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.
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.
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.
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.
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.
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: