Prompt Engineering
Best Practices & Guardrails
To help your Agent operate with precision, safety, and business-aligned behaviour, you can provide clear, structured instructions—similar to how a new team member receives a role brief. This ensures the Agent executes tasks confidently and consistently within your policies.
Best Practices for Defining Agent Instructions
Agent Instructions define the entity's identity, objectives, and operational boundaries. Use the following structured approach to ensure the Agent works according to your company’s policies and processes :
Instruction Component
Purpose
Example
Objective/Goal
Define the Agent's single, primary purpose.
"The Agent's main purpose is to automate document collection for SBLOC loan applications."
Inputs Required
Specify all information the Agent needs to start its operation.
"The Agent requires the user’s name and loan ID before proceeding to step 2."
Process/Steps
Outline the specific policies or steps the Agent must follow in sequence.
"Process: Always ask the user’s name first. Then, check the required documents list."
Outputs/Deliverables
Define the expected final outcome or deliverable.
"Expected final outcome is a structured JSON payload containing the loan ID and the status 'Documents Received'."
Tone/Interaction Style
Set the communication style the Agent must use with the user.
"The Agent must communicate using a professional, concise, and respectful tone."
Implementing Guardrails (Constraints/Rules)
Guardrails are mandatory limitations or boundaries that the Agent must respect during execution. Guardrails are essential for managing risk and ensuring compliance, as they instruct the AI on which actions to avoid and which data to protect.
Constraint Type
Description
Example
Process Constraint
Sets rules for the Agent's behaviour within a workflow.
"Do not call the borrower more than twice a week."
Data Constraint (PII/Security)
Instructs the Agent on what sensitive data must not be logged or exposed.
"Never output or store unmasked Social Security Numbers (SSNs) or account passwords."
Scope Constraint
Tells the Agent which parts of the system or data are forbidden to touch or modify.
"Guardrail: Do not modify any configuration files outside of the client profile directory."
Tips for Effective Prompting
Be Specific: Mention the exact policy, data, or page that the Agent should focus on to prevent ambiguity.
Use Roles: If your solution handles multiple user types (e.g., Admin, Investor, Borrower), define the role the prompt applies to.
Break Down Complexity: Avoid attempting to implement too many functions in a single, large prompt. Break complex work into smaller, testable chunks to maximize reliability.