The agent passed every demo. Then, in its first week, it started sending refund questions to the shipping topic, apologized three times in one reply, and told a customer a return was approved before it checked the policy. Nobody had tested how it behaved with real, messy questions.
Agentforce testing is how you find those problems before your customers do. Agents reason through language, so the same question asked two ways can take two different paths. Testing them takes more than the click-through checks most Salesforce teams know.
This guide covers the four layers of Agentforce testing, the tools Salesforce provides, what to test, how to automate it in your release process, and who should own the work.
Table of Contents
Why Agentforce Testing Is Different
Traditional Salesforce testing checks that a button, flow, or Apex class gives the same result every time. Agents are probabilistic. They choose a topic, pick actions, and write a response, and small changes to instructions, knowledge, or the underlying model can change any of those steps.
That means Agentforce testing has to answer different questions. Did the agent choose the right topic? Did it call the right action with the right inputs? Was the answer grounded in your data? Did it follow policy, keep the right tone, and resist attempts to break it?
The Tools Salesforce Provides
Agentforce Testing Center
Salesforce announced Testing Center in November 2024, and it became generally available in sandboxes in December 2024, according to MindBlaze. In April 2026 it was rebuilt inside Agentforce Studio, next to Agent Builder and Observability, with conversation-level testing and custom evaluations. It keeps run history, so you can compare results across agent versions.
According to Gearset, teams can generate test cases with AI from the agent’s structure, write their own for specific intents and edge cases, or mix both, and simulate hundreds of interactions in one run.
Agentforce DX and the Salesforce CLI
Tests can also live in source control. Salesforce’s developer documentation explains how to deploy test definitions as aiEvaluationDefinition metadata and run them with the sf agent test run command, then pull results through the API. That makes agent tests part of the same pipeline as your Apex tests.
Synthetic data and safe sandboxes
Salesforce added synthetic data generation and state injection to Testing Center, and Data Mask and Seed protects sandbox data during testing. Our guide to Salesforce AI governance covers these controls in context.
The Four Layers of Testing
1. Utterance batch tests
Single-turn tests check routing at scale: for each question, did the agent pick the expected topic and action? Build a suite of AI-generated and hand-written cases, including misspellings, slang, and questions that sit between two topics.
2. Conversation simulation
Real customers ask follow-up questions, change their minds, and get frustrated. MindBlaze describes multi-turn simulations with synthetic personas, such as an impatient customer or a non-native English speaker, including for voice agents. Built-in metrics measure task resolution and completeness across the whole exchange.
3. Adversarial testing
Try to break the agent on purpose. Test prompt injection, jailbreak attempts, requests for other customers’ data, and out-of-policy asks such as refunds above the limit. Run this pass before first launch and after any major change in scope.
4. Production observability
Testing continues after launch. Agentforce Studio’s analytics, optimization, and health monitoring show containment, escalations, errors, and new failure patterns in live traffic. Feed what you find back into the test suite.

What to Test
| Area | What a pass looks like |
|---|---|
| Routing | The right topic and action for each request |
| Grounding | Answers come from your data and knowledge, without invented details |
| Policy | Identity checks, limits, and required disclosures always hold |
| Resolution | The customer’s original request is completed |
| Tone | Brand voice, clear next steps, no premature success claims |
| Safety | The agent refuses injection attempts and out-of-scope requests |
MindBlaze recommends moving hard policy rules out of prompts and into deterministic logic with Agent Script, then testing that each rule holds. It also notes that some evaluations are judged by a language model, so people should review a sample of results, especially passes that only just cleared the threshold.
Agentforce Testing in Your Release Process
Agents need retesting more often than most teams expect. Rerun your suite when you change instructions, topics, actions, or knowledge, when the underlying model changes, and with every Salesforce release. Our guide to the Salesforce Spring ’27 release shows how to fit agent tests into release preparation.
A practical setup looks like this:
- Store test definitions in source control next to the agent’s metadata.
- Run the batch suite in CI with the Salesforce CLI on every change.
- Block deployment when key tests fail.
- Run conversation simulations before each release.
- Review production analytics weekly and add new failure cases to the suite.
Run suites in sandboxes. MindBlaze warns that batch runs use model capacity and can fire real actions, and that updating instructions or actions can take an agent offline mid-update, so plan change windows. If your team runs a DevOps pipeline, our guide to hiring a Salesforce DevOps engineer covers the skills to automate this.
Common Testing Mistakes
- Testing only the happy path. Demo questions pass. Real questions are messier.
- Testing once. A suite that passed in spring can fail after a knowledge update in summer.
- Trusting every automated score. Sample results by hand, especially borderline passes.
- Testing in production. Batch runs can trigger real actions on real records.
- No owner. When builders test their own agents, blind spots stay hidden.
A Starter Test Plan for Your First Agent
For a first agent, such as an order status agent, a simple plan covers most risks:
- 50 to 100 batch cases covering every topic, with at least five ways of asking each question
- Ten edge cases, such as questions that fit two topics or mention two orders
- Five conversation simulations with different personas, including one that changes its mind mid-chat
- Ten adversarial cases, including requests for another customer’s data and attempts to override instructions
- A sign-off checklist agreed with the business owner, listing the rules that must never break
Start small and grow the suite with every real failure you find. Test runs and production traffic both use capacity, so check how testing fits your credit budget with our guide to Agentforce pricing. If you need extra hands for a launch, our Salesforce contractor rates guide shows typical costs for contract QA support.
Who Owns Agent Testing
| Role | Testing work |
|---|---|
| QA tester | Test design, suites, regression, adversarial passes |
| Agentforce specialist | Topics, instructions, fixes based on test results |
| Developer | Actions, Apex and Flow tests, CI pipeline |
| Business owner | Signs off on policy rules and quality thresholds |
| Architect | Test strategy across agents and releases |
Many teams already have Salesforce testers whose skills carry over well. Our guide to hiring a Salesforce QA tester covers what to look for, and our guides to the Agentforce Specialist role and hiring an Agentforce architect cover the build side. Voice agents need their own test plan, which our guide to Agentforce Contact Center touches on. A Salesforce center of excellence can set the quality bar that every agent must meet, and our guide to Salesforce AI shows where agents fit in the wider platform.
Our recruiters are Salesforce certified and follow every change to Agentforce. We help teams find QA testers, Agentforce specialists, and DevOps engineers who keep agents reliable, from permanent hires to our vetted network of contractors.
Frequently Asked Questions
What is Agentforce Testing Center?
Agentforce Testing Center is Salesforce’s tool for testing AI agents before and after launch. It runs batches of test cases, simulates conversations, and keeps run history inside Agentforce Studio.
Can I automate Agentforce testing?
Yes. Test definitions can be deployed as aiEvaluationDefinition metadata and run with the sf agent test run command in the Salesforce CLI, so tests can run in a CI pipeline.
Should I test agents in production?
Run test suites in sandboxes. Batch runs use model capacity and can fire real actions. Use production analytics and monitoring to watch live behavior.
How often should I retest an agent?
Retest after any change to instructions, topics, actions, or knowledge, after model changes, and with every Salesforce release.
What should Agentforce tests check?
Routing, grounding, policy rules, task resolution, tone, and resistance to prompt injection and out-of-scope requests.
Who should test Agentforce agents?
A QA tester should own the test plan, working with the Agentforce specialist who builds the agent and the business owner who signs off on quality.
Test Like Your Customers Will
Good Agentforce testing covers routing, conversations, attacks, and live behavior, and it runs every time something changes. Build the suite with the agent, automate it, and give it a clear owner.
Need QA and Agentforce talent? Talk to our Salesforce recruiters.



