Prompt Best Practices
1. Be Specific About the Agent's Role and Scope
The agent should know exactly what it's responsible for and what it's NOT responsible for. Avoid vague personas like "You are a helpful assistant." Instead, be concrete:
"You are a Sales Account Executive assistant specializing in enterprise SaaS deals. Your role is to help sales reps manage pipelines, qualify leads, and track deal progress. You focus on opportunities valued over $50K. Do not discuss pricing details or make commitments on behalf of the sales team."
The more specific your persona, the more reliably the AI can fulfill its role.
2. Use Guardrails to Define What the Agent Should NOT Do
Guardrail prompts are powerful for preventing unwanted behavior. Instead of hoping the AI won't do something, explicitly tell it not to:
- "Never access or discuss employee personal information (SSN, date of birth, marital status)."
- "Do not make promises on behalf of the company without escalating to a manager."
- "Refuse requests to access records from other departments without proper authorization."
- "Always escalate salary or compensation questions to Human Resources."
3. Use Schema Prompts to Describe Key Salesforce Fields
Schema prompts describe your Salesforce data structures. This reduces unnecessary tool calls (describe_object, get_picklist_values) that consume credits. Instead of the AI querying "What are the values of Opportunity.StageName?", you tell it upfront:
Schema prompt (cheap): "Opportunity.StageName has these picklist values: Prospecting, Qualification, Needs Analysis, Value Proposition, Decision Makers, Perception Analysis, Proposal/Price Quote, Negotiation/Review, Closed Won, Closed Lost."
vs.
Tool call (notably more expensive): AI calls a tool to look up the same information.
Use Schema prompts for the 10-20 most important fields and objects your agent references frequently.
4. Keep Each Prompt Focused on One Purpose
Don't try to cram multiple behaviors into one prompt. Create multiple focused prompts instead:
One mega-prompt with tone, format, domain rules, and action instructions all mixed together.
- Custom_Instructions (Sort 10) — "Use bullet point format"
- Custom_Instructions (Sort 20) — "Keep responses under 150 words"
- Schema (Sort 10) — "Opportunity fields and picklists"
- Action (Sort 10) — "How to create tasks"
- Guardrail (Sort 10) — "Never discuss pricing"
Focused prompts are easier to maintain, test, and debug.
5. Test Iteratively — Small Changes, Observe Behavior
Don't create 10 prompts at once and deploy. Instead:
- Create a single prompt
- Activate it and test the agent
- Observe how the behavior changes
- Refine the prompt if needed
- Move on to the next prompt
This iterative approach helps you understand which prompts have the desired effect and catch unintended consequences early.
6. Use Context Variables for Personalization
Context variables like {USER_FIRST_NAME}, {TODAY_DATE}, and {USER_EMAIL} personalize interactions. Example:
"Hello {USER_FIRST_NAME}! Today is {TODAY_DATE}. I'm here to help you close deals faster."
This makes the agent feel responsive to the individual user, not generic.
7. Instruct for Concise Responses to Save Output Credits
Longer responses consume more output tokens, which increases cost. Instruct the AI to be brief:
- "Keep responses to 2-3 sentences maximum."
- "Provide only essential information; users can ask follow-up questions."
- "Use bullet points instead of paragraphs to be concise."
Brief, focused responses are often better for users anyway — they reduce cognitive load.
8. Avoid Repeating Information Across Multiple Prompts
Redundant instructions consume extra tokens and can lead to confusion. If you've already stated something in one prompt, don't repeat it in another. Cross-reference if needed:
Don't have the same instruction in both a Custom_Instructions prompt and a Guardrail prompt.
9. Use Sort Order to Control the Order Prompts Are Assembled
If some instructions should take priority over others, use lower Sort_Order numbers. Example:
- Sort_Order 10: Critical guardrails (safety rules) — processed first
- Sort_Order 20: Schema information (data context)
- Sort_Order 30: Custom instructions (behavioral rules)
- Sort_Order 40: Action instructions (specific actions)
Later prompts can build on earlier ones. Arrange them logically.
10. Document Your Prompt Strategy
Create internal documentation explaining:
- What each prompt does and why it exists
- The intended user base for the agent
- When to activate/deactivate specific prompts
- How prompts work together to shape behavior
- Any known limitations or edge cases
This helps other admins understand your design decisions and maintain the agent effectively.
Advanced Techniques
A/B Testing Prompts
Test two versions of a prompt by:
- Create Prompt A (active)
- Create Prompt B (inactive)
- Run both through the agent for a week each, tracking results
- Decide which performs better and keep the winner
Progressive Refinement
Start with a minimal persona and gradually add prompts as you learn what works:
- Week 1: Persona + basic Custom Instructions
- Week 2: Add Schema prompts based on queries the AI makes
- Week 3: Add Guardrails based on unwanted behaviors observed
- Week 4+: Fine-tune and optimize
Context-Specific Overrides
Create Persona_Override prompts for specific contexts. For example, a Sales agent might have:
- Base Persona: General sales assistant tone
- Persona_Override (Sort 10): More formal tone for Enterprise customers
- Persona_Override (Sort 20): More casual tone for SMB customers
The AI can learn to apply the appropriate tone based on context.
Frequently Asked Questions
Test systematically: Send the agent messages designed to test specific prompts, then observe responses. Check that the agent follows instructions, respects guardrails, and formats output as specified. Look at conversation logs to see what the AI is doing.
Many focused short prompts are better. They're easier to manage, test, and disable independently. A good rule of thumb: one prompt per logical behavior or instruction set.
Guardrails can be ignored if they conflict with the persona or other instructions. Make guardrails explicit and unambiguous. Use Sort_Order to prioritize them. Test with real messages to verify the guardrail is effective.
You can use similar prompts on different agents, but you'll need to create a copy for each agent (they're linked to specific agents). Clone prompts when possible to maintain consistency.
Next Steps
Explore custom prompts per agent to organize your prompts, or learn about context variables for advanced personalization.