Agent testing must cover more than whether the final answer sounds good. A useful strategy checks routing, action selection, action results, response quality, policy compliance, and the quality of human handoffs.

Because model behavior is probabilistic, the goal is not one perfect demo. The goal is repeatable evidence across representative, boundary, adversarial, and regression cases.

Agentforce test suite criteria evaluated at runtime
Official Salesforce visual used as a product reference. Source:Salesforce Trailhead - Refine Your Agents Using a Five-Step Testing Strategy

Test the system in layers

  • Start with the business job and define observable success criteria before writing test utterances.
  • Score subagent selection, actions, and final responses separately so one passing layer cannot hide another failure.
  • Include negative, ambiguous, multilingual, low-context, and malicious inputs alongside happy paths.
  • Use human review for consequential or subjective outcomes and automate the stable checks that should never regress.

Create a durable test cycle

  1. Build a small high-quality baseline set from real workflows and known failure modes.
  2. Assign severity to each criterion so a critical safety miss outweighs cosmetic success.
  3. Run the suite after changes to prompts, actions, data, permissions, models, or channels.
  4. Turn production incidents and weak traces into permanent regression cases.
Further reading

Resources

This article is based on the following Salesforce learning and product documentation.

Continue the architecture path
ObservabilityAgentforce Session Tracing: Debug Actions and Errors

Read Agentforce session traces, understand the session data model, and diagnose routing, grounding, and action failures with a worked example.

ObservabilitySeparated Regression Scores

Score topic routing, action execution, and response quality as separate regression outcomes, each with its own pass bar.

ObservabilityView Testing Center Results

Read subagent, action, and response evaluation pass rates.