Skip to main content

Code reviews rule: Insufficient length of instructions in Agentforce topic

Written by David Martin
Updated this week

Insufficient length of instructions in Agentforce topic

Why is this an issue?

This rule checks that the masterLabel, description, and scope fields in a GenAiPlugin contain enough words to be meaningful. Agentforce topics need sufficient instructions to function effectively:

  • Invocation accuracy: The agent relies on descriptive names and descriptions to determine when to invoke a plugin

  • Guard rails: The scope defines boundaries for what the plugin should and should not do

  • Consistency: Detailed descriptions and scope ensure predictable plugin behavior

Short or vague fields lead to:

  • Plugins being invoked at inappropriate times or skipped when needed

  • Agent responses that don't meet expectations

  • Unpredictable behavior across similar queries

Examples

Example of incorrect topic configuration:

<GenAiPlugin>
<masterLabel>Order Support</masterLabel>
<description>Helps with orders</description>
<scope>Help the customer with their order.</scope>
<!-- Too brief - lacks specifics -->
</GenAiPlugin>

Example of correct topic configuration:

<GenAiPlugin>
<masterLabel>Order Support</masterLabel>
<description>Handles customer inquiries about order status,
shipping, delivery, and order modifications</description>
<scope>
You help customers with order-related inquiries.

You CAN help with:
- Checking order status and tracking information
- Estimated delivery dates
- Modifying orders that haven't shipped
- Reporting missing or damaged items

You CANNOT help with:
- Processing refunds (escalate to human agent)
- Price matching or discounts
- Product recommendations

Always verify the customer's identity before sharing order details.
For orders older than 90 days, escalate to human support.
</scope>
</GenAiPlugin>

How can I fix violations?

  1. Expand instructions: Provide detailed guidance on what the topic handles.

  2. Define boundaries: Specify what the topic should and should not do.

  3. Add context: Include relevant business rules and escalation criteria.

  4. Review with stakeholders: Ensure instructions match business requirements.

Configuration options

Property

Description

Default

minNameWordCount

Minimum number of words required in the masterLabel field

5

minDescriptionWordCount

Minimum number of words required in the description field

15

minScopeWordCount

Minimum number of words required in the scope field

15

When should I disable this rule?

You may dismiss specific violations for simple utility topics, but most topics benefit from detailed instructions.

Resources

Did this answer your question?