Skip to main content

Trust Your Agents

Learning Objectives

After completing this unit, you’ll be able to:

  • Explain the benefits of different types of testing.
  • Describe how automated tests build confidence in your agents.
  • Explain the difference between manual and automated testing.

Before You Start

If you’re new to Agentforce agents, we recommend taking these other badges first so you’ll be familiar with the terms in this badge.

Trust Is Our Number One Value

At Salesforce, trust is deeply rooted in everything we do. That’s why we rely heavily on testing. Apex tests are automatically run with every new deployment. Unit tests make sure each unit works as expected. Flows are tested to verify that everything functions as expected. To put it simply, testing is one of the best ways to ensure trust in our products and processes.

As a Salesforce admin, testing should also be a cornerstone to make sure everything runs smoothly in your org. You can test new processes in a dedicated sandbox. You can perform user acceptance tests (UAT) with large groups of users. And once you’ve verified everything through tests, you can deploy the new process to a production environment and monitor it to make sure everything is running smoothly.

Test Agents for Trust

But what about the agents you’re creating with Agentforce? How do you make sure they’re as trustworthy and reliable as the rest of your Salesforce org?

The answer, again, is testing.

You learn a bit more about testing agents later in the module, but first take a look at some of the challenges you might encounter when testing agentic AI.

Challenge

What this sounds like

Gen AI is nondeterministic producing different outputs for the same input on different runs

“Gen AI is so nondeterministic that I don’t have the right answer to test against.”

Manual testing is not scalable

“Given the subjective nature of Gen AI, I need to rely on manual testing that is not scalable.”

Safety and ethical concerns

“Generative AI can produce harmful or unintended outputs.”

Lack of standards

“Generative AI is still new, and there are no existing standards to follow.”

If you start encountering these types of challenges, fear not. The Agentforce Testing Center is here to help.

Say Hello to the Agentforce Testing Center

The Agentforce Testing Center is designed to help overcome the challenges you might encounter when building out your Agentforce, and helps you roll out trusted AI agents in a secure, repeatable way. Testing your agents in the Agentforce Testing Center is a critical step in creating trust in your AI agents.

The Agentforce Testing Center is designed with no-code testing tools to help you easily deploy trusted agents. The testing takes place in properly configured sandboxes to isolate testing from the production environment. You can also add more tests over time as your agents get updated or are given more actions. This means your agents continue to work as your business changes and grows.

Note

Sandboxes now have access to Data Cloud and Agentforce to allow for agentic testing.

Testing Methods

There are two testing methods that are used to troubleshoot, verify, and maintain Agentforce agents: manual testing and automated testing.

Manual Testing

Agentforce Builder allows for manual testing and troubleshooting while you build and update the agent. Simply use the Conversation Preview while in the builder to ask the agent a question. You can then view the response and see how it was created. This is a great way to troubleshoot your agents and verify that the correct processes are being called based on the questions. But testing this way takes a long time, and it’s challenging to test all the possible scenarios manually. It’s also difficult and time-consuming to repeat these tests when needed. This is where the Agentforce Testing Center really shines.

Automated Testing

The Agentforce Testing Center lets you perform automated batch testing, which reduces the amount of testing time. Batch processing also lets ‌you test large numbers of user inputs. These inputs, or questions, are called utterances. An utterance might be something like, “Show me all the open opportunities for the ACME account.” There’s one utterance for every test execution. Combining multiple utterances with expected responses lets you build a batch of tests. You can use the tests over and over, adding to them as needed to ensure the agent continues to be trustworthy.

The Agentforce Testing Center also helps you do performance testing by running through a large series of tests at one time in a test environment. The Agentforce Testing Center can also use AI to generate hundreds of dynamic interactions. The Agentforce Testing Center runs tests automatically and in parallel to see what topics and actions the agents choose. After looking at the test results, you manually test and troubleshoot in Agentforce Builder to adjust instructions and guardrails as needed. Automated testing saves time that would have been lost on manually testing many different variations of a conversation.

Deploy with Confidence

Once testing is done, you can confidently deploy the agent to production without concerns of disrupting your business or corrupting your customers’ data. And you can deploy the changes by migrating them to your production environment with whatever tool you’re currently using, such as Change Sets, DevOps Center, and the Salesforce CLI that now supports Data Cloud and Agentforce.

Concerns and Limits

There are a few things to keep in mind when building and testing agents.

Cost

Running tests, manually or automatically, consumes requests and credits the same as your customers using the agent. This is true even when done in a sandbox environment. Although testing itself has a cost, the cost of not testing can be much higher. Testing consumes Einstein Requests and possibly Data Cloud credits. To learn more, see Einstein Usage and Rate Limits.

Security

Testing agents can modify CRM data. To avoid modifying data unnecessarily, be sure to use the Agentforce Testing Center and Agentforce Builder tests only in your sandbox environment.

Limits

Currently you can run up to 10 test jobs at once in a 10-hour time frame and have up to 1000 test cases per test.

Ready to take a closer look at testing and using test cases? Get hands-on practice in the next unit.

Resources

Comparta sus comentarios sobre Trailhead en la Ayuda de Salesforce.

Nos encantaría conocer su experiencia con Trailhead. Ahora puede acceder al nuevo formulario de comentarios cuando quiera desde el sitio de la Ayuda de Salesforce.

Más información Continuar para compartir comentarios