Sub topic 3
Changing Topics and Instructions Based on Test Results
Assume you know Salesforce Setup, have Agentforce enabled, and have an agent with at least one topic and action. Use the conversation preview to test behavior before changing configuration.
Change the smallest useful part
Read the reasoning trace after each test. Check whether the agent chose the intended topic, followed that topic's instructions, and passed the correct inputs to its action.
Change the topic when the agent selects the wrong area of responsibility. Update its description and scope so they clearly state:
- The requests the topic handles.
- The requests it does not handle.
- Important terms or examples that identify the topic.
- The information required before an action can run.
Change instructions when the topic is correct but the response or action is wrong. Make the expected sequence explicit. For example, instruct the agent to ask for an order number before running a lookup action, and to avoid exposing another customer's data.
Reset and confirm the fix
Reset the preview conversation before retesting. A reset removes context from the earlier exchange, so the new test starts with the same conditions as the original test. Send the same utterance again, then compare:
- Selected topic.
- Selected action and input values.
- Final response.
- Any guardrail behavior.
A fix is credible when the original failure is gone and nearby cases still behave correctly. Test both a supported request and an out-of-scope request after changing a topic's boundaries.
Move beyond manual preview
Manual preview is useful for exploring behavior and debugging individual failures. Move to batch testing when you need repeatable results across many utterances, topics, actions, or instruction changes.
Before deployment, include tests for common requests, ambiguous wording, missing inputs, invalid inputs, privacy boundaries, and unsupported requests. Keep expected outcomes with each test so you can compare results after every configuration change. Run deployment checks in a representative environment and verify that required permissions, data access, and action dependencies are present.
Exercise
The agent selects Order Status but runs the lookup without an order number. What should you change first?
Show answer
Update the topic instructions to require the order number before the lookup action runs, then reset the conversation and retest.